Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0b3f00b0d |
@@ -96,7 +96,6 @@ doc/man/pkcs11-tokens.8in
|
||||
/GPATH
|
||||
/GRTAGS
|
||||
/GTAGS
|
||||
TAGS
|
||||
# Emacs specific files
|
||||
\.dir-locals-2.el
|
||||
/emacs.desktop
|
||||
|
||||
+396
-209
@@ -51,21 +51,12 @@ variables:
|
||||
# cross-testrun files as there is no need to use that feature in CI.
|
||||
PYTEST_ADDOPTS: "-p no:cacheprovider"
|
||||
|
||||
# Default platforms to run "stress" tests on
|
||||
BIND_STRESS_TEST_OS: linux
|
||||
BIND_STRESS_TEST_ARCH: amd64
|
||||
|
||||
HYPOTHESIS_PROFILE: "ci"
|
||||
|
||||
# Some jobs may clean up the build artifacts unless this is set to 0.
|
||||
CLEAN_BUILD_ARTIFACTS_ON_SUCCESS: 1
|
||||
|
||||
# DNS Shotgun performance testing defaults
|
||||
SHOTGUN_ROUNDS: 1
|
||||
SHOTGUN_DURATION: 120
|
||||
# allow unlimited improvements against baseline
|
||||
SHOTGUN_EVAL_THRESHOLD_CPU_MIN: '-inf'
|
||||
SHOTGUN_EVAL_THRESHOLD_MEMORY_MIN: '-inf'
|
||||
SHOTGUN_EVAL_THRESHOLD_RCODE_MAX: '+inf'
|
||||
SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_MIN: '-inf'
|
||||
SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_DRIFT_MIN: '-inf'
|
||||
|
||||
default:
|
||||
# Allow all running CI jobs to be automatically canceled when a new
|
||||
# version of a branch is pushed.
|
||||
@@ -117,55 +108,16 @@ stages:
|
||||
- runner-manager
|
||||
- aarch64
|
||||
|
||||
.freebsd-autoscaler-13-amd64-tags: &freebsd_autoscaler_13_amd64_tags
|
||||
# Autoscaling GitLab Runner on AWS EC2 (FreeBSD)
|
||||
|
||||
.freebsd-stress-amd64: &freebsd_stress_amd64
|
||||
tags:
|
||||
- amd64
|
||||
- autoscaler
|
||||
- bsd-stress-test
|
||||
- aws
|
||||
- bsd-stress-test-1
|
||||
- autoscaler
|
||||
- shell
|
||||
- stress-test
|
||||
|
||||
.freebsd-autoscaler-14-amd64-tags: &freebsd_autoscaler_14_amd64_tags
|
||||
tags:
|
||||
- amd64
|
||||
- autoscaler
|
||||
- aws
|
||||
- bsd-stress-test-2
|
||||
- shell
|
||||
- stress-test
|
||||
|
||||
.freebsd-autoscaler-amd64: &freebsd_autoscaler_amd64
|
||||
variables:
|
||||
CC: clang
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
# Even though there's only one job per runtime environment, the GitLab
|
||||
# "instance" executor insists on cloning the Git repository to a path that
|
||||
# contains a variable number from zero to the "maximum concurrent instances
|
||||
# count" allowed on the GitLab Runner. See the "0" directory in this
|
||||
# example path: /home/ec2-user/builds/t1_4FZzvz/0/isc-projects/bind9/.git/.
|
||||
#
|
||||
# This is not a problem for isolated jobs like "stress" tests that depend
|
||||
# on no other jobs. However, it is a problem for jobs that need other jobs'
|
||||
# artifacts. For example, a system test job that has its Git repo cloned to
|
||||
# the "/1/" sub-path will fail if it downloads build job artifacts that
|
||||
# have ./configure output files with "/0/" in its sub-path recorded.
|
||||
GIT_CLONE_PATH: "/home/ec2-user/builds/${CI_PROJECT_PATH}/"
|
||||
# Use MIT Kerberos5 for BIND 9 GSS-API support because of FreeBSD Heimdal
|
||||
# incompatibility; see https://bugs.freebsd.org/275241.
|
||||
EXTRA_CONFIGURE: "${WITH_READLINE_EDITLINE} --with-gssapi=/usr/local/bin/krb5-config"
|
||||
|
||||
# Autoscaling GitLab Runner on AWS EC2 (FreeBSD 13)
|
||||
|
||||
.freebsd-autoscaler-13-amd64: &freebsd_autoscaler_13_amd64
|
||||
<<: *freebsd_autoscaler_amd64
|
||||
<<: *freebsd_autoscaler_13_amd64_tags
|
||||
|
||||
# Autoscaling GitLab Runner on AWS EC2 (FreeBSD 14)
|
||||
|
||||
.freebsd-autoscaler-14-amd64: &freebsd_autoscaler_14_amd64
|
||||
<<: *freebsd_autoscaler_amd64
|
||||
<<: *freebsd_autoscaler_14_amd64_tags
|
||||
|
||||
### Docker Image Templates
|
||||
|
||||
@@ -253,6 +205,14 @@ stages:
|
||||
|
||||
### QCOW2 Image Templates
|
||||
|
||||
.freebsd-13-amd64: &freebsd_13_amd64_image
|
||||
image: "freebsd-13.4-x86_64"
|
||||
<<: *libvirt_amd64
|
||||
|
||||
.freebsd-14-amd64: &freebsd_14_amd64_image
|
||||
image: "freebsd-14.2-x86_64"
|
||||
<<: *libvirt_amd64
|
||||
|
||||
.openbsd-amd64: &openbsd_amd64_image
|
||||
image: "openbsd-7.6-x86_64"
|
||||
<<: *libvirt_amd64
|
||||
@@ -260,18 +220,31 @@ stages:
|
||||
### Job Templates
|
||||
|
||||
.api-pipelines-schedules-tags-triggers-web-triggering-rules: &api_pipelines_schedules_tags_triggers_web_triggering_rules
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE =~ /^(api|pipeline|schedule|trigger|web)$/'
|
||||
- if: '$CI_COMMIT_TAG != null'
|
||||
only:
|
||||
- api
|
||||
- pipelines
|
||||
- schedules
|
||||
- tags
|
||||
- triggers
|
||||
- web
|
||||
|
||||
.api-pipelines-schedules-triggers-web-triggering-rules: &api_pipelines_schedules_triggers_web_triggering_rules
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE =~ /^(api|pipeline|schedule|trigger|web)$/'
|
||||
only:
|
||||
- api
|
||||
- pipelines
|
||||
- schedules
|
||||
- triggers
|
||||
- web
|
||||
|
||||
.default-triggering-rules: &default_triggering_rules
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE =~ /^(api|merge_request_event|pipeline|schedule|trigger|web)$/'
|
||||
- if: '$CI_COMMIT_TAG != null'
|
||||
only:
|
||||
- api
|
||||
- merge_requests
|
||||
- pipelines
|
||||
- schedules
|
||||
- tags
|
||||
- triggers
|
||||
- web
|
||||
|
||||
.precheck: &precheck_job
|
||||
<<: *default_triggering_rules
|
||||
@@ -371,41 +344,18 @@ stages:
|
||||
|
||||
.shotgun: &shotgun_job
|
||||
<<: *base_image
|
||||
<<: *api_pipelines_schedules_tags_triggers_web_triggering_rules
|
||||
stage: performance
|
||||
rules:
|
||||
- &shotgun_rule_mr
|
||||
if: '$CI_MERGE_REQUEST_DIFF_BASE_SHA != null'
|
||||
variables:
|
||||
BASELINE: '$CI_MERGE_REQUEST_DIFF_BASE_SHA'
|
||||
- &shotgun_rule_tag
|
||||
if: '$CI_COMMIT_TAG != null'
|
||||
variables:
|
||||
SHOTGUN_ROUNDS: 3
|
||||
- &shotgun_rule_other
|
||||
if: '$CI_PIPELINE_SOURCE =~ /^(api|pipeline|schedule|trigger|web)$/'
|
||||
# when using data from a single run, the overall instability of the results
|
||||
# causes quite high false positive rate, rerun the test to attemp to reduce those
|
||||
retry: 1
|
||||
script:
|
||||
- if [ -z "$BASELINE" ]; then export BASELINE=$BIND_BASELINE_VERSION; fi # this dotenv variable can't be set in the rules section, because rules are evaluated before any jobs run
|
||||
- if [ -z "$CI_COMMIT_TAG" ]; then export SHOTGUN_ROUNDS=1; else export SHOTGUN_ROUNDS=3; fi
|
||||
- PIPELINE_ID=$(curl -s -X POST --fail
|
||||
-F "token=$CI_JOB_TOKEN"
|
||||
-F ref=main
|
||||
-F "variables[SHOTGUN_TEST_VERSION]=['$CI_COMMIT_REF_NAME', '$BASELINE']"
|
||||
-F "variables[SHOTGUN_TEST_VERSION]=['$CI_COMMIT_REF_NAME', '$BIND_BASELINE_VERSION']"
|
||||
-F "variables[SHOTGUN_DURATION]=300"
|
||||
-F "variables[SHOTGUN_ROUNDS]=$SHOTGUN_ROUNDS"
|
||||
-F "variables[SHOTGUN_TRAFFIC_MULTIPLIER]=$SHOTGUN_TRAFFIC_MULTIPLIER"
|
||||
-F "variables[SHOTGUN_SCENARIO]=$SHOTGUN_SCENARIO"
|
||||
-F "variables[SHOTGUN_EVAL_THRESHOLD_CPU_MIN]=$SHOTGUN_EVAL_THRESHOLD_CPU_MIN"
|
||||
-F "variables[SHOTGUN_EVAL_THRESHOLD_CPU_MAX]=$SHOTGUN_EVAL_THRESHOLD_CPU_MAX"
|
||||
-F "variables[SHOTGUN_EVAL_THRESHOLD_MEMORY_MIN]=$SHOTGUN_EVAL_THRESHOLD_MEMORY_MIN"
|
||||
-F "variables[SHOTGUN_EVAL_THRESHOLD_MEMORY_MAX]=$SHOTGUN_EVAL_THRESHOLD_MEMORY_MAX"
|
||||
-F "variables[SHOTGUN_EVAL_THRESHOLD_RCODE_MIN]=$SHOTGUN_EVAL_THRESHOLD_RCODE_MIN"
|
||||
-F "variables[SHOTGUN_EVAL_THRESHOLD_RCODE_MAX]=$SHOTGUN_EVAL_THRESHOLD_RCODE_MAX"
|
||||
-F "variables[SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_MIN]=$SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_MIN"
|
||||
-F "variables[SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_MAX]=$SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_MAX"
|
||||
-F "variables[SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_DRIFT_MIN]=$SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_DRIFT_MIN"
|
||||
-F "variables[SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_DRIFT_MAX]=$SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_DRIFT_MAX"
|
||||
https://gitlab.isc.org/api/v4/projects/188/trigger/pipeline | jq .id)
|
||||
- util/ci-wait-shotgun.py $PIPELINE_ID
|
||||
needs:
|
||||
@@ -427,7 +377,6 @@ stages:
|
||||
- >
|
||||
"$PYTEST" --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "$TEST_PARALLEL_JOBS" | tee pytest.out.txt
|
||||
- '( ! grep -F "grep: warning:" pytest.out.txt )'
|
||||
- test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || ( cd ../../.. && make clean >/dev/null 2>&1 )
|
||||
after_script:
|
||||
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
|
||||
- *display_pytest_failures
|
||||
@@ -482,7 +431,6 @@ stages:
|
||||
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
|
||||
script:
|
||||
- make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1
|
||||
- test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || make clean >/dev/null 2>&1
|
||||
after_script:
|
||||
- test -d bind-* && cd bind-*
|
||||
- REALSOURCEDIR="$PWD"
|
||||
@@ -519,12 +467,10 @@ stages:
|
||||
junit: junit.xml
|
||||
|
||||
.docs: &docs_job
|
||||
variables:
|
||||
DOC_MAKE_TARGET: doc
|
||||
stage: docs
|
||||
script:
|
||||
- *configure
|
||||
- make -j${BUILD_PARALLEL_JOBS:-1} -k ${DOC_MAKE_TARGET} V=1
|
||||
- make -j${BUILD_PARALLEL_JOBS:-1} -k doc V=1
|
||||
- find doc/man/ -maxdepth 1 -name "*.[0-9]" -exec mandoc -T lint "{}" \; | ( ! grep -v -e "skipping paragraph macro. sp after" -e "unknown font, skipping request. ft C" -e "input text line longer than 80 bytes" )
|
||||
|
||||
.respdiff: &respdiff_job
|
||||
@@ -562,8 +508,6 @@ misc:
|
||||
- if git grep SYSTEMTESTTOP -- ':!.gitlab-ci.yml'; then echo 'Please use relative paths instead of $SYSTEMTESTTOP.'; exit 1; fi
|
||||
- bash util/unused-headers.sh
|
||||
- bash util/xmllint-html.sh
|
||||
# Check dangling symlinks in the repository
|
||||
- if find . -xtype l | grep .; then exit 1; fi
|
||||
needs: []
|
||||
artifacts:
|
||||
paths:
|
||||
@@ -587,7 +531,7 @@ vulture:
|
||||
<<: *precheck_job
|
||||
needs: []
|
||||
script:
|
||||
- vulture --exclude "*ans.py,conftest.py,isctest" --ignore-names "pytestmark" bin/tests/system/
|
||||
- vulture --exclude "*/ans*/ans.py,conftest.py,isctest" --ignore-names "pytestmark" bin/tests/system/
|
||||
|
||||
ci-variables:
|
||||
stage: precheck
|
||||
@@ -620,29 +564,21 @@ clang-format:
|
||||
when: on_failure
|
||||
|
||||
coccinelle:
|
||||
######################################################################
|
||||
# Revert to using the "precheck_job" anchor after the "base" image is
|
||||
# upgraded to Debian trixie, which has Coccinelle 1.2.
|
||||
<<: *default_triggering_rules
|
||||
<<: *debian_sid_amd64_image
|
||||
stage: precheck
|
||||
######################################################################
|
||||
<<: *precheck_job
|
||||
needs: []
|
||||
script:
|
||||
- util/check-cocci
|
||||
- if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
|
||||
|
||||
pylint:
|
||||
<<: *default_triggering_rules
|
||||
<<: *debian_sid_amd64_image
|
||||
stage: precheck
|
||||
<<: *precheck_job
|
||||
needs: []
|
||||
variables:
|
||||
PYTHONPATH: "${CI_PROJECT_DIR}/bin/tests/system"
|
||||
script:
|
||||
- pylint --rcfile $CI_PROJECT_DIR/.pylintrc $(git ls-files '*.py' | grep -vE '(ans\.py|dangerfile\.py|^bin/tests/system/|^contrib/)')
|
||||
# Ignore Pylint wrong-import-position error in system test to enable use of pytest.importorskip
|
||||
- pylint --rcfile $CI_PROJECT_DIR/.pylintrc --disable=wrong-import-position $(git ls-files 'bin/tests/system/*.py' | grep -vE '(ans\.py|vulture_ignore_list\.py)')
|
||||
- pylint --rcfile $CI_PROJECT_DIR/.pylintrc --disable=wrong-import-position $(git ls-files 'bin/tests/system/*.py' | grep -vE 'ans\.py')
|
||||
|
||||
reuse:
|
||||
<<: *precheck_job
|
||||
@@ -668,12 +604,18 @@ shfmt:
|
||||
|
||||
danger:
|
||||
<<: *precheck_job
|
||||
# Keep the GIT_DEPTH environment variable set to a "high number" before
|
||||
# https://github.com/libgit2/libgit2/pull/6662 is addressed and integrated
|
||||
# into pygit2.
|
||||
variables:
|
||||
GIT_DEPTH: 1000
|
||||
needs: []
|
||||
script:
|
||||
- pip install git+https://gitlab.isc.org/isc-projects/hazard.git
|
||||
- hazard
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
only:
|
||||
refs:
|
||||
- merge_requests
|
||||
|
||||
checkbashisms:
|
||||
<<: *precheck_job
|
||||
@@ -682,9 +624,7 @@ checkbashisms:
|
||||
- checkbashisms $(find . -path './.git' -prune -o -type f -exec sh -c 'head -n 1 "{}" | grep -qsF "#!/bin/sh"' \; -print)
|
||||
|
||||
mypy:
|
||||
<<: *default_triggering_rules
|
||||
<<: *debian_sid_amd64_image
|
||||
stage: precheck
|
||||
<<: *precheck_job
|
||||
script:
|
||||
- mypy "bin/tests/system/isctest/"
|
||||
|
||||
@@ -721,33 +661,18 @@ changelog:
|
||||
GIT_AUTHOR_EMAIL: $GITLAB_USER_EMAIL
|
||||
GIT_COMMITTER_NAME: $GITLAB_USER_NAME
|
||||
GIT_COMMITTER_EMAIL: $GITLAB_USER_EMAIL
|
||||
DOC_MAKE_TARGET: html
|
||||
before_script:
|
||||
- echo -e "$CI_MERGE_REQUEST_TITLE\n" > commitmsg
|
||||
- sed -i 's/^Draft:\s*//' commitmsg
|
||||
- echo -e "$CI_MERGE_REQUEST_DESCRIPTION" >> commitmsg
|
||||
- git commit --allow-empty -F commitmsg
|
||||
- ./contrib/gitchangelog/gitchangelog.py HEAD^..HEAD >> $(ls doc/changelog/changelog-9.* | sort --version-sort | tail -n 1)
|
||||
after_script:
|
||||
- git diff
|
||||
- ./contrib/gitchangelog/gitchangelog.py HEAD^..HEAD
|
||||
needs:
|
||||
- job: autoreconf
|
||||
artifacts: true
|
||||
artifacts:
|
||||
untracked: true
|
||||
|
||||
linkcheck:
|
||||
<<: *base_image
|
||||
stage: docs
|
||||
script:
|
||||
- pushd doc/arm/ > /dev/null && sphinx-build -b linkcheck . linkcheck_output/
|
||||
artifacts:
|
||||
paths:
|
||||
- doc/arm/linkcheck_output/
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "schedule"'
|
||||
needs: []
|
||||
|
||||
docs:
|
||||
<<: *default_triggering_rules
|
||||
<<: *base_image
|
||||
@@ -819,6 +744,18 @@ cross-version-config-tests:
|
||||
untracked: true
|
||||
expire_in: "1 day"
|
||||
when: always
|
||||
# Changes in the January milestone necessitate allowing this job to fail. The
|
||||
# "soft failure" should be reverted when January releases are published.
|
||||
# - #4261 introduced extra artifacts check but missed a file visible only in
|
||||
# this job. This is fixed in !9815 but present in December releases.
|
||||
# System test affected: mkeys.
|
||||
# - #4666 removed the "fixed" value for the "rrset-order" option, but the
|
||||
# value is still present in the December release system test.
|
||||
# System test affected: rrsetorder.
|
||||
# - #4482 removed the "dnssec-must-be-secure" feature that is still present
|
||||
# in the December release.
|
||||
# System tests affected: autosign, dnssec, and dsdigest.
|
||||
allow_failure: true
|
||||
|
||||
# Jobs for regular GCC builds on Alpine Linux 3.21 (amd64)
|
||||
|
||||
@@ -965,8 +902,7 @@ gcc:bookworm:amd64:
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} --coverage -O0"
|
||||
# Tracing needs to be disabled otherwise gcovr fails
|
||||
EXTRA_CONFIGURE: "--with-libidn2 ${WITH_READLINE_LIBEDIT} --disable-tracing"
|
||||
EXTRA_CONFIGURE: "--with-libidn2 ${WITH_READLINE_LIBEDIT}"
|
||||
RUN_MAKE_INSTALL: 1
|
||||
<<: *debian_bookworm_amd64_image
|
||||
<<: *build_job
|
||||
@@ -976,9 +912,8 @@ system:gcc:bookworm:amd64:
|
||||
<<: *system_test_gcov_job
|
||||
variables:
|
||||
CI_ENABLE_ALL_TESTS: 1
|
||||
CLEAN_BUILD_ARTIFACTS_ON_SUCCESS: 0
|
||||
TZ: Australia/Sydney
|
||||
needs: # using artifacts from unit test job is required for gcov
|
||||
needs:
|
||||
- job: unit:gcc:bookworm:amd64
|
||||
artifacts: true
|
||||
|
||||
@@ -987,7 +922,6 @@ unit:gcc:bookworm:amd64:
|
||||
<<: *unit_test_gcov_job
|
||||
variables:
|
||||
CI_ENABLE_ALL_TESTS: 1
|
||||
CLEAN_BUILD_ARTIFACTS_ON_SUCCESS: 0
|
||||
needs:
|
||||
- job: gcc:bookworm:amd64
|
||||
artifacts: true
|
||||
@@ -1006,7 +940,7 @@ system:gcc:bookworm:rbt:amd64:
|
||||
<<: *debian_bookworm_amd64_image
|
||||
<<: *system_test_job
|
||||
needs:
|
||||
- job: gcc:bookworm:rbt:amd64
|
||||
- job: unit:gcc:bookworm:rbt:amd64
|
||||
artifacts: true
|
||||
|
||||
unit:gcc:bookworm:rbt:amd64:
|
||||
@@ -1320,8 +1254,6 @@ clang:asan:
|
||||
<<: *build_job
|
||||
|
||||
system:clang:asan:
|
||||
variables:
|
||||
LSAN_OPTIONS: "suppressions=$CI_PROJECT_DIR/suppr-lsan.txt"
|
||||
<<: *base_image
|
||||
<<: *system_test_job
|
||||
needs:
|
||||
@@ -1341,7 +1273,7 @@ gcc:tsan:
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Wno-stringop-overread -ggdb -O2 -fsanitize=thread"
|
||||
LDFLAGS: "-fsanitize=thread -Wl,--disable-new-dtags"
|
||||
LDFLAGS: "-fsanitize=thread"
|
||||
EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock --without-jemalloc PKG_CONFIG_PATH=/opt/tsan/lib/pkgconfig"
|
||||
<<: *tsan_fedora_41_amd64_image
|
||||
<<: *build_job
|
||||
@@ -1370,8 +1302,7 @@ clang:tsan:
|
||||
variables:
|
||||
CC: "${CLANG}"
|
||||
CFLAGS: "${CFLAGS_COMMON} -ggdb -O2 -fsanitize=thread"
|
||||
# -Wl,--disable-new-dtags ensures that Clang creates valid TSAN reports
|
||||
LDFLAGS: "-fsanitize=thread -Wl,--disable-new-dtags"
|
||||
LDFLAGS: "-fsanitize=thread"
|
||||
EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock --without-jemalloc PKG_CONFIG_PATH=/opt/tsan/lib/pkgconfig"
|
||||
|
||||
system:clang:tsan:
|
||||
@@ -1450,19 +1381,27 @@ unit:clang:bookworm:amd64:
|
||||
# Jobs for Clang builds on FreeBSD 13 (amd64)
|
||||
|
||||
clang:freebsd13:amd64:
|
||||
variables:
|
||||
CFLAGS: "${CFLAGS_COMMON}"
|
||||
# Use MIT Kerberos5 for BIND 9 GSS-API support because of FreeBSD Heimdal
|
||||
# incompatibility; see https://bugs.freebsd.org/275241.
|
||||
EXTRA_CONFIGURE: "${WITH_READLINE_LIBEDIT} --with-gssapi=/usr/local/bin/krb5-config"
|
||||
USER: gitlab-runner
|
||||
<<: *freebsd_13_amd64_image
|
||||
<<: *build_job
|
||||
<<: *freebsd_autoscaler_13_amd64
|
||||
|
||||
system:clang:freebsd13:amd64:
|
||||
<<: *freebsd_13_amd64_image
|
||||
<<: *system_test_job
|
||||
<<: *freebsd_autoscaler_13_amd64
|
||||
variables:
|
||||
USER: gitlab-runner
|
||||
needs:
|
||||
- job: clang:freebsd13:amd64
|
||||
artifacts: true
|
||||
|
||||
unit:clang:freebsd13:amd64:
|
||||
<<: *freebsd_13_amd64_image
|
||||
<<: *unit_test_job
|
||||
<<: *freebsd_autoscaler_13_amd64
|
||||
needs:
|
||||
- job: clang:freebsd13:amd64
|
||||
artifacts: true
|
||||
@@ -1470,19 +1409,27 @@ unit:clang:freebsd13:amd64:
|
||||
# Jobs for Clang builds on FreeBSD 14 (amd64)
|
||||
|
||||
clang:freebsd14:amd64:
|
||||
variables:
|
||||
CFLAGS: "${CFLAGS_COMMON}"
|
||||
# Use MIT Kerberos5 for BIND 9 GSS-API support because of FreeBSD Heimdal
|
||||
# incompatibility; see https://bugs.freebsd.org/275241.
|
||||
EXTRA_CONFIGURE: "${WITH_READLINE_EDITLINE} --with-gssapi=/usr/local/bin/krb5-config"
|
||||
USER: gitlab-runner
|
||||
<<: *freebsd_14_amd64_image
|
||||
<<: *build_job
|
||||
<<: *freebsd_autoscaler_14_amd64
|
||||
|
||||
system:clang:freebsd14:amd64:
|
||||
<<: *freebsd_14_amd64_image
|
||||
<<: *system_test_job
|
||||
<<: *freebsd_autoscaler_14_amd64
|
||||
variables:
|
||||
USER: gitlab-runner
|
||||
needs:
|
||||
- job: clang:freebsd14:amd64
|
||||
artifacts: true
|
||||
|
||||
unit:clang:freebsd14:amd64:
|
||||
<<: *freebsd_14_amd64_image
|
||||
<<: *unit_test_job
|
||||
<<: *freebsd_autoscaler_14_amd64
|
||||
needs:
|
||||
- job: clang:freebsd14:amd64
|
||||
artifacts: true
|
||||
@@ -1531,8 +1478,8 @@ release:
|
||||
artifacts: true
|
||||
- job: docs
|
||||
artifacts: true
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG != null'
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
paths:
|
||||
- "*-release"
|
||||
@@ -1575,8 +1522,8 @@ sign:
|
||||
needs:
|
||||
- job: release
|
||||
artifacts: true
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG != null'
|
||||
only:
|
||||
- tags
|
||||
when: manual
|
||||
allow_failure: false
|
||||
|
||||
@@ -1628,8 +1575,10 @@ coverity:
|
||||
- cov-int.tar.gz
|
||||
expire_in: "1 week"
|
||||
when: on_failure
|
||||
rules:
|
||||
- if: '$COVERITY_SCAN_PROJECT_NAME != null && $COVERITY_SCAN_TOKEN != null'
|
||||
only:
|
||||
variables:
|
||||
- $COVERITY_SCAN_PROJECT_NAME
|
||||
- $COVERITY_SCAN_TOKEN
|
||||
|
||||
# Respdiff tests
|
||||
|
||||
@@ -1640,10 +1589,9 @@ respdiff:
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og -DISC_TRACK_PTHREADS_OBJECTS"
|
||||
MAX_DISAGREEMENTS_PERCENTAGE: "0.15"
|
||||
MAX_DISAGREEMENTS_PERCENTAGE: "0.5"
|
||||
script:
|
||||
- bash respdiff.sh -m /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named"
|
||||
- cd ../.. && make clean >/dev/null 2>&1
|
||||
|
||||
respdiff:asan:
|
||||
<<: *respdiff_job
|
||||
@@ -1654,25 +1602,23 @@ respdiff:asan:
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og -fsanitize=address,undefined"
|
||||
LDFLAGS: "-fsanitize=address,undefined"
|
||||
EXTRA_CONFIGURE: "--without-jemalloc"
|
||||
MAX_DISAGREEMENTS_PERCENTAGE: "0.15"
|
||||
MAX_DISAGREEMENTS_PERCENTAGE: "0.5"
|
||||
script:
|
||||
- bash respdiff.sh -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named"
|
||||
- cd ../.. && make clean >/dev/null 2>&1
|
||||
|
||||
respdiff:tsan:
|
||||
<<: *respdiff_job
|
||||
<<: *default_triggering_rules
|
||||
<<: *tsan_debian_bookworm_amd64_image
|
||||
variables:
|
||||
CC: "${CLANG}"
|
||||
CFLAGS: "${CFLAGS_COMMON} -ggdb -O2 -fsanitize=thread"
|
||||
LDFLAGS: "-fsanitize=thread -Wl,--disable-new-dtags"
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og -fsanitize=thread"
|
||||
LDFLAGS: "-fsanitize=thread"
|
||||
EXTRA_CONFIGURE: "--enable-pthread-rwlock --without-jemalloc PKG_CONFIG_PATH=/opt/tsan/lib/pkgconfig"
|
||||
MAX_DISAGREEMENTS_PERCENTAGE: "0.15"
|
||||
MAX_DISAGREEMENTS_PERCENTAGE: "0.5"
|
||||
TSAN_OPTIONS: "${TSAN_OPTIONS_DEBIAN}"
|
||||
script:
|
||||
- bash respdiff.sh -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named"
|
||||
- cd ../.. && make clean >/dev/null 2>&1
|
||||
after_script:
|
||||
- *find_python
|
||||
- *parse_tsan
|
||||
@@ -1684,13 +1630,15 @@ respdiff-third-party:
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
MAX_DISAGREEMENTS_PERCENTAGE: "0.2"
|
||||
MAX_DISAGREEMENTS_PERCENTAGE: "0.5"
|
||||
script:
|
||||
- bash respdiff.sh -s third_party -q "${PWD}/100k_mixed.txt" -c 1 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}"
|
||||
- cd ../.. && make clean >/dev/null 2>&1
|
||||
|
||||
# Performance tests
|
||||
|
||||
# Run shotgun:udp right away, but delay other shotgun jobs sligthly in order to
|
||||
# allow re-use of the built container image. Otherwise, the jobs would do the
|
||||
# same builds in parallel rather than re-use the already built image.
|
||||
shotgun:udp:
|
||||
<<: *shotgun_job
|
||||
variables:
|
||||
@@ -1701,55 +1649,293 @@ shotgun:tcp:
|
||||
<<: *shotgun_job
|
||||
variables:
|
||||
SHOTGUN_SCENARIO: tcp
|
||||
SHOTGUN_TRAFFIC_MULTIPLIER: 12
|
||||
SHOTGUN_TRAFFIC_MULTIPLIER: 13
|
||||
when: delayed
|
||||
start_in: 5 minutes
|
||||
|
||||
shotgun:dot:
|
||||
<<: *shotgun_job
|
||||
variables:
|
||||
SHOTGUN_SCENARIO: dot
|
||||
SHOTGUN_TRAFFIC_MULTIPLIER: 6
|
||||
rules: &shotgun_rules_manual_mr
|
||||
- if: '$CI_MERGE_REQUEST_DIFF_BASE_SHA != null'
|
||||
variables:
|
||||
BASELINE: '$CI_MERGE_REQUEST_DIFF_BASE_SHA'
|
||||
when: manual # don't run on each MR unless requested
|
||||
allow_failure: true
|
||||
- *shotgun_rule_tag
|
||||
- *shotgun_rule_other
|
||||
|
||||
shotgun:doh-get:
|
||||
<<: *shotgun_job
|
||||
variables:
|
||||
SHOTGUN_SCENARIO: doh-get
|
||||
SHOTGUN_TRAFFIC_MULTIPLIER: 3
|
||||
SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_MAX: 0.4 # bump from the default due to increased tail-end jitter
|
||||
rules: *shotgun_rules_manual_mr
|
||||
when: delayed
|
||||
start_in: 5 minutes
|
||||
|
||||
.stress-test: &stress_test
|
||||
stage: performance
|
||||
|
||||
generate-stress-test-configs:
|
||||
<<: *base_image
|
||||
<<: *default_triggering_rules
|
||||
stage: precheck
|
||||
script:
|
||||
- util/generate-stress-test-configs.py > stress-test-configs.yml
|
||||
artifacts:
|
||||
paths:
|
||||
- stress-test-configs.yml
|
||||
needs: []
|
||||
|
||||
stress-test-child-pipeline:
|
||||
<<: *default_triggering_rules
|
||||
stage: performance
|
||||
trigger:
|
||||
include:
|
||||
- artifact: stress-test-configs.yml
|
||||
job: generate-stress-test-configs
|
||||
- *configure
|
||||
- *setup_interfaces
|
||||
- make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
|
||||
- make DESTDIR="${INSTALL_PATH}" install
|
||||
- git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git
|
||||
- cd bind9-qa/stress
|
||||
- LD_LIBRARY_PATH="${INSTALL_PATH}/usr/local/lib" BIND_INSTALL_PATH="${INSTALL_PATH}/usr/local" WORKSPACE="${CI_PROJECT_DIR}" bash stress.sh
|
||||
needs:
|
||||
- job: generate-stress-test-configs
|
||||
- job: autoreconf
|
||||
artifacts: true
|
||||
|
||||
.stress-test-long: &stress_test_long_job
|
||||
<<: *stress_test
|
||||
artifacts:
|
||||
untracked: true
|
||||
exclude:
|
||||
- "output/ns4/*.dtq*"
|
||||
- "output/ns4/large-delta-rpz*.local"
|
||||
- "output/rpz_*"
|
||||
expire_in: "1 week"
|
||||
when: always
|
||||
timeout: 2h
|
||||
|
||||
.stress-test-short: &stress_test_short_job
|
||||
<<: *stress_test
|
||||
only:
|
||||
- merge_requests
|
||||
artifacts:
|
||||
untracked: true
|
||||
exclude:
|
||||
- "output/ns4/*.dtq*"
|
||||
- "output/ns4/large-delta-rpz*.local"
|
||||
- "output/rpz_*"
|
||||
when: always
|
||||
|
||||
stress:short:authoritative:fedora:41:amd64:
|
||||
<<: *fedora_41_amd64_image
|
||||
<<: *linux_amd64
|
||||
<<: *stress_test_short_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: authoritative
|
||||
RATE: 10000
|
||||
RUN_TIME: 15
|
||||
|
||||
stress:short:recursive:fedora:41:amd64:
|
||||
<<: *fedora_41_amd64_image
|
||||
<<: *linux_amd64
|
||||
<<: *stress_test_short_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: recursive
|
||||
RATE: 10000
|
||||
RUN_TIME: 15
|
||||
|
||||
stress:short:rpz:fedora:41:amd64:
|
||||
<<: *fedora_41_amd64_image
|
||||
<<: *linux_amd64
|
||||
<<: *stress_test_short_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: rpz
|
||||
RATE: 1500
|
||||
RUN_TIME: 15
|
||||
|
||||
stress:short:authoritative:fedora:41:arm64:
|
||||
<<: *fedora_41_arm64_image
|
||||
<<: *linux_arm64
|
||||
<<: *stress_test_short_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: authoritative
|
||||
RATE: 10000
|
||||
RUN_TIME: 15
|
||||
|
||||
stress:short:recursive:fedora:41:arm64:
|
||||
<<: *fedora_41_arm64_image
|
||||
<<: *linux_arm64
|
||||
<<: *stress_test_short_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: recursive
|
||||
RATE: 10000
|
||||
RUN_TIME: 15
|
||||
|
||||
stress:short:rpz:fedora:41:arm64:
|
||||
<<: *fedora_41_arm64_image
|
||||
<<: *linux_arm64
|
||||
<<: *stress_test_short_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: rpz
|
||||
RATE: 1500
|
||||
RUN_TIME: 15
|
||||
|
||||
stress:short:authoritative:freebsd13:amd64:
|
||||
<<: *freebsd_stress_amd64
|
||||
<<: *stress_test_short_job
|
||||
variables:
|
||||
CC: clang
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/local/bin/flame
|
||||
MODE: authoritative
|
||||
RATE: 10000
|
||||
RUN_TIME: 15
|
||||
|
||||
stress:short:recursive:freebsd13:amd64:
|
||||
<<: *freebsd_stress_amd64
|
||||
<<: *stress_test_short_job
|
||||
variables:
|
||||
CC: clang
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/local/bin/flame
|
||||
MODE: recursive
|
||||
RATE: 10000
|
||||
RUN_TIME: 15
|
||||
|
||||
stress:short:rpz:freebsd13:amd64:
|
||||
<<: *freebsd_stress_amd64
|
||||
<<: *stress_test_short_job
|
||||
variables:
|
||||
CC: clang
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/local/bin/flame
|
||||
MODE: rpz
|
||||
RATE: 1500
|
||||
RUN_TIME: 15
|
||||
|
||||
stress:authoritative:fedora:41:amd64:
|
||||
<<: *fedora_41_amd64_image
|
||||
<<: *linux_amd64
|
||||
<<: *stress_test_long_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: authoritative
|
||||
RATE: 10000
|
||||
RUN_TIME: 60
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /authoritative/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
|
||||
|
||||
stress:recursive:fedora:41:amd64:
|
||||
<<: *fedora_41_amd64_image
|
||||
<<: *linux_amd64
|
||||
<<: *stress_test_long_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: recursive
|
||||
RATE: 10000
|
||||
RUN_TIME: 60
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
|
||||
|
||||
stress:rpz:fedora:41:amd64:
|
||||
<<: *fedora_41_amd64_image
|
||||
<<: *linux_amd64
|
||||
<<: *stress_test_long_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: rpz
|
||||
RATE: 1500
|
||||
RUN_TIME: 60
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /rpz/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
|
||||
|
||||
stress:authoritative:fedora:41:arm64:
|
||||
<<: *fedora_41_arm64_image
|
||||
<<: *linux_arm64
|
||||
<<: *stress_test_long_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: authoritative
|
||||
RATE: 10000
|
||||
RUN_TIME: 60
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /authoritative/i && $BIND_STRESS_TEST_ARCH =~ /arm64/i)
|
||||
|
||||
stress:recursive:fedora:41:arm64:
|
||||
<<: *fedora_41_arm64_image
|
||||
<<: *linux_arm64
|
||||
<<: *stress_test_long_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: recursive
|
||||
RATE: 10000
|
||||
RUN_TIME: 60
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /arm64/i)
|
||||
|
||||
stress:rpz:fedora:41:arm64:
|
||||
<<: *fedora_41_arm64_image
|
||||
<<: *linux_arm64
|
||||
<<: *stress_test_long_job
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/bin/flame
|
||||
MODE: rpz
|
||||
RATE: 1500
|
||||
RUN_TIME: 60
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /rpz/i && $BIND_STRESS_TEST_ARCH =~ /arm64/i)
|
||||
|
||||
stress:authoritative:freebsd13:amd64:
|
||||
<<: *freebsd_stress_amd64
|
||||
<<: *stress_test_long_job
|
||||
variables:
|
||||
CC: clang
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/local/bin/flame
|
||||
MODE: authoritative
|
||||
RATE: 10000
|
||||
RUN_TIME: 60
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /freebsd/i && $BIND_STRESS_TEST_MODE =~ /authoritative/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
|
||||
|
||||
stress:recursive:freebsd13:amd64:
|
||||
<<: *freebsd_stress_amd64
|
||||
<<: *stress_test_long_job
|
||||
variables:
|
||||
CC: clang
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/local/bin/flame
|
||||
MODE: recursive
|
||||
RATE: 10000
|
||||
RUN_TIME: 60
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /freebsd/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
|
||||
|
||||
stress:rpz:freebsd13:amd64:
|
||||
<<: *freebsd_stress_amd64
|
||||
<<: *stress_test_long_job
|
||||
variables:
|
||||
CC: clang
|
||||
CFLAGS: "${CFLAGS_COMMON} -Og"
|
||||
FLAME: /usr/local/bin/flame
|
||||
MODE: rpz
|
||||
RATE: 1500
|
||||
RUN_TIME: 60
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /freebsd/i && $BIND_STRESS_TEST_MODE =~ /rpz/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
|
||||
|
||||
# git fsck operates over the whole repository and is sufficient to schedule it
|
||||
# only in one branch, preferably "main". GitLab's clone strategy prevents us
|
||||
# from using the "bind9" repo clone; we need to clone it ourselves.
|
||||
@@ -1762,8 +1948,8 @@ fsck:
|
||||
- git clone https://gitlab.isc.org/isc-projects/bind9.git bind9-full-clone
|
||||
- cd bind9-full-clone/
|
||||
- git fsck
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "schedule"'
|
||||
only:
|
||||
- schedules
|
||||
needs: []
|
||||
|
||||
gcov:
|
||||
@@ -1815,8 +2001,9 @@ pairwise:
|
||||
- pairwise-model.txt
|
||||
- pairwise-output.*.txt
|
||||
when: on_failure
|
||||
rules:
|
||||
- if: '$PAIRWISE_TESTING != null'
|
||||
only:
|
||||
variables:
|
||||
- $PAIRWISE_TESTING
|
||||
|
||||
.post_merge_template: &post_merge
|
||||
<<: *base_image
|
||||
@@ -1839,10 +2026,10 @@ pairwise:
|
||||
- set +o pipefail; git log --format='%H' | grep --silent "$CI_COMMIT_BEFORE_SHA" && PREVIOUS_TIP_REACHABLE=1
|
||||
- test "$PREVIOUS_TIP_REACHABLE" != "1" && echo "force-push detected, stop" && exit 1
|
||||
# non-fast-forward merges are disabled so we have to have merge commit on top
|
||||
- MERGE_REQUEST_ID="$(git log -1 --format='%b' | sed --silent -e "s|^See merge request ${CI_PROJECT_PATH}\!||p")"
|
||||
- MERGE_REQUEST_ID="$(git log -1 --format='%b' | sed --silent -e 's/^See merge request [^!]\+!//p')"
|
||||
- >
|
||||
: stop if this is not a merge request in the current project\'s namespace
|
||||
- test -n "$MERGE_REQUEST_ID"
|
||||
: stop if this is not a merge request
|
||||
- test "$MERGE_REQUEST_ID" -ge 0
|
||||
- git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git
|
||||
|
||||
backports:
|
||||
@@ -1858,6 +2045,6 @@ backports:
|
||||
merged-metadata:
|
||||
<<: *post_merge
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_REF_NAME =~ /^bind-9.[0-9]+(-sub)?$/ || $CI_COMMIT_REF_NAME =~ /^v9.[0-9]+.[0-9]+-release$/ || $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH)'
|
||||
- if: '$CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_REF_NAME =~ /^bind-9.[0-9]+(-sub)?$/ || $CI_COMMIT_REF_NAME =~ /^bind-9.[0-9]+.[0-9]+-release$/ || $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH)'
|
||||
script:
|
||||
- bind9-qa/releng/after_merge.py "$CI_PROJECT_ID" "$MERGE_REQUEST_ID"
|
||||
|
||||
@@ -31,11 +31,11 @@ confidential!
|
||||
- [ ] [:link:][step_deputy] **(IM)** Pick a Deputy Incident Manager
|
||||
- [ ] [:link:][step_respond] **(IM)** Respond to the bug reporter
|
||||
- [ ] [:link:][step_public_mrs] **(SwEng)** Ensure there are no public merge requests which inadvertently disclose the issue
|
||||
- [ ] [:link:][step_coordinate_cve_id] **(SwEng)** Check if we need to coordinate with other vendors (an industry-wide CVE identifier might be necessary)
|
||||
- [ ] [:link:][step_assign_cve_id] **(IM)** Assign a CVE identifier
|
||||
- [ ] [:link:][step_note_cve_info] **(SwEng)** Update this issue with the assigned CVE identifier, the CVSS score, and the CWE category
|
||||
- [ ] [:link:][step_note_cve_info] **(SwEng)** Update this issue with the assigned CVE identifier, the CVSS score, and CWE category
|
||||
- [ ] [:link:][step_versions_affected] **(SwEng)** Determine the range of product versions affected (including the Subscription Edition)
|
||||
- [ ] [:link:][step_workarounds] **(SwEng)** Determine whether workarounds for the problem exist
|
||||
- [ ] [:link:][step_coordinate] **(SwEng)** If necessary, coordinate with other parties
|
||||
- [ ] [:link:][step_earliest_prepare] **(Support)** Prepare "earliest" notification text
|
||||
- [ ] [:link:][step_earliest_send] **(Support)** Update "earliest" notification ticket in support portal Earliest queue which will notify earliest customers
|
||||
- [ ] [:link:][step_advisory_mr] **(Support)** Create a merge request for the Security Advisory and include all readily available information in it
|
||||
@@ -48,7 +48,6 @@ confidential!
|
||||
- [ ] [:link:][step_backports] **(SwEng)** Prepare backports of the merge request addressing the problem for all affected (and still maintained) branches of a given product
|
||||
- [ ] [:link:][step_finish_advisory] **(Support)** Finish preparing the Security Advisory
|
||||
- [ ] [:link:][step_meta_issue] **(QA)** Create (or update) the private issue containing links to fixes & reproducers for all CVEs fixed in a given release cycle
|
||||
- [ ] [:link:][step_coordinate_check] **(SwEng)** Make sure other vendors are able to release on the date that was previously agreed upon
|
||||
- [ ] [:link:][step_merge_fixes] **(QA)** Merge the CVE fixes in CVE identifier order
|
||||
- [ ] [:link:][step_patches] **(QA)** Prepare a standalone patch for the last stable release of each affected (and still maintained) product branch
|
||||
- [ ] [:link:][step_asn_releases] **(QA)** Prepare ASN releases (as outlined in the Release Checklist)
|
||||
@@ -69,16 +68,15 @@ confidential!
|
||||
### On the Day of Public Disclosure
|
||||
|
||||
- [ ] [:link:][step_clearance] **(IM)** Grant QA & Marketing clearance to proceed with public release
|
||||
- [ ] [:link:][step_matrix] **(Support)** (BIND 9 only) Add the new CVEs to the vulnerability matrix in the Knowledge Base
|
||||
- [ ] [:link:][step_bump_advisory] **(Support)** Bump Document Version for the Security Advisory in Printing Press
|
||||
- [ ] [:link:][step_publish_advisory] **(Support)** Publish the Security Advisory in the Knowledge Base
|
||||
- [ ] [:link:][step_publish] **(QA/Marketing)** Publish the releases (as outlined in the release checklist)
|
||||
- [ ] [:link:][step_matrix] **(Support)** (BIND 9 only) Add the new CVEs to the vulnerability matrix in the Knowledge Base
|
||||
- [ ] [:link:][step_publish_advisory] **(Support)** Bump Document Version for the Security Advisory and publish it in the Knowledge Base
|
||||
- [ ] [:link:][step_notifications] **(First IM)** Send notification emails to third parties
|
||||
- [ ] [:link:][step_mitre] **(First IM)** Advise MITRE about the disclosed CVEs
|
||||
- [ ] [:link:][step_merge_advisory] **(First IM)** Merge the Security Advisory merge request
|
||||
- [ ] [:link:][step_embargo_end] **(IM)** Inform original reporter (if external) that the security disclosure process is complete
|
||||
- [ ] [:link:][step_asn_clear] **(Support)** Update the tickets in the ASN queues in RT that the embargo is lifted
|
||||
- [ ] [:link:][step_customers] **(Marketing)** Open a ticket in the appropriate announce queue in RT that the release is published
|
||||
- [ ] [:link:][step_customers] **(Marketing)** Open a ticket in the <software name> Announce queue that the release is published
|
||||
|
||||
### After Public Disclosure
|
||||
|
||||
@@ -87,13 +85,13 @@ confidential!
|
||||
[step_deputy]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#pick-a-deputy-incident-manager
|
||||
[step_respond]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#respond-to-the-bug-reporter
|
||||
[step_public_mrs]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#ensure-there-are-no-public-merge-requests-which-inadvertently-disclose-the-issue
|
||||
[step_coordinate_cve_id]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#check-if-we-need-to-coordinate-with-other-vendors-an-industry-wide-cve-identifier-might-be-necessary
|
||||
[step_assign_cve_id]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#assign-a-cve-identifier
|
||||
[step_note_cve_info]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#update-this-issue-with-the-assigned-cve-identifier-the-cvss-score-and-the-cwe-category
|
||||
[step_versions_affected]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#determine-the-range-of-product-versions-affected-including-the-subscription-edition
|
||||
[step_workarounds]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#determine-whether-workarounds-for-the-problem-exist
|
||||
[step_earliest_prepare]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-earliest-notification-text
|
||||
[step_earliest_send]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#update-earliest-notification-ticket-in-support-portal-earliest-queue-which-will-notify-earliest-customers
|
||||
[step_coordinate]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#if-necessary-coordinate-with-other-parties
|
||||
[step_earliest_prepare]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-earliest-notification-text-and-hand-it-off-to-marketing
|
||||
[step_earliest_send]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#update-earliest-notification-document-in-sf-portal-and-send-bulk-email-to-earliest-customers
|
||||
[step_advisory_mr]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#create-a-merge-request-for-the-security-advisory-and-include-all-readily-available-information-in-it
|
||||
[step_reproducer_mr]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-a-private-merge-request-containing-a-system-test-reproducing-the-problem
|
||||
[step_notify_support]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#notify-support-when-a-reproducer-is-ready
|
||||
@@ -104,26 +102,25 @@ confidential!
|
||||
[step_backports]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-backports-of-the-merge-request-addressing-the-problem-for-all-affected-and-still-maintained-branches-of-a-given-product
|
||||
[step_finish_advisory]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#finish-preparing-the-security-advisory
|
||||
[step_meta_issue]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#create-or-update-the-private-issue-containing-links-to-fixes-reproducers-for-all-cves-fixed-in-a-given-release-cycle
|
||||
[step_coordinate_check]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#make-sure-other-vendors-are-able-to-release-on-the-date-that-was-previously-agreed-upon
|
||||
[step_changes]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bind-9-only-reserve-a-block-of-changes-placeholders-once-the-complete-set-of-vulnerabilities-fixed-in-a-given-release-cycle-is-determined
|
||||
[step_merge_fixes]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#merge-the-cve-fixes-in-cve-identifier-order
|
||||
[step_patches]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-a-standalone-patch-for-the-last-stable-release-of-each-affected-and-still-maintained-product-branch
|
||||
[step_asn_releases]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-asn-releases-as-outlined-in-the-release-checklist
|
||||
[step_asn_links]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bind-9-only-update-the-bind-s-information-document-in-the-support-portal-with-download-links-to-the-new-versions
|
||||
[step_asn_send]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#notify-eligible-customers-by-adding-a-ticket-to-the-5-day-queue-in-rt-with-the-text-of-the-advisory-earliest-and-t-5
|
||||
[step_asn_documents]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#update-the-text-on-the-t-5-from-the-printing-press-project-and-earliest-asn-documents-in-the-sf-portal
|
||||
[step_asn_links]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bind-9-only-update-the-bind-s-information-document-in-sf-with-download-links-to-the-new-versions
|
||||
[step_asn_send]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bulk-email-eligible-customers-to-check-the-sf-portal
|
||||
[step_preannouncement]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bind-9-only-send-a-pre-announcement-email-to-the-bind-announce-mailing-list-to-alert-users-that-the-upcoming-release-will-include-security-fixes
|
||||
[step_asn_send]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#notify-eligible-customers-by-adding-a-ticket-to-the-3-day-queue-in-rt-with-the-text-of-the-advisory-t-3
|
||||
[step_packager_emails]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#send-notifications-to-os-packagers
|
||||
[step_clearance]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#grant-qa-marketing-clearance-to-proceed-with-public-release
|
||||
[step_matrix]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bind-9-only-add-the-new-cves-to-the-vulnerability-matrix-in-the-knowledge-base
|
||||
[step_bump_advisory]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bump-document-version-for-the-security-advisory-in-printing-press
|
||||
[step_publish_advisory]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#publish-the-security-advisory-in-the-knowledge-base
|
||||
[step_publish]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#publish-the-releases-as-outlined-in-the-release-checklist
|
||||
[step_matrix]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bind-9-only-add-the-new-cves-to-the-vulnerability-matrix-in-the-knowledge-base
|
||||
[step_publish_advisory]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bump-document-version-for-the-security-advisory-and-publish-it-in-the-knowledge-base
|
||||
[step_notifications]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#send-notification-emails-to-third-parties
|
||||
[step_mitre]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#advise-mitre-about-the-disclosed-cves
|
||||
[step_merge_advisory]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#merge-the-security-advisory-merge-request
|
||||
[step_embargo_end]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#inform-original-reporter-if-external-that-the-security-disclosure-process-is-complete
|
||||
[step_asn_clear]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#update-the-tickets-in-the-asn-queues-in-rt-that-the-embargo-is-lifted
|
||||
[step_customers]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#open-a-ticket-in-the-appropriate-announce-queue-in-rt-that-the-release-is-published
|
||||
[step_asn_clear]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#update-the-sf-portal-to-clear-the-asn
|
||||
[step_customers]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#email-asn-recipients-that-the-embargo-is-lifted
|
||||
[step_regression]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#merge-a-regression-test-reproducing-the-bug-into-all-affected-and-still-maintained-branches
|
||||
|
||||
/confidential
|
||||
|
||||
+11
-12
@@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
|
||||
information regarding copyright ownership.
|
||||
-->
|
||||
## BIND 9 Source Access and Contributor Guidelines
|
||||
*Nov 26, 2024*
|
||||
*May 28, 2020*
|
||||
|
||||
### Contents
|
||||
|
||||
@@ -72,13 +72,13 @@ To clone the repository, use:
|
||||
> $ git clone https://gitlab.isc.org/isc-projects/bind9.git
|
||||
|
||||
Release branch names are of the form `bind-9.X`, where X represents the second
|
||||
number in the BIND 9 version number. So, to check out the BIND 9.20
|
||||
number in the BIND 9 version number. So, to check out the BIND 9.18
|
||||
branch, use:
|
||||
|
||||
> $ git checkout bind-9.20
|
||||
> $ git checkout bind-9.18
|
||||
|
||||
Whenever a branch is ready for publication, a tag is placed of the
|
||||
form `v9.X.Y`. The 9.20.0 release, for instance, is tagged as `v9.20.0`.
|
||||
form `v9.X.Y`. The 9.18.0 release, for instance, is tagged as `v9.18.0`.
|
||||
|
||||
The branch in which the next major release is being developed is called
|
||||
`main`.
|
||||
@@ -121,9 +121,8 @@ patch will be applied.
|
||||
#### <a name="bind"></a>BIND code
|
||||
|
||||
Patches for BIND may be submitted directly via merge requests in
|
||||
[ISC's GitLab](https://gitlab.isc.org/isc-projects/bind9/) source repository for
|
||||
BIND. Please contact ISC and provide your GitLab username in order to be allowed
|
||||
to fork the project and submit merge requests.
|
||||
[ISC's GitLab](https://gitlab.isc.org/isc-projects/bind9/) source
|
||||
repository for BIND.
|
||||
|
||||
Patches can also be submitted as diffs against a specific version of
|
||||
BIND -- preferably the current top of the `main` branch. Diffs may
|
||||
@@ -145,8 +144,8 @@ we're busy with other work, it may take us a long time to get to it.
|
||||
To ensure your patch is acted on as promptly as possible, please:
|
||||
|
||||
* Try to adhere to the [BIND 9 coding style](doc/dev/style.md).
|
||||
* Run unit and system tests to ensure your change hasn't caused any
|
||||
functional regressions (these can be checked in the CI pipeline).
|
||||
* Run `make check` to ensure your change hasn't caused any
|
||||
functional regressions.
|
||||
* Document your work, both in the patch itself and in the
|
||||
accompanying email.
|
||||
* In patches that make non-trivial functional changes, include system
|
||||
@@ -157,12 +156,12 @@ To ensure your patch is acted on as promptly as possible, please:
|
||||
##### Changes to `configure`
|
||||
|
||||
If you need to make changes to `configure`, you should not edit it
|
||||
directly; instead, edit `configure.ac`, then run `autoconf`. Similarly,
|
||||
instead of editing `config.h.in` directly, edit `configure.ac` and run
|
||||
directly; instead, edit `configure.in`, then run `autoconf`. Similarly,
|
||||
instead of editing `config.h.in` directly, edit `configure.in` and run
|
||||
`autoheader`.
|
||||
|
||||
When submitting a patch as a diff, it's fine to omit the `configure`
|
||||
diffs to save space. Just send the `configure.ac` diffs and we'll
|
||||
diffs to save space. Just send the `configure.in` diffs and we'll
|
||||
generate the new `configure` during the review process.
|
||||
|
||||
##### Documentation
|
||||
|
||||
+48
-130
@@ -112,7 +112,11 @@ add(char *key, int value) {
|
||||
}
|
||||
|
||||
if (symtab == NULL) {
|
||||
isc_symtab_create(sym_mctx, freekey, sym_mctx, false, &symtab);
|
||||
result = isc_symtab_create(sym_mctx, 100, freekey, sym_mctx,
|
||||
false, &symtab);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
key = isc_mem_strdup(sym_mctx, key);
|
||||
@@ -140,97 +144,12 @@ logged(char *key, int value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
checkisservedby(dns_zone_t *zone, dns_rdatatype_t type,
|
||||
const dns_name_t *name) {
|
||||
char namebuf[DNS_NAME_FORMATSIZE + 1];
|
||||
char ownerbuf[DNS_NAME_FORMATSIZE + 1];
|
||||
/*
|
||||
* Not all getaddrinfo implementations distinguish NODATA
|
||||
* from NXDOMAIN with PF_INET6 so use PF_UNSPEC and look at
|
||||
* the returned ai_family values.
|
||||
*/
|
||||
struct addrinfo hints = {
|
||||
.ai_flags = AI_CANONNAME,
|
||||
.ai_family = PF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM,
|
||||
.ai_protocol = IPPROTO_TCP,
|
||||
};
|
||||
struct addrinfo *ai = NULL, *cur;
|
||||
bool has_type = false;
|
||||
int eai;
|
||||
|
||||
dns_name_format(name, namebuf, sizeof(namebuf) - 1);
|
||||
/*
|
||||
* Turn off search.
|
||||
*/
|
||||
if (dns_name_countlabels(name) > 1U) {
|
||||
strlcat(namebuf, ".", sizeof(namebuf));
|
||||
}
|
||||
eai = getaddrinfo(namebuf, NULL, &hints, &ai);
|
||||
|
||||
switch (eai) {
|
||||
case 0:
|
||||
cur = ai;
|
||||
while (cur != NULL) {
|
||||
if (cur->ai_family == AF_INET &&
|
||||
type == dns_rdatatype_a)
|
||||
{
|
||||
has_type = true;
|
||||
break;
|
||||
}
|
||||
if (cur->ai_family == AF_INET6 &&
|
||||
type == dns_rdatatype_aaaa)
|
||||
{
|
||||
has_type = true;
|
||||
break;
|
||||
}
|
||||
cur = cur->ai_next;
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
return has_type;
|
||||
#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
|
||||
case EAI_NODATA:
|
||||
#endif /* if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME) */
|
||||
case EAI_NONAME:
|
||||
if (!logged(namebuf, ERR_NO_ADDRESSES)) {
|
||||
dns_name_format(dns_zone_getorigin(zone), ownerbuf,
|
||||
sizeof(ownerbuf));
|
||||
dns_name_format(name, namebuf, sizeof(namebuf) - 1);
|
||||
dns_zone_log(zone, ISC_LOG_ERROR,
|
||||
"%s/NS '%s' (out of zone) "
|
||||
"has no addresses records (A or AAAA)",
|
||||
ownerbuf, namebuf);
|
||||
add(namebuf, ERR_NO_ADDRESSES);
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
|
||||
dns_name_format(dns_zone_getorigin(zone), ownerbuf,
|
||||
sizeof(ownerbuf));
|
||||
dns_name_format(name, namebuf, sizeof(namebuf) - 1);
|
||||
dns_zone_log(zone, ISC_LOG_WARNING,
|
||||
"getaddrinfo(%s) failed: %s", namebuf,
|
||||
gai_strerror(eai));
|
||||
add(namebuf, ERR_LOOKUP_FAILURE);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
dns_rdataset_t *rdataset;
|
||||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||
isc_result_t result;
|
||||
struct addrinfo hints = {
|
||||
.ai_flags = AI_CANONNAME,
|
||||
.ai_family = PF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM,
|
||||
.ai_protocol = IPPROTO_TCP,
|
||||
};
|
||||
struct addrinfo *ai = NULL, *cur;
|
||||
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")];
|
||||
@@ -238,7 +157,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
|
||||
bool match;
|
||||
const char *type;
|
||||
void *ptr = NULL;
|
||||
int eai;
|
||||
int result;
|
||||
|
||||
REQUIRE(a == NULL || !dns_rdataset_isassociated(a) ||
|
||||
a->type == dns_rdatatype_a);
|
||||
@@ -249,6 +168,12 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
|
||||
return answer;
|
||||
}
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_CANONNAME;
|
||||
hints.ai_family = PF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_protocol = IPPROTO_TCP;
|
||||
|
||||
dns_name_format(name, namebuf, sizeof(namebuf) - 1);
|
||||
/*
|
||||
* Turn off search.
|
||||
@@ -258,9 +183,9 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
|
||||
}
|
||||
dns_name_format(owner, ownerbuf, sizeof(ownerbuf));
|
||||
|
||||
eai = getaddrinfo(namebuf, NULL, &hints, &ai);
|
||||
result = getaddrinfo(namebuf, NULL, &hints, &ai);
|
||||
dns_name_format(name, namebuf, sizeof(namebuf) - 1);
|
||||
switch (eai) {
|
||||
switch (result) {
|
||||
case 0:
|
||||
/*
|
||||
* Work around broken getaddrinfo() implementations that
|
||||
@@ -303,7 +228,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
|
||||
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
|
||||
dns_zone_log(zone, ISC_LOG_WARNING,
|
||||
"getaddrinfo(%s) failed: %s", namebuf,
|
||||
gai_strerror(eai));
|
||||
gai_strerror(result));
|
||||
add(namebuf, ERR_LOOKUP_FAILURE);
|
||||
}
|
||||
return true;
|
||||
@@ -433,27 +358,25 @@ checkmissing:
|
||||
add(namebuf, ERR_MISSING_GLUE);
|
||||
}
|
||||
}
|
||||
if (ai != NULL) {
|
||||
freeaddrinfo(ai);
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
return answer;
|
||||
}
|
||||
|
||||
static bool
|
||||
checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
||||
struct addrinfo hints = {
|
||||
.ai_flags = AI_CANONNAME,
|
||||
.ai_family = PF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM,
|
||||
.ai_protocol = IPPROTO_TCP,
|
||||
};
|
||||
struct addrinfo *ai = NULL, *cur;
|
||||
struct addrinfo hints, *ai, *cur;
|
||||
char namebuf[DNS_NAME_FORMATSIZE + 1];
|
||||
char ownerbuf[DNS_NAME_FORMATSIZE];
|
||||
int eai;
|
||||
int result;
|
||||
int level = ISC_LOG_ERROR;
|
||||
bool answer = true;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_CANONNAME;
|
||||
hints.ai_family = PF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_protocol = IPPROTO_TCP;
|
||||
|
||||
dns_name_format(name, namebuf, sizeof(namebuf) - 1);
|
||||
/*
|
||||
* Turn off search.
|
||||
@@ -463,9 +386,9 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
||||
}
|
||||
dns_name_format(owner, ownerbuf, sizeof(ownerbuf));
|
||||
|
||||
eai = getaddrinfo(namebuf, NULL, &hints, &ai);
|
||||
result = getaddrinfo(namebuf, NULL, &hints, &ai);
|
||||
dns_name_format(name, namebuf, sizeof(namebuf) - 1);
|
||||
switch (eai) {
|
||||
switch (result) {
|
||||
case 0:
|
||||
/*
|
||||
* Work around broken getaddrinfo() implementations that
|
||||
@@ -498,9 +421,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ai != NULL) {
|
||||
freeaddrinfo(ai);
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
return answer;
|
||||
|
||||
case EAI_NONAME:
|
||||
@@ -521,7 +442,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
||||
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
|
||||
dns_zone_log(zone, ISC_LOG_WARNING,
|
||||
"getaddrinfo(%s) failed: %s", namebuf,
|
||||
gai_strerror(eai));
|
||||
gai_strerror(result));
|
||||
add(namebuf, ERR_LOOKUP_FAILURE);
|
||||
}
|
||||
return true;
|
||||
@@ -530,19 +451,19 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
||||
|
||||
static bool
|
||||
checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
||||
struct addrinfo hints = {
|
||||
.ai_flags = AI_CANONNAME,
|
||||
.ai_family = PF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM,
|
||||
.ai_protocol = IPPROTO_TCP,
|
||||
};
|
||||
struct addrinfo *ai = NULL, *cur;
|
||||
struct addrinfo hints, *ai, *cur;
|
||||
char namebuf[DNS_NAME_FORMATSIZE + 1];
|
||||
char ownerbuf[DNS_NAME_FORMATSIZE];
|
||||
int eai;
|
||||
int result;
|
||||
int level = ISC_LOG_ERROR;
|
||||
bool answer = true;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_CANONNAME;
|
||||
hints.ai_family = PF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_protocol = IPPROTO_TCP;
|
||||
|
||||
dns_name_format(name, namebuf, sizeof(namebuf) - 1);
|
||||
/*
|
||||
* Turn off search.
|
||||
@@ -552,9 +473,9 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
||||
}
|
||||
dns_name_format(owner, ownerbuf, sizeof(ownerbuf));
|
||||
|
||||
eai = getaddrinfo(namebuf, NULL, &hints, &ai);
|
||||
result = getaddrinfo(namebuf, NULL, &hints, &ai);
|
||||
dns_name_format(name, namebuf, sizeof(namebuf) - 1);
|
||||
switch (eai) {
|
||||
switch (result) {
|
||||
case 0:
|
||||
/*
|
||||
* Work around broken getaddrinfo() implementations that
|
||||
@@ -587,9 +508,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ai != NULL) {
|
||||
freeaddrinfo(ai);
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
return answer;
|
||||
|
||||
case EAI_NONAME:
|
||||
@@ -610,7 +529,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
||||
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
|
||||
dns_zone_log(zone, ISC_LOG_WARNING,
|
||||
"getaddrinfo(%s) failed: %s", namebuf,
|
||||
gai_strerror(eai));
|
||||
gai_strerror(result));
|
||||
add(namebuf, ERR_LOOKUP_FAILURE);
|
||||
}
|
||||
return true;
|
||||
@@ -655,18 +574,18 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
|
||||
isc_buffer_constinit(&buffer, zonename, strlen(zonename));
|
||||
isc_buffer_add(&buffer, strlen(zonename));
|
||||
origin = dns_fixedname_initname(&fixorigin);
|
||||
CHECK(dns_name_fromtext(origin, &buffer, dns_rootname, 0));
|
||||
dns_zone_setorigin(zone, origin);
|
||||
CHECK(dns_name_fromtext(origin, &buffer, dns_rootname, 0, NULL));
|
||||
CHECK(dns_zone_setorigin(zone, origin));
|
||||
dns_zone_setdbtype(zone, 1, (const char *const *)dbtype);
|
||||
if (strcmp(filename, "-") == 0) {
|
||||
dns_zone_setstream(zone, stdin, fileformat,
|
||||
&dns_master_style_default);
|
||||
CHECK(dns_zone_setstream(zone, stdin, fileformat,
|
||||
&dns_master_style_default));
|
||||
} else {
|
||||
dns_zone_setfile(zone, filename, fileformat,
|
||||
&dns_master_style_default);
|
||||
CHECK(dns_zone_setfile(zone, filename, fileformat,
|
||||
&dns_master_style_default));
|
||||
}
|
||||
if (journal != NULL) {
|
||||
dns_zone_setjournal(zone, journal);
|
||||
CHECK(dns_zone_setjournal(zone, journal));
|
||||
}
|
||||
|
||||
region.base = UNCONST(classname);
|
||||
@@ -684,7 +603,6 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
|
||||
}
|
||||
if (docheckns) {
|
||||
dns_zone_setcheckns(zone, checkns);
|
||||
dns_zone_setcheckisservedby(zone, checkisservedby);
|
||||
}
|
||||
if (dochecksrv) {
|
||||
dns_zone_setchecksrv(zone, checksrv);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/lang.h>
|
||||
#include <isc/stdio.h>
|
||||
#include <isc/types.h>
|
||||
|
||||
@@ -25,6 +26,8 @@
|
||||
#include <dns/types.h>
|
||||
#include <dns/zone.h>
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
isc_result_t
|
||||
setup_logging(FILE *errout);
|
||||
|
||||
@@ -45,3 +48,5 @@ extern bool docheckmx;
|
||||
extern bool docheckns;
|
||||
extern bool dochecksrv;
|
||||
extern dns_zoneopt_t zone_options;
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/dir.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/result.h>
|
||||
@@ -31,7 +30,6 @@
|
||||
|
||||
#include <dns/db.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/rdataclass.h>
|
||||
#include <dns/rootns.h>
|
||||
@@ -761,7 +759,7 @@ cleanup:
|
||||
}
|
||||
|
||||
if (mctx != NULL) {
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
}
|
||||
|
||||
return result == ISC_R_SUCCESS ? 0 : 1;
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <isc/dir.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/result.h>
|
||||
@@ -32,7 +31,6 @@
|
||||
|
||||
#include <dns/db.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/master.h>
|
||||
#include <dns/masterdump.h>
|
||||
#include <dns/name.h>
|
||||
@@ -577,7 +575,7 @@ main(int argc, char **argv) {
|
||||
fprintf(errout, "OK\n");
|
||||
}
|
||||
destroy();
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return (result == ISC_R_SUCCESS) ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -91,13 +91,9 @@ Options
|
||||
(both in-zone and out-of-zone hostnames). Mode ``local`` only
|
||||
checks SRV records which refer to in-zone hostnames.
|
||||
|
||||
Mode ``full`` checks that a zone that has A or AAAA records it is served
|
||||
by a server with the same type of address records.
|
||||
|
||||
Mode ``full`` checks that delegation NS records refer to A or AAAA
|
||||
records (both in-zone and out-of-zone hostnames). It also checks that
|
||||
glue address records in the zone match those advertised by the child.
|
||||
|
||||
Mode ``local`` only checks NS records which refer to in-zone
|
||||
hostnames or verifies that some required glue exists, i.e., when the
|
||||
name server is in a child zone.
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <isc/lang.h>
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
int
|
||||
set_user(FILE *fd, const char *user);
|
||||
/*%<
|
||||
@@ -25,3 +29,5 @@ set_user(FILE *fd, const char *user);
|
||||
* 0 success
|
||||
* -1 insufficient permissions, or 'user' does not exist.
|
||||
*/
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -16,10 +16,13 @@
|
||||
/*! \file */
|
||||
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/lang.h>
|
||||
#include <isc/mem.h>
|
||||
|
||||
#include <dns/secalg.h>
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
void
|
||||
generate_key(isc_mem_t *mctx, dns_secalg_t alg, int keysize,
|
||||
isc_buffer_t *key_txtbuffer);
|
||||
@@ -34,3 +37,5 @@ dns_secalg_t
|
||||
alg_fromtext(const char *name);
|
||||
int
|
||||
alg_bits(dns_secalg_t alg);
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/net.h>
|
||||
#include <isc/result.h>
|
||||
@@ -41,7 +40,6 @@
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/name.h>
|
||||
|
||||
#include <dst/dst.h>
|
||||
@@ -290,7 +288,7 @@ options {\n\
|
||||
isc_mem_stats(mctx, stderr);
|
||||
}
|
||||
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/net.h>
|
||||
#include <isc/result.h>
|
||||
@@ -37,7 +36,6 @@
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/name.h>
|
||||
|
||||
#include <dst/dst.h>
|
||||
@@ -296,7 +294,7 @@ nsupdate -k <keyfile>\n");
|
||||
isc_mem_stats(mctx, stderr);
|
||||
}
|
||||
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <isc/attributes.h>
|
||||
#include <isc/formatcheck.h>
|
||||
#include <isc/lang.h>
|
||||
|
||||
#define NS_CONTROL_PORT 953
|
||||
|
||||
@@ -30,8 +31,12 @@
|
||||
notify("%s", name); \
|
||||
} while (0)
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
void
|
||||
notify(const char *fmt, ...) ISC_FORMAT_PRINTF(1, 2);
|
||||
|
||||
ISC_NORETURN void
|
||||
fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
+56
-16
@@ -26,14 +26,17 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <openssl/opensslv.h>
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/provider.h>
|
||||
#endif
|
||||
|
||||
#include <isc/async.h>
|
||||
#include <isc/attributes.h>
|
||||
#include <isc/base64.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/crypto.h>
|
||||
#include <isc/fips.h>
|
||||
#include <isc/hex.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/managers.h>
|
||||
#include <isc/md.h>
|
||||
@@ -56,7 +59,6 @@
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/keytable.h>
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/masterdump.h>
|
||||
#include <dns/message.h>
|
||||
#include <dns/name.h>
|
||||
@@ -163,6 +165,10 @@ static dns_fixedname_t qfn;
|
||||
/* Default trust anchors */
|
||||
static char anchortext[] = TRUST_ANCHORS;
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
static OSSL_PROVIDER *fips = NULL, *base = NULL;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Static function prototypes
|
||||
*/
|
||||
@@ -222,6 +228,7 @@ usage(void) {
|
||||
" +[no]crypto (Control display of "
|
||||
"cryptographic\n"
|
||||
" fields in records)\n"
|
||||
" +[no]dlv (Obsolete)\n"
|
||||
" +[no]dnssec (Display DNSSEC "
|
||||
"records)\n"
|
||||
" +[no]mtrace (Trace messages "
|
||||
@@ -589,7 +596,7 @@ convert_name(dns_fixedname_t *fn, dns_name_t **name, const char *text) {
|
||||
isc_buffer_add(&b, len);
|
||||
n = dns_fixedname_initname(fn);
|
||||
|
||||
result = dns_name_fromtext(n, &b, dns_rootname, 0);
|
||||
result = dns_name_fromtext(n, &b, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
delv_log(ISC_LOG_ERROR, "failed to convert name %s: %s", text,
|
||||
isc_result_totext(result));
|
||||
@@ -781,7 +788,9 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client, dns_view_t *toview) {
|
||||
num_keys++;
|
||||
|
||||
cleanup:
|
||||
if (result == DST_R_UNSUPPORTEDALG) {
|
||||
if (result == DST_R_NOCRYPTO) {
|
||||
cfg_obj_log(key, ISC_LOG_ERROR, "no crypto support");
|
||||
} else if (result == DST_R_UNSUPPORTEDALG) {
|
||||
cfg_obj_log(key, ISC_LOG_WARNING,
|
||||
"skipping trusted key '%s': %s", keynamestr,
|
||||
isc_result_totext(result));
|
||||
@@ -815,6 +824,9 @@ load_keys(const cfg_obj_t *keys, dns_client_t *client, dns_view_t *toview) {
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (result == DST_R_NOCRYPTO) {
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1113,6 +1125,14 @@ plus_option(char *option) {
|
||||
break;
|
||||
case 'd':
|
||||
switch (cmd[1]) {
|
||||
case 'l': /* dlv */
|
||||
FULLCHECK("dlv");
|
||||
if (state) {
|
||||
fprintf(stderr, "Invalid option: "
|
||||
"+dlv is obsolete\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case 'n': /* dnssec */
|
||||
FULLCHECK("dnssec");
|
||||
showdnssec = state;
|
||||
@@ -1611,7 +1631,24 @@ preparse_args(int argc, char **argv) {
|
||||
while (strpbrk(option, single_dash_opts) == &option[0]) {
|
||||
switch (option[0]) {
|
||||
case 'F':
|
||||
if (isc_crypto_fips_enable() != ISC_R_SUCCESS) {
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
fips = OSSL_PROVIDER_load(NULL, "fips");
|
||||
if (fips == NULL) {
|
||||
ERR_clear_error();
|
||||
fatal("Failed to load FIPS provider");
|
||||
}
|
||||
base = OSSL_PROVIDER_load(NULL, "base");
|
||||
if (base == NULL) {
|
||||
OSSL_PROVIDER_unload(fips);
|
||||
ERR_clear_error();
|
||||
fatal("Failed to load base provider");
|
||||
}
|
||||
#endif
|
||||
/* Already in FIPS mode? */
|
||||
if (isc_fips_mode()) {
|
||||
break;
|
||||
}
|
||||
if (isc_fips_set_mode(1) != ISC_R_SUCCESS) {
|
||||
fatal("setting FIPS mode failed");
|
||||
}
|
||||
break;
|
||||
@@ -2114,15 +2151,9 @@ sendquery(void *arg) {
|
||||
&requestmgr));
|
||||
|
||||
dns_view_attach(view, &(dns_view_t *){ NULL });
|
||||
|
||||
uint32_t initial;
|
||||
isc_nm_gettimeouts(netmgr, &initial, NULL, NULL, NULL);
|
||||
const unsigned int connect_timeout = initial, timeout = initial;
|
||||
|
||||
CHECK(dns_request_create(requestmgr, message, NULL, &peer, NULL, NULL,
|
||||
DNS_REQUESTOPT_TCP, NULL, connect_timeout,
|
||||
timeout, 0, 0, isc_loop(), recvresponse,
|
||||
message, &request));
|
||||
DNS_REQUESTOPT_TCP, NULL, 1, 0, 0, isc_loop(),
|
||||
recvresponse, message, &request));
|
||||
return;
|
||||
|
||||
cleanup:
|
||||
@@ -2174,8 +2205,8 @@ run_server(void *arg) {
|
||||
CHECK(ns_interfacemgr_create(mctx, sctx, loopmgr, netmgr, dispatchmgr,
|
||||
NULL, &interfacemgr));
|
||||
|
||||
dns_view_create(mctx, loopmgr, dispatchmgr, dns_rdataclass_in,
|
||||
"_default", &view);
|
||||
CHECK(dns_view_create(mctx, loopmgr, dispatchmgr, dns_rdataclass_in,
|
||||
"_default", &view));
|
||||
CHECK(dns_cache_create(loopmgr, dns_rdataclass_in, "", mctx, &cache));
|
||||
dns_view_setcache(view, cache, false);
|
||||
dns_cache_detach(&cache);
|
||||
@@ -2284,5 +2315,14 @@ cleanup:
|
||||
|
||||
isc_managers_destroy(&mctx, &loopmgr, &netmgr);
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
if (base != NULL) {
|
||||
OSSL_PROVIDER_unload(base);
|
||||
}
|
||||
if (fips != NULL) {
|
||||
OSSL_PROVIDER_unload(fips);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+42
-34
@@ -20,9 +20,8 @@
|
||||
#include <time.h>
|
||||
|
||||
#include <isc/attributes.h>
|
||||
#include <isc/crypto.h>
|
||||
#include <isc/dir.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/fips.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/netaddr.h>
|
||||
#include <isc/parseint.h>
|
||||
@@ -34,7 +33,6 @@
|
||||
#include <dns/byaddr.h>
|
||||
#include <dns/dns64.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/masterdump.h>
|
||||
#include <dns/message.h>
|
||||
#include <dns/name.h>
|
||||
@@ -73,6 +71,14 @@ static bool short_form = false, printcmd = true, plusquest = false,
|
||||
static uint32_t splitwidth = 0xffffffff;
|
||||
|
||||
#include <openssl/opensslv.h>
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/provider.h>
|
||||
#endif
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
static OSSL_PROVIDER *fips = NULL, *base = NULL;
|
||||
#endif
|
||||
|
||||
/*% opcode text */
|
||||
static const char *const opcodetext[] = {
|
||||
@@ -289,7 +295,6 @@ help(void) {
|
||||
" form of answers - global "
|
||||
"option)\n"
|
||||
" +[no]showbadcookie (Show BADCOOKIE message)\n"
|
||||
" +[no]showbadvers (Show BADVERS message)\n"
|
||||
" +[no]showsearch (Search with intermediate "
|
||||
"results)\n"
|
||||
" +[no]split=## (Split hex/base64 fields "
|
||||
@@ -298,8 +303,6 @@ help(void) {
|
||||
"statistics)\n"
|
||||
" +subnet=addr (Set edns-client-subnet "
|
||||
"option)\n"
|
||||
" +[no]svcparamkeycompat (Display backward-"
|
||||
"compatible SvcParamKey names (keyN) for non-initial entries)\n"
|
||||
" +[no]tcflag (Set TC flag in query "
|
||||
"(+[no]tcflag))\n"
|
||||
" +[no]tcp (TCP mode (+[no]vc))\n"
|
||||
@@ -499,9 +502,6 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
|
||||
if (query->lookup->expandaaaa) {
|
||||
styleflags |= DNS_STYLEFLAG_EXPANDAAAA;
|
||||
}
|
||||
if (query->lookup->svcparamkeycompat) {
|
||||
styleflags |= DNS_STYLEFLAG_SVCPARAMKEYCOMPAT;
|
||||
}
|
||||
result = dns_rdata_tofmttext(rdata, NULL, styleflags, 0, splitwidth,
|
||||
" ", buf);
|
||||
if (result == ISC_R_NOSPACE) {
|
||||
@@ -586,7 +586,7 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags, isc_buffer_t *buf,
|
||||
|
||||
UNUSED(flags);
|
||||
|
||||
dns_name_init(&empty_name);
|
||||
dns_name_init(&empty_name, NULL);
|
||||
result = dns_message_firstname(msg, DNS_SECTION_ANSWER);
|
||||
if (result == ISC_R_NOMORE) {
|
||||
return ISC_R_SUCCESS;
|
||||
@@ -628,7 +628,9 @@ static bool
|
||||
isdotlocal(dns_message_t *msg) {
|
||||
isc_result_t result;
|
||||
static unsigned char local_ndata[] = { "\005local" };
|
||||
static dns_name_t local = DNS_NAME_INITABSOLUTE(local_ndata);
|
||||
static unsigned char local_offsets[] = { 0, 6 };
|
||||
static dns_name_t local = DNS_NAME_INITABSOLUTE(local_ndata,
|
||||
local_offsets);
|
||||
|
||||
for (result = dns_message_firstname(msg, DNS_SECTION_QUESTION);
|
||||
result == ISC_R_SUCCESS;
|
||||
@@ -693,9 +695,6 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
||||
if (query->lookup->expandaaaa) {
|
||||
styleflags |= DNS_STYLEFLAG_EXPANDAAAA;
|
||||
}
|
||||
if (query->lookup->svcparamkeycompat) {
|
||||
styleflags |= DNS_STYLEFLAG_SVCPARAMKEYCOMPAT;
|
||||
}
|
||||
if (query->lookup->multiline) {
|
||||
styleflags |= DNS_STYLEFLAG_OMIT_OWNER;
|
||||
styleflags |= DNS_STYLEFLAG_OMIT_CLASS;
|
||||
@@ -1773,8 +1772,6 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
|
||||
FULLCHECK("edns");
|
||||
if (!state) {
|
||||
lookup->edns = -1;
|
||||
lookup->original_edns =
|
||||
-1;
|
||||
break;
|
||||
}
|
||||
if (value == NULL) {
|
||||
@@ -1791,7 +1788,6 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
|
||||
goto exit_or_usage;
|
||||
}
|
||||
lookup->edns = num;
|
||||
lookup->original_edns = num;
|
||||
break;
|
||||
case 'f':
|
||||
FULLCHECK("ednsflags");
|
||||
@@ -2310,18 +2306,8 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
|
||||
case 'w': /* showsearch */
|
||||
switch (cmd[4]) {
|
||||
case 'b':
|
||||
switch (cmd[7]) {
|
||||
case 'c':
|
||||
FULLCHECK("showbadcookie");
|
||||
lookup->showbadcookie = state;
|
||||
break;
|
||||
case 'v':
|
||||
FULLCHECK("showbadvers");
|
||||
lookup->showbadvers = state;
|
||||
break;
|
||||
default:
|
||||
goto invalid_option;
|
||||
}
|
||||
FULLCHECK("showbadcookie");
|
||||
lookup->showbadcookie = state;
|
||||
break;
|
||||
case 's':
|
||||
FULLCHECK("showsearch");
|
||||
@@ -2408,10 +2394,6 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
|
||||
goto exit_or_usage;
|
||||
}
|
||||
break;
|
||||
case 'v': /* svcparamkeycompat */
|
||||
FULLCHECK("svcparamkeycompat");
|
||||
lookup->svcparamkeycompat = state;
|
||||
break;
|
||||
default:
|
||||
goto invalid_option;
|
||||
}
|
||||
@@ -2937,7 +2919,24 @@ preparse_args(int argc, char **argv) {
|
||||
debugging = true;
|
||||
break;
|
||||
case 'F':
|
||||
if (isc_crypto_fips_enable() != ISC_R_SUCCESS) {
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
fips = OSSL_PROVIDER_load(NULL, "fips");
|
||||
if (fips == NULL) {
|
||||
ERR_clear_error();
|
||||
fatal("Failed to load FIPS provider");
|
||||
}
|
||||
base = OSSL_PROVIDER_load(NULL, "base");
|
||||
if (base == NULL) {
|
||||
OSSL_PROVIDER_unload(fips);
|
||||
ERR_clear_error();
|
||||
fatal("Failed to load base provider");
|
||||
}
|
||||
#endif
|
||||
/* Already in FIPS mode? */
|
||||
if (isc_fips_mode()) {
|
||||
break;
|
||||
}
|
||||
if (isc_fips_set_mode(1) != ISC_R_SUCCESS) {
|
||||
fatal("setting FIPS mode failed");
|
||||
}
|
||||
break;
|
||||
@@ -3465,5 +3464,14 @@ main(int argc, char **argv) {
|
||||
dig_startup();
|
||||
dig_shutdown();
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
if (base != NULL) {
|
||||
OSSL_PROVIDER_unload(base);
|
||||
}
|
||||
if (fips != NULL) {
|
||||
OSSL_PROVIDER_unload(fips);
|
||||
}
|
||||
#endif
|
||||
|
||||
return exitcode;
|
||||
}
|
||||
|
||||
@@ -614,12 +614,6 @@ abbreviation is unambiguous; for example, :option:`+cd` is equivalent to
|
||||
BADCOOKIE rcode before retrying the request or not. The default
|
||||
is to not show the messages.
|
||||
|
||||
.. option:: +showbadvers, +noshowbadvers
|
||||
|
||||
This option toggles whether to show the message containing the
|
||||
BADVERS rcode before retrying the request or not. The default
|
||||
is to not show the messages.
|
||||
|
||||
.. option:: +showsearch, +noshowsearch
|
||||
|
||||
This option performs [or does not perform] a search showing intermediate results.
|
||||
@@ -648,14 +642,6 @@ abbreviation is unambiguous; for example, :option:`+cd` is equivalent to
|
||||
prefix-length of zero, which signals a resolver that the client's
|
||||
address information must *not* be used when resolving this query.
|
||||
|
||||
.. option:: +svcparamkeycompat, +nosvcparamkeycompat
|
||||
|
||||
This option sets [or does not set] the backward-compatible representation of
|
||||
the Service Parameter Keys (SvcParamKeys) for SVCB records, in which case
|
||||
the keys, which were not defined initially in :rfc:`9460` are represented
|
||||
in their opaque "keyN"-like format, where "N" is their numerical value. The
|
||||
default is ``+nosvcparamkeycompat``.
|
||||
|
||||
.. option:: +tcflag, +notcflag
|
||||
|
||||
This option sets [or does not set] the TC (TrunCation) bit in the query. The default is
|
||||
|
||||
+28
-36
@@ -40,6 +40,7 @@
|
||||
#include <isc/file.h>
|
||||
#include <isc/getaddresses.h>
|
||||
#include <isc/hex.h>
|
||||
#include <isc/lang.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/managers.h>
|
||||
@@ -60,7 +61,6 @@
|
||||
#include <isc/xml.h>
|
||||
|
||||
#include <dns/byaddr.h>
|
||||
#include <dns/ede.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/message.h>
|
||||
#include <dns/name.h>
|
||||
@@ -605,7 +605,6 @@ make_empty_lookup(void) {
|
||||
.idnout = idnout,
|
||||
.udpsize = -1,
|
||||
.edns = -1,
|
||||
.original_edns = -1,
|
||||
.recurse = true,
|
||||
.retries = tries,
|
||||
.comments = true,
|
||||
@@ -739,7 +738,6 @@ clone_lookup(dig_lookup_t *lookold, bool servers) {
|
||||
}
|
||||
|
||||
looknew->showbadcookie = lookold->showbadcookie;
|
||||
looknew->showbadvers = lookold->showbadvers;
|
||||
looknew->sendcookie = lookold->sendcookie;
|
||||
looknew->seenbadcookie = lookold->seenbadcookie;
|
||||
looknew->badcookie = lookold->badcookie;
|
||||
@@ -760,13 +758,11 @@ clone_lookup(dig_lookup_t *lookold, bool servers) {
|
||||
looknew->nocrypto = lookold->nocrypto;
|
||||
looknew->ttlunits = lookold->ttlunits;
|
||||
looknew->expandaaaa = lookold->expandaaaa;
|
||||
looknew->svcparamkeycompat = lookold->svcparamkeycompat;
|
||||
looknew->qr = lookold->qr;
|
||||
looknew->idnin = lookold->idnin;
|
||||
looknew->idnout = lookold->idnout;
|
||||
looknew->udpsize = lookold->udpsize;
|
||||
looknew->edns = lookold->edns;
|
||||
looknew->original_edns = lookold->original_edns;
|
||||
looknew->recurse = lookold->recurse;
|
||||
looknew->aaonly = lookold->aaonly;
|
||||
looknew->adflag = lookold->adflag;
|
||||
@@ -861,14 +857,14 @@ requeue_lookup(dig_lookup_t *lookold, bool servers) {
|
||||
void
|
||||
setup_text_key(void) {
|
||||
isc_result_t result;
|
||||
dns_fixedname_t fkey;
|
||||
dns_name_t *keyname = dns_fixedname_initname(&fkey);
|
||||
dns_name_t keyname;
|
||||
isc_buffer_t secretbuf;
|
||||
unsigned int secretsize;
|
||||
unsigned char *secretstore;
|
||||
|
||||
debug("setup_text_key()");
|
||||
isc_buffer_allocate(mctx, &namebuf, MXNAME);
|
||||
dns_name_init(&keyname, NULL);
|
||||
isc_buffer_putstr(namebuf, keynametext);
|
||||
secretsize = (unsigned int)strlen(keysecret) * 3 / 4;
|
||||
secretstore = isc_mem_allocate(mctx, secretsize);
|
||||
@@ -885,12 +881,12 @@ setup_text_key(void) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
result = dns_name_fromtext(keyname, namebuf, dns_rootname, 0);
|
||||
result = dns_name_fromtext(&keyname, namebuf, dns_rootname, 0, namebuf);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
result = dns_tsigkey_create(keyname, hmac_alg, secretstore,
|
||||
result = dns_tsigkey_create(&keyname, hmac_alg, secretstore,
|
||||
(int)secretsize, mctx, &tsigkey);
|
||||
failure:
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
@@ -901,6 +897,7 @@ failure:
|
||||
}
|
||||
|
||||
isc_mem_free(mctx, secretstore);
|
||||
dns_name_invalidate(&keyname);
|
||||
isc_buffer_free(&namebuf);
|
||||
}
|
||||
|
||||
@@ -1941,7 +1938,6 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) {
|
||||
}
|
||||
domain = dns_fixedname_name(&lookup->fdomain);
|
||||
dns_name_copy(name, domain);
|
||||
lookup->edns = lookup->original_edns;
|
||||
}
|
||||
debug("adding server %s", namestr);
|
||||
num = getaddresses(lookup, namestr, &lresult);
|
||||
@@ -2085,8 +2081,8 @@ insert_soa(dig_lookup_t *lookup) {
|
||||
soa.common.rdclass = lookup->rdclass;
|
||||
soa.common.rdtype = dns_rdatatype_soa;
|
||||
|
||||
dns_name_init(&soa.origin);
|
||||
dns_name_init(&soa.contact);
|
||||
dns_name_init(&soa.origin, NULL);
|
||||
dns_name_init(&soa.contact, NULL);
|
||||
|
||||
dns_name_clone(dns_rootname, &soa.origin);
|
||||
dns_name_clone(dns_rootname, &soa.contact);
|
||||
@@ -2209,6 +2205,11 @@ setup_lookup(dig_lookup_t *lookup) {
|
||||
}
|
||||
dns_message_gettempname(lookup->sendmsg, &lookup->name);
|
||||
|
||||
isc_buffer_init(&lookup->namebuf, lookup->name_space,
|
||||
sizeof(lookup->name_space));
|
||||
isc_buffer_init(&lookup->onamebuf, lookup->oname_space,
|
||||
sizeof(lookup->oname_space));
|
||||
|
||||
/*
|
||||
* We cannot convert `textname' and `origin' separately.
|
||||
* `textname' doesn't contain TLD, but local mapping needs
|
||||
@@ -2256,7 +2257,8 @@ setup_lookup(dig_lookup_t *lookup) {
|
||||
len = (unsigned int)strlen(origin);
|
||||
isc_buffer_init(&b, origin, len);
|
||||
isc_buffer_add(&b, len);
|
||||
result = dns_name_fromtext(lookup->oname, &b, dns_rootname, 0);
|
||||
result = dns_name_fromtext(lookup->oname, &b, dns_rootname, 0,
|
||||
&lookup->onamebuf);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_message_puttempname(lookup->sendmsg, &lookup->name);
|
||||
dns_message_puttempname(lookup->sendmsg,
|
||||
@@ -2274,12 +2276,12 @@ setup_lookup(dig_lookup_t *lookup) {
|
||||
len = (unsigned int)strlen(textname);
|
||||
isc_buffer_init(&b, textname, len);
|
||||
isc_buffer_add(&b, len);
|
||||
result = dns_name_fromtext(name, &b, NULL, 0);
|
||||
result = dns_name_fromtext(name, &b, NULL, 0, NULL);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
if (!dns_name_isabsolute(name)) {
|
||||
result = dns_name_concatenate(
|
||||
name, lookup->oname,
|
||||
lookup->name);
|
||||
lookup->name, &lookup->namebuf);
|
||||
} else {
|
||||
dns_name_copy(name, lookup->name);
|
||||
}
|
||||
@@ -2307,7 +2309,8 @@ setup_lookup(dig_lookup_t *lookup) {
|
||||
isc_buffer_init(&b, textname, len);
|
||||
isc_buffer_add(&b, len);
|
||||
result = dns_name_fromtext(lookup->name, &b,
|
||||
dns_rootname, 0);
|
||||
dns_rootname, 0,
|
||||
&lookup->namebuf);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_message_puttempname(lookup->sendmsg,
|
||||
&lookup->name);
|
||||
@@ -2460,8 +2463,7 @@ setup_lookup(dig_lookup_t *lookup) {
|
||||
lookup->udpsize = DEFAULT_EDNS_BUFSIZE;
|
||||
}
|
||||
if (lookup->edns < 0) {
|
||||
lookup->original_edns = lookup->edns =
|
||||
DEFAULT_EDNS_VERSION;
|
||||
lookup->edns = DEFAULT_EDNS_VERSION;
|
||||
}
|
||||
|
||||
if (lookup->nsid) {
|
||||
@@ -2777,12 +2779,6 @@ _cancel_lookup(dig_lookup_t *lookup, const char *file, unsigned int line) {
|
||||
check_if_done();
|
||||
}
|
||||
|
||||
static inline const char *
|
||||
get_tls_sni_hostname(dig_query_t *query) {
|
||||
return query->lookup->tls_hostname_set ? query->lookup->tls_hostname
|
||||
: query->userarg;
|
||||
}
|
||||
|
||||
static isc_tlsctx_t *
|
||||
get_create_tls_context(dig_query_t *query, const bool is_https,
|
||||
isc_tlsctx_client_session_cache_t **psess_cache) {
|
||||
@@ -2829,7 +2825,10 @@ get_create_tls_context(dig_query_t *query, const bool is_https,
|
||||
}
|
||||
|
||||
if (store != NULL) {
|
||||
const char *hostname = get_tls_sni_hostname(query);
|
||||
const char *hostname =
|
||||
query->lookup->tls_hostname_set
|
||||
? query->lookup->tls_hostname
|
||||
: query->userarg;
|
||||
/*
|
||||
* According to RFC 8310, Subject field MUST NOT be
|
||||
* inspected when verifying hostname for DoT. Only
|
||||
@@ -3043,8 +3042,7 @@ start_tcp(dig_query_t *query) {
|
||||
}
|
||||
isc_nm_streamdnsconnect(netmgr, &localaddr, &query->sockaddr,
|
||||
tcp_connected, connectquery,
|
||||
local_timeout, tlsctx,
|
||||
get_tls_sni_hostname(query), sess_cache,
|
||||
local_timeout, tlsctx, sess_cache,
|
||||
proxy_type, ppi);
|
||||
#if HAVE_LIBNGHTTP2
|
||||
} else if (query->lookup->https_mode) {
|
||||
@@ -3064,15 +3062,14 @@ start_tcp(dig_query_t *query) {
|
||||
|
||||
isc_nm_httpconnect(netmgr, &localaddr, &query->sockaddr, uri,
|
||||
!query->lookup->https_get, tcp_connected,
|
||||
connectquery, tlsctx,
|
||||
get_tls_sni_hostname(query), sess_cache,
|
||||
connectquery, tlsctx, sess_cache,
|
||||
local_timeout, proxy_type, ppi);
|
||||
#endif
|
||||
} else {
|
||||
isc_nm_streamdnsconnect(netmgr, &localaddr, &query->sockaddr,
|
||||
tcp_connected, connectquery,
|
||||
local_timeout, NULL, NULL, NULL,
|
||||
proxy_type, ppi);
|
||||
local_timeout, NULL, NULL, proxy_type,
|
||||
ppi);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -4305,11 +4302,6 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
|
||||
if (msg->rcode == dns_rcode_badvers && msg->opt != NULL &&
|
||||
(newedns = ednsvers(msg->opt)) < l->edns && l->ednsneg)
|
||||
{
|
||||
if (l->showbadvers) {
|
||||
dighost_printmessage(query, &b, msg, true);
|
||||
dighost_received(isc_buffer_usedlength(&b), &peer,
|
||||
query);
|
||||
}
|
||||
/*
|
||||
* Add minimum EDNS version required checks here if needed.
|
||||
*/
|
||||
|
||||
+13
-6
@@ -21,6 +21,7 @@
|
||||
#include <isc/attributes.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/formatcheck.h>
|
||||
#include <isc/lang.h>
|
||||
#include <isc/list.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/magic.h>
|
||||
@@ -84,6 +85,8 @@
|
||||
* in a tight loop of constant lookups. It's value is arbitrary.
|
||||
*/
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
typedef struct dig_lookup dig_lookup_t;
|
||||
typedef struct dig_query dig_query_t;
|
||||
typedef struct dig_server dig_server_t;
|
||||
@@ -104,8 +107,9 @@ struct dig_lookup {
|
||||
isc_refcount_t references;
|
||||
bool aaonly, adflag, badcookie, besteffort, cdflag, cleared, comments,
|
||||
dns64prefix, dnssec, doing_xfr, done_as_is, ednsneg, expandaaaa,
|
||||
svcparamkeycompat, expire, fuzzing, header_only,
|
||||
identify, /*%< Append an "on server <foo>" message */
|
||||
expire, fuzzing, header_only, identify, /*%< Append an "on
|
||||
server <foo>" message
|
||||
*/
|
||||
identify_previous_line, /*% Prepend a "Nameserver <foo>:"
|
||||
message, with newline and tab */
|
||||
idnin, idnout, ignore, multiline, need_search, new_search,
|
||||
@@ -117,9 +121,9 @@ struct dig_lookup {
|
||||
section_answer, section_authority, section_question,
|
||||
seenbadcookie, sendcookie, servfail_stops,
|
||||
setqid, /*% use a speciied query ID */
|
||||
showbadcookie, showbadvers, stats, tcflag, tcp_keepalive,
|
||||
tcp_mode, tcp_mode_set, tls_mode, /*% connect using TLS */
|
||||
trace, /*% dig +trace */
|
||||
showbadcookie, stats, tcflag, tcp_keepalive, tcp_mode,
|
||||
tcp_mode_set, tls_mode, /*% connect using TLS */
|
||||
trace, /*% dig +trace */
|
||||
trace_root, /*% initial query for either +trace or +nssearch */
|
||||
ttlunits, use_usec, waiting_connect, zflag;
|
||||
char textname[MXNAME]; /*% Name we're going to be looking up */
|
||||
@@ -131,6 +135,8 @@ struct dig_lookup {
|
||||
bool rdclassset;
|
||||
char name_space[BUFSIZE];
|
||||
char oname_space[BUFSIZE];
|
||||
isc_buffer_t namebuf;
|
||||
isc_buffer_t onamebuf;
|
||||
isc_buffer_t renderbuf;
|
||||
char *sendspace;
|
||||
dns_name_t *name;
|
||||
@@ -148,7 +154,6 @@ struct dig_lookup {
|
||||
int nsfound;
|
||||
int16_t udpsize;
|
||||
int16_t edns;
|
||||
int16_t original_edns;
|
||||
int16_t padding;
|
||||
uint32_t ixfr_serial;
|
||||
isc_buffer_t rdatabuf;
|
||||
@@ -461,3 +466,5 @@ dig_shutdown(void);
|
||||
|
||||
bool
|
||||
dig_lookup_is_tls(const dig_lookup_t *lookup);
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
+3
-15
@@ -21,7 +21,6 @@
|
||||
|
||||
#include <isc/attributes.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/netaddr.h>
|
||||
#include <isc/string.h>
|
||||
@@ -29,7 +28,6 @@
|
||||
|
||||
#include <dns/byaddr.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/message.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/rdata.h>
|
||||
@@ -82,7 +80,6 @@ struct rtype rtypes[] = { { 1, "has address" },
|
||||
{ 25, "has key" },
|
||||
{ 28, "has IPv6 address" },
|
||||
{ 29, "location" },
|
||||
{ dns_rdatatype_https, "has HTTP service bindings" },
|
||||
{ 0, NULL } };
|
||||
|
||||
static char *
|
||||
@@ -221,7 +218,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
|
||||
printf(";; %s SECTION:\n", section_name);
|
||||
}
|
||||
|
||||
dns_name_init(&empty_name);
|
||||
dns_name_init(&empty_name, NULL);
|
||||
|
||||
result = dns_message_firstname(msg, sectionid);
|
||||
if (result == ISC_R_NOMORE) {
|
||||
@@ -246,7 +243,8 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
|
||||
(list_type == dns_rdatatype_any ||
|
||||
rdataset->type == list_type)) ||
|
||||
(list_addresses &&
|
||||
(dns_rdatatype_isaddr(rdataset->type) ||
|
||||
(rdataset->type == dns_rdatatype_a ||
|
||||
rdataset->type == dns_rdatatype_aaaa ||
|
||||
rdataset->type == dns_rdatatype_ns ||
|
||||
rdataset->type == dns_rdatatype_ptr))))
|
||||
{
|
||||
@@ -459,16 +457,6 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
||||
lookup->retries = tries;
|
||||
ISC_LIST_APPEND(lookup_list, lookup, link);
|
||||
}
|
||||
lookup = clone_lookup(query->lookup, false);
|
||||
if (lookup != NULL) {
|
||||
strlcpy(lookup->textname, namestr,
|
||||
sizeof(lookup->textname));
|
||||
lookup->rdtype = dns_rdatatype_https;
|
||||
lookup->rdtypeset = true;
|
||||
lookup->origin = NULL;
|
||||
lookup->retries = tries;
|
||||
ISC_LIST_APPEND(lookup_list, lookup, link);
|
||||
}
|
||||
}
|
||||
|
||||
if (!short_form) {
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ Options
|
||||
CNAME, NS, SOA, TXT, DNSKEY, AXFR, etc.
|
||||
|
||||
When no query type is specified, :program:`host` automatically selects an
|
||||
appropriate query type. By default, it looks for A, AAAA, MX, and HTTPS
|
||||
appropriate query type. By default, it looks for A, AAAA, and MX
|
||||
records. If the :option:`-C` option is given, queries are made for SOA
|
||||
records. If ``name`` is a dotted-decimal IPv4 address or
|
||||
colon-delimited IPv6 address, :program:`host` queries for PTR records.
|
||||
|
||||
+1
-2
@@ -20,7 +20,7 @@
|
||||
#include <isc/attributes.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/netaddr.h>
|
||||
#include <isc/parseint.h>
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
#include <dns/byaddr.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/message.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/rdata.h>
|
||||
|
||||
@@ -41,14 +41,6 @@ dnssec_keygen_LDADD = \
|
||||
$(LDADD) \
|
||||
$(OPENSSL_LIBS)
|
||||
|
||||
dnssec_ksr_CPPFLAGS= \
|
||||
$(AM_CPPFLAGS) \
|
||||
$(OPENSSL_CFLAGS)
|
||||
|
||||
dnssec_ksr_LDADD = \
|
||||
$(LDADD) \
|
||||
$(OPENSSL_LIBS)
|
||||
|
||||
dnssec_signzone_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) \
|
||||
$(OPENSSL_CFLAGS)
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <isc/dir.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/result.h>
|
||||
@@ -45,7 +44,6 @@
|
||||
#include <dns/ds.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/master.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/rdata.h>
|
||||
@@ -178,7 +176,7 @@ initname(char *setname) {
|
||||
|
||||
isc_buffer_init(&buf, setname, strlen(setname));
|
||||
isc_buffer_add(&buf, strlen(setname));
|
||||
result = dns_name_fromtext(name, &buf, dns_rootname, 0);
|
||||
result = dns_name_fromtext(name, &buf, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("could not initialize name %s", setname);
|
||||
}
|
||||
@@ -1075,7 +1073,7 @@ cleanup(void) {
|
||||
if (print_mem_stats && verbose > 10) {
|
||||
isc_mem_stats(mctx, stdout);
|
||||
}
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/dir.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/result.h>
|
||||
@@ -35,7 +34,6 @@
|
||||
#include <dns/ds.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/master.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/rdata.h>
|
||||
@@ -67,7 +65,7 @@ initname(char *setname) {
|
||||
|
||||
isc_buffer_init(&buf, setname, strlen(setname));
|
||||
isc_buffer_add(&buf, strlen(setname));
|
||||
result = dns_name_fromtext(name, &buf, dns_rootname, 0);
|
||||
result = dns_name_fromtext(name, &buf, dns_rootname, 0, NULL);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -383,7 +381,7 @@ main(int argc, char **argv) {
|
||||
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
#define OPTIONS "12Aa:Cc:d:Ff:K:sT:v:whV"
|
||||
#define OPTIONS "12Aa:Cc:d:Ff:K:l:sT:v:whV"
|
||||
while ((ch = isc_commandline_parse(argc, argv, OPTIONS)) != -1) {
|
||||
switch (ch) {
|
||||
case '1':
|
||||
@@ -419,6 +417,9 @@ main(int argc, char **argv) {
|
||||
case 'f':
|
||||
filename = isc_commandline_argument;
|
||||
break;
|
||||
case 'l':
|
||||
fatal("-l option (DLV lookaside) is obsolete");
|
||||
break;
|
||||
case 's':
|
||||
usekeyset = true;
|
||||
break;
|
||||
@@ -543,7 +544,7 @@ main(int argc, char **argv) {
|
||||
if (verbose > 10) {
|
||||
isc_mem_stats(mctx, stdout);
|
||||
}
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
fflush(stdout);
|
||||
if (ferror(stdout)) {
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/result.h>
|
||||
@@ -33,7 +32,6 @@
|
||||
#include <dns/ds.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/master.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/rdata.h>
|
||||
@@ -69,7 +67,7 @@ initname(char *setname) {
|
||||
|
||||
isc_buffer_init(&buf, setname, strlen(setname));
|
||||
isc_buffer_add(&buf, strlen(setname));
|
||||
result = dns_name_fromtext(name, &buf, dns_rootname, 0);
|
||||
result = dns_name_fromtext(name, &buf, dns_rootname, 0, NULL);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -456,7 +454,7 @@ main(int argc, char **argv) {
|
||||
if (verbose > 10) {
|
||||
isc_mem_stats(mctx, stdout);
|
||||
}
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
fflush(stdout);
|
||||
if (ferror(stdout)) {
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <isc/attributes.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/region.h>
|
||||
@@ -32,7 +31,6 @@
|
||||
#include <dns/dnssec.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/rdataclass.h>
|
||||
#include <dns/secalg.h>
|
||||
@@ -73,7 +71,13 @@ usage(void) {
|
||||
fprintf(stderr, " -k: generate a TYPE=KEY key\n");
|
||||
fprintf(stderr, " -L ttl: default key TTL\n");
|
||||
fprintf(stderr, " -M <min>:<max>: allowed Key ID range\n");
|
||||
fprintf(stderr, " -n nametype: ZONE | HOST | ENTITY | USER | "
|
||||
"OTHER\n");
|
||||
fprintf(stderr, " (DNSKEY generation defaults to ZONE\n");
|
||||
fprintf(stderr, " -p protocol: default: 3 [dnssec]\n");
|
||||
fprintf(stderr, " -t type: "
|
||||
"AUTHCONF | NOAUTHCONF | NOAUTH | NOCONF "
|
||||
"(default: AUTHCONF)\n");
|
||||
fprintf(stderr, " -y: permit keys that might collide\n");
|
||||
fprintf(stderr, " -v verbose level\n");
|
||||
fprintf(stderr, " -V: print version information\n");
|
||||
@@ -105,6 +109,7 @@ usage(void) {
|
||||
int
|
||||
main(int argc, char **argv) {
|
||||
char *algname = NULL, *freeit = NULL;
|
||||
char *nametype = NULL, *type = NULL;
|
||||
const char *directory = NULL;
|
||||
const char *predecessor = NULL;
|
||||
dst_key_t *prevkey = NULL;
|
||||
@@ -118,6 +123,7 @@ main(int argc, char **argv) {
|
||||
bool oldstyle = false;
|
||||
isc_mem_t *mctx = NULL;
|
||||
int ch;
|
||||
int protocol = -1, signatory = 0;
|
||||
isc_result_t ret;
|
||||
isc_textregion_t r;
|
||||
char filename[255];
|
||||
@@ -215,13 +221,17 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
}
|
||||
case 'n':
|
||||
fatal("The -n option has been deprecated.");
|
||||
nametype = isc_commandline_argument;
|
||||
break;
|
||||
case 'p':
|
||||
fatal("The -p option has been deprecated.");
|
||||
protocol = strtol(isc_commandline_argument, &endp, 10);
|
||||
if (*endp != '\0' || protocol < 0 || protocol > 255) {
|
||||
fatal("-p must be followed by a number "
|
||||
"[0..255]");
|
||||
}
|
||||
break;
|
||||
case 't':
|
||||
fatal("The -t option has been deprecated.");
|
||||
type = isc_commandline_argument;
|
||||
break;
|
||||
case 'v':
|
||||
verbose = strtol(isc_commandline_argument, &endp, 0);
|
||||
@@ -355,7 +365,7 @@ main(int argc, char **argv) {
|
||||
isc_buffer_init(&buf, argv[isc_commandline_index],
|
||||
strlen(argv[isc_commandline_index]));
|
||||
isc_buffer_add(&buf, strlen(argv[isc_commandline_index]));
|
||||
ret = dns_name_fromtext(name, &buf, dns_rootname, 0);
|
||||
ret = dns_name_fromtext(name, &buf, dns_rootname, 0, NULL);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
fatal("invalid key name %s: %s",
|
||||
argv[isc_commandline_index],
|
||||
@@ -404,6 +414,21 @@ main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (type != NULL && (options & DST_TYPE_KEY) != 0) {
|
||||
if (strcasecmp(type, "NOAUTH") == 0) {
|
||||
flags |= DNS_KEYTYPE_NOAUTH;
|
||||
} else if (strcasecmp(type, "NOCONF") == 0) {
|
||||
flags |= DNS_KEYTYPE_NOCONF;
|
||||
} else if (strcasecmp(type, "NOAUTHCONF") == 0) {
|
||||
flags |= (DNS_KEYTYPE_NOAUTH |
|
||||
DNS_KEYTYPE_NOCONF);
|
||||
} else if (strcasecmp(type, "AUTHCONF") == 0) {
|
||||
/* nothing */
|
||||
} else {
|
||||
fatal("invalid type %s", type);
|
||||
}
|
||||
}
|
||||
|
||||
if (!oldstyle && prepub > 0) {
|
||||
if (setpub && setact && (activate - prepub) < publish) {
|
||||
fatal("Activation and publication dates "
|
||||
@@ -440,6 +465,12 @@ main(int argc, char **argv) {
|
||||
if (algname != NULL) {
|
||||
fatal("-S and -a cannot be used together");
|
||||
}
|
||||
if (nametype != NULL) {
|
||||
fatal("-S and -n cannot be used together");
|
||||
}
|
||||
if (type != NULL) {
|
||||
fatal("-S and -t cannot be used together");
|
||||
}
|
||||
if (setpub || unsetpub) {
|
||||
fatal("-S and -P cannot be used together");
|
||||
}
|
||||
@@ -521,25 +552,59 @@ main(int argc, char **argv) {
|
||||
setpub = setact = true;
|
||||
}
|
||||
|
||||
if (nametype == NULL) {
|
||||
if ((options & DST_TYPE_KEY) != 0) { /* KEY */
|
||||
fatal("no nametype specified");
|
||||
}
|
||||
flags |= DNS_KEYOWNER_ZONE; /* DNSKEY */
|
||||
} else if (strcasecmp(nametype, "zone") == 0) {
|
||||
flags |= DNS_KEYOWNER_ZONE;
|
||||
} else if ((options & DST_TYPE_KEY) != 0) { /* KEY */
|
||||
if (strcasecmp(nametype, "host") == 0 ||
|
||||
strcasecmp(nametype, "entity") == 0)
|
||||
{
|
||||
flags |= DNS_KEYOWNER_ENTITY;
|
||||
} else if (strcasecmp(nametype, "user") == 0) {
|
||||
flags |= DNS_KEYOWNER_USER;
|
||||
} else {
|
||||
fatal("invalid KEY nametype %s", nametype);
|
||||
}
|
||||
} else if (strcasecmp(nametype, "other") != 0) { /* DNSKEY */
|
||||
fatal("invalid DNSKEY nametype %s", nametype);
|
||||
}
|
||||
|
||||
rdclass = strtoclass(classname);
|
||||
|
||||
if (directory == NULL) {
|
||||
directory = ".";
|
||||
}
|
||||
|
||||
if ((options & DST_TYPE_KEY) == 0) {
|
||||
flags |= DNS_KEYOWNER_ZONE; /* DNSKEY: name type ZONE */
|
||||
if ((options & DST_TYPE_KEY) != 0) { /* KEY */
|
||||
flags |= signatory;
|
||||
} else if ((flags & DNS_KEYOWNER_ZONE) != 0) { /* DNSKEY */
|
||||
flags |= kskflag;
|
||||
flags |= revflag;
|
||||
} else {
|
||||
flags |= DNS_KEYOWNER_ENTITY; /* KEY: name type HOST */
|
||||
}
|
||||
|
||||
if (protocol == -1) {
|
||||
protocol = DNS_KEYPROTO_DNSSEC;
|
||||
} else if ((options & DST_TYPE_KEY) == 0 &&
|
||||
protocol != DNS_KEYPROTO_DNSSEC)
|
||||
{
|
||||
fatal("invalid DNSKEY protocol: %d", protocol);
|
||||
}
|
||||
|
||||
if ((flags & DNS_KEYFLAG_TYPEMASK) == DNS_KEYTYPE_NOKEY) {
|
||||
if ((flags & DNS_KEYFLAG_SIGNATORYMASK) != 0) {
|
||||
fatal("specified null key with signing authority");
|
||||
}
|
||||
}
|
||||
|
||||
isc_buffer_init(&buf, filename, sizeof(filename) - 1);
|
||||
|
||||
/* associate the key */
|
||||
ret = dst_key_fromlabel(name, alg, flags, DNS_KEYPROTO_DNSSEC, rdclass,
|
||||
label, NULL, mctx, &key);
|
||||
ret = dst_key_fromlabel(name, alg, flags, protocol, rdclass, label,
|
||||
NULL, mctx, &key);
|
||||
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
char namestr[DNS_NAME_FORMATSIZE];
|
||||
@@ -679,7 +744,7 @@ main(int argc, char **argv) {
|
||||
isc_mem_stats(mctx, stdout);
|
||||
}
|
||||
isc_mem_free(mctx, label);
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
if (freeit != NULL) {
|
||||
free(freeit);
|
||||
|
||||
@@ -21,7 +21,7 @@ dnssec-keyfromlabel - DNSSEC key generation tool
|
||||
Synopsis
|
||||
~~~~~~~~
|
||||
|
||||
:program:`dnssec-keyfromlabel` {**-l** label} [**-3**] [**-a** algorithm] [**-A** date/offset] [**-c** class] [**-D** date/offset] [**-D** sync date/offset] [**-f** flag] [**-G**] [**-I** date/offset] [**-i** interval] [**-k**] [**-K** directory] [**-L** ttl] [**-M** tag_min:tag_max] [**-P** date/offset] [**-P** sync date/offset] [**-p** protocol] [**-R** date/offset] [**-S** key] [**-v** level] [**-V**] [**-y**] {name}
|
||||
:program:`dnssec-keyfromlabel` {**-l** label} [**-3**] [**-a** algorithm] [**-A** date/offset] [**-c** class] [**-D** date/offset] [**-D** sync date/offset] [**-f** flag] [**-G**] [**-I** date/offset] [**-i** interval] [**-k**] [**-K** directory] [**-L** ttl] [**-M** tag_min:tag_max] [**-n** nametype] [**-P** date/offset] [**-P** sync date/offset] [**-p** protocol] [**-R** date/offset] [**-S** key] [**-t** type] [**-v** level] [**-V**] [**-y**] {name}
|
||||
|
||||
Description
|
||||
~~~~~~~~~~~
|
||||
@@ -70,6 +70,14 @@ Options
|
||||
When BIND 9 is built with OpenSSL-based PKCS#11 support, the label is
|
||||
an arbitrary string that identifies a particular key.
|
||||
|
||||
.. option:: -n nametype
|
||||
|
||||
This option specifies the owner type of the key. The value of ``nametype`` must
|
||||
either be ZONE (for a DNSSEC zone key (KEY/DNSKEY)), HOST or ENTITY
|
||||
(for a key associated with a host (KEY)), USER (for a key associated
|
||||
with a user (KEY)), or OTHER (DNSKEY). These values are
|
||||
case-insensitive.
|
||||
|
||||
.. option:: -C
|
||||
|
||||
This option enables compatibility mode, which generates an old-style key, without any metadata.
|
||||
@@ -127,6 +135,12 @@ Options
|
||||
values for ``tag_min`` and ``tag_max`` are [0..65535]. The
|
||||
default allows all key tag values to be accepted.
|
||||
|
||||
.. option:: -p protocol
|
||||
|
||||
This option sets the protocol value for the key. The protocol is a number between
|
||||
0 and 255. The default is 3 (DNSSEC). Other possible values for this
|
||||
argument are listed in :rfc:`2535` and its successors.
|
||||
|
||||
.. option:: -S key
|
||||
|
||||
This option generates a key as an explicit successor to an existing key. The name,
|
||||
@@ -136,6 +150,13 @@ Options
|
||||
set to the activation date minus the prepublication interval, which
|
||||
defaults to 30 days.
|
||||
|
||||
.. option:: -t type
|
||||
|
||||
This option indicates the type of the key. ``type`` must be one of AUTHCONF,
|
||||
NOAUTHCONF, NOAUTH, or NOCONF. The default is AUTHCONF. AUTH refers
|
||||
to the ability to authenticate data, and CONF to the ability to encrypt
|
||||
data.
|
||||
|
||||
.. option:: -v level
|
||||
|
||||
This option sets the debugging level.
|
||||
|
||||
+158
-28
@@ -38,8 +38,7 @@
|
||||
#include <isc/attributes.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/crypto.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/fips.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/region.h>
|
||||
@@ -51,13 +50,17 @@
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/kasp.h>
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/rdataclass.h>
|
||||
#include <dns/secalg.h>
|
||||
|
||||
#include <dst/dst.h>
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/provider.h>
|
||||
#endif
|
||||
|
||||
#include "dnssectool.h"
|
||||
|
||||
const char *program = "dnssec-keygen";
|
||||
@@ -82,11 +85,16 @@ struct keygen_ctx {
|
||||
const char *directory;
|
||||
dns_keystore_t *keystore;
|
||||
char *algname;
|
||||
char *nametype;
|
||||
char *type;
|
||||
int protocol;
|
||||
int size;
|
||||
uint16_t tag_min;
|
||||
uint16_t tag_max;
|
||||
int signatory;
|
||||
dns_rdataclass_t rdclass;
|
||||
int options;
|
||||
int dbits;
|
||||
dns_ttl_t ttl;
|
||||
bool wantzsk;
|
||||
bool wantksk;
|
||||
@@ -141,7 +149,7 @@ usage(void) {
|
||||
fprintf(stderr, " -l <file>: configuration file with dnssec-policy "
|
||||
"statement\n");
|
||||
fprintf(stderr, " -a <algorithm>:\n");
|
||||
if (!isc_crypto_fips_mode()) {
|
||||
if (!isc_fips_mode()) {
|
||||
fprintf(stderr, " RSASHA1 | NSEC3RSASHA1 |\n");
|
||||
}
|
||||
fprintf(stderr, " RSASHA256 | RSASHA512 |\n");
|
||||
@@ -149,7 +157,7 @@ usage(void) {
|
||||
fprintf(stderr, " ED25519 | ED448\n");
|
||||
fprintf(stderr, " -3: use NSEC3-capable algorithm\n");
|
||||
fprintf(stderr, " -b <key size in bits>:\n");
|
||||
if (!isc_crypto_fips_mode()) {
|
||||
if (!isc_fips_mode()) {
|
||||
fprintf(stderr, " RSASHA1:\t[%d..%d]\n", min_rsa,
|
||||
MAX_RSA);
|
||||
fprintf(stderr, " NSEC3RSASHA1:\t[%d..%d]\n", min_rsa,
|
||||
@@ -163,14 +171,23 @@ usage(void) {
|
||||
fprintf(stderr, " ED448:\tignored\n");
|
||||
fprintf(stderr, " (key size defaults are set according to\n"
|
||||
" algorithm and usage (ZSK or KSK)\n");
|
||||
fprintf(stderr, " -n <nametype>: ZONE | HOST | ENTITY | "
|
||||
"USER | OTHER\n");
|
||||
fprintf(stderr, " (DNSKEY generation defaults to ZONE)\n");
|
||||
fprintf(stderr, " -c <class>: (default: IN)\n");
|
||||
fprintf(stderr, " -d <digest bits> (0 => max, default)\n");
|
||||
fprintf(stderr, " -f <keyflag>: ZSK | KSK | REVOKE\n");
|
||||
fprintf(stderr, " -F: FIPS mode\n");
|
||||
fprintf(stderr, " -L <ttl>: default key TTL\n");
|
||||
fprintf(stderr, " -M <min>:<max>: allowed Key ID range\n");
|
||||
fprintf(stderr, " -p <protocol>: (default: 3 [dnssec])\n");
|
||||
fprintf(stderr, " -s <strength>: strength value this key signs DNS "
|
||||
"records with (default: 0)\n");
|
||||
fprintf(stderr, " -T <rrtype>: DNSKEY | KEY (default: DNSKEY; "
|
||||
"use KEY for SIG(0))\n");
|
||||
fprintf(stderr, " -t <type>: "
|
||||
"AUTHCONF | NOAUTHCONF | NOAUTH | NOCONF "
|
||||
"(default: AUTHCONF)\n");
|
||||
fprintf(stderr, " -h: print usage and exit\n");
|
||||
fprintf(stderr, " -m <memory debugging mode>:\n");
|
||||
fprintf(stderr, " usage | trace | record\n");
|
||||
@@ -258,7 +275,7 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
|
||||
isc_buffer_init(&buf, argv[isc_commandline_index],
|
||||
strlen(argv[isc_commandline_index]));
|
||||
isc_buffer_add(&buf, strlen(argv[isc_commandline_index]));
|
||||
ret = dns_name_fromtext(name, &buf, dns_rootname, 0);
|
||||
ret = dns_name_fromtext(name, &buf, dns_rootname, 0, NULL);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
fatal("invalid key name %s: %s",
|
||||
argv[isc_commandline_index],
|
||||
@@ -269,7 +286,7 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
|
||||
fatal("unsupported algorithm: %s", algstr);
|
||||
}
|
||||
|
||||
if (isc_crypto_fips_mode()) {
|
||||
if (isc_fips_mode()) {
|
||||
/* verify only in FIPS mode */
|
||||
switch (ctx->alg) {
|
||||
case DST_ALG_RSASHA1:
|
||||
@@ -300,11 +317,29 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->type != NULL && (ctx->options & DST_TYPE_KEY) != 0) {
|
||||
if (strcasecmp(ctx->type, "NOAUTH") == 0) {
|
||||
flags |= DNS_KEYTYPE_NOAUTH;
|
||||
} else if (strcasecmp(ctx->type, "NOCONF") == 0) {
|
||||
flags |= DNS_KEYTYPE_NOCONF;
|
||||
} else if (strcasecmp(ctx->type, "NOAUTHCONF") == 0) {
|
||||
flags |= (DNS_KEYTYPE_NOAUTH |
|
||||
DNS_KEYTYPE_NOCONF);
|
||||
if (ctx->size < 0) {
|
||||
ctx->size = 0;
|
||||
}
|
||||
} else if (strcasecmp(ctx->type, "AUTHCONF") == 0) {
|
||||
/* nothing */
|
||||
} else {
|
||||
fatal("invalid type %s", ctx->type);
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->size < 0) {
|
||||
switch (ctx->alg) {
|
||||
case DST_ALG_RSASHA1:
|
||||
case DST_ALG_NSEC3RSASHA1:
|
||||
if (isc_crypto_fips_mode()) {
|
||||
if (isc_fips_mode()) {
|
||||
fatal("key size not specified (-b "
|
||||
"option)");
|
||||
}
|
||||
@@ -371,6 +406,12 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
|
||||
if (ctx->size >= 0) {
|
||||
fatal("-S and -b cannot be used together");
|
||||
}
|
||||
if (ctx->nametype != NULL) {
|
||||
fatal("-S and -n cannot be used together");
|
||||
}
|
||||
if (ctx->type != NULL) {
|
||||
fatal("-S and -t cannot be used together");
|
||||
}
|
||||
if (ctx->setpub || ctx->unsetpub) {
|
||||
fatal("-S and -P cannot be used together");
|
||||
}
|
||||
@@ -458,7 +499,7 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
|
||||
switch (ctx->alg) {
|
||||
case DNS_KEYALG_RSASHA1:
|
||||
case DNS_KEYALG_NSEC3RSASHA1:
|
||||
if (isc_crypto_fips_mode()) {
|
||||
if (isc_fips_mode()) {
|
||||
fatal("SHA1 based keys not supported in FIPS mode");
|
||||
}
|
||||
FALLTHROUGH;
|
||||
@@ -484,17 +525,34 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((ctx->options & DST_TYPE_KEY) == 0) {
|
||||
flags |= DNS_KEYOWNER_ZONE; /* DNSKEY: name type ZONE */
|
||||
} else {
|
||||
flags |= DNS_KEYOWNER_ENTITY; /* KEY: name type HOST */
|
||||
if (ctx->nametype == NULL) {
|
||||
if ((ctx->options & DST_TYPE_KEY) != 0) { /* KEY */
|
||||
fatal("no nametype specified");
|
||||
}
|
||||
flags |= DNS_KEYOWNER_ZONE; /* DNSKEY */
|
||||
} else if (strcasecmp(ctx->nametype, "zone") == 0) {
|
||||
flags |= DNS_KEYOWNER_ZONE;
|
||||
} else if ((ctx->options & DST_TYPE_KEY) != 0) { /* KEY */
|
||||
if (strcasecmp(ctx->nametype, "host") == 0 ||
|
||||
strcasecmp(ctx->nametype, "entity") == 0)
|
||||
{
|
||||
flags |= DNS_KEYOWNER_ENTITY;
|
||||
} else if (strcasecmp(ctx->nametype, "user") == 0) {
|
||||
flags |= DNS_KEYOWNER_USER;
|
||||
} else {
|
||||
fatal("invalid KEY nametype %s", ctx->nametype);
|
||||
}
|
||||
} else if (strcasecmp(ctx->nametype, "other") != 0) { /* DNSKEY */
|
||||
fatal("invalid DNSKEY nametype %s", ctx->nametype);
|
||||
}
|
||||
|
||||
if (ctx->directory == NULL) {
|
||||
ctx->directory = ".";
|
||||
}
|
||||
|
||||
if ((flags & DNS_KEYOWNER_ZONE) != 0) { /* DNSKEY */
|
||||
if ((ctx->options & DST_TYPE_KEY) != 0) { /* KEY */
|
||||
flags |= ctx->signatory;
|
||||
} else if ((flags & DNS_KEYOWNER_ZONE) != 0) { /* DNSKEY */
|
||||
if (ctx->ksk || ctx->wantksk) {
|
||||
flags |= DNS_KEYFLAG_KSK;
|
||||
}
|
||||
@@ -503,6 +561,23 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->protocol == -1) {
|
||||
ctx->protocol = DNS_KEYPROTO_DNSSEC;
|
||||
} else if ((ctx->options & DST_TYPE_KEY) == 0 &&
|
||||
ctx->protocol != DNS_KEYPROTO_DNSSEC)
|
||||
{
|
||||
fatal("invalid DNSKEY protocol: %d", ctx->protocol);
|
||||
}
|
||||
|
||||
if ((flags & DNS_KEYFLAG_TYPEMASK) == DNS_KEYTYPE_NOKEY) {
|
||||
if (ctx->size > 0) {
|
||||
fatal("specified null key with non-zero size");
|
||||
}
|
||||
if ((flags & DNS_KEYFLAG_SIGNATORYMASK) != 0) {
|
||||
fatal("specified null key with signing authority");
|
||||
}
|
||||
}
|
||||
|
||||
switch (ctx->alg) {
|
||||
case DNS_KEYALG_RSASHA1:
|
||||
case DNS_KEYALG_NSEC3RSASHA1:
|
||||
@@ -538,12 +613,12 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
|
||||
mctx, ctx->alg, ctx->size, flags, &key);
|
||||
} else if (!ctx->quiet && show_progress) {
|
||||
ret = dst_key_generate(name, ctx->alg, ctx->size, 0,
|
||||
flags, DNS_KEYPROTO_DNSSEC,
|
||||
flags, ctx->protocol,
|
||||
ctx->rdclass, NULL, mctx, &key,
|
||||
&progress);
|
||||
} else {
|
||||
ret = dst_key_generate(name, ctx->alg, ctx->size, 0,
|
||||
flags, DNS_KEYPROTO_DNSSEC,
|
||||
flags, ctx->protocol,
|
||||
ctx->rdclass, NULL, mctx, &key,
|
||||
NULL);
|
||||
}
|
||||
@@ -560,6 +635,8 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
|
||||
algstr, isc_result_totext(ret));
|
||||
}
|
||||
|
||||
dst_key_setbits(key, ctx->dbits);
|
||||
|
||||
/*
|
||||
* Set key timing metadata (unless using -C)
|
||||
*
|
||||
@@ -768,10 +845,15 @@ main(int argc, char **argv) {
|
||||
isc_textregion_t r;
|
||||
unsigned char c;
|
||||
int ch;
|
||||
bool set_fips_mode = false;
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
OSSL_PROVIDER *fips = NULL, *base = NULL;
|
||||
#endif
|
||||
|
||||
keygen_ctx_t ctx = {
|
||||
.options = DST_TYPE_PRIVATE | DST_TYPE_PUBLIC,
|
||||
.prepub = -1,
|
||||
.protocol = -1,
|
||||
.size = -1,
|
||||
.now = isc_stdtime_now(),
|
||||
};
|
||||
@@ -833,7 +915,10 @@ main(int argc, char **argv) {
|
||||
classname = isc_commandline_argument;
|
||||
break;
|
||||
case 'd':
|
||||
fatal("The -d option has been deprecated.");
|
||||
ctx.dbits = strtol(isc_commandline_argument, &endp, 10);
|
||||
if (*endp != '\0' || ctx.dbits < 0) {
|
||||
fatal("-d requires a non-negative number");
|
||||
}
|
||||
break;
|
||||
case 'E':
|
||||
fatal("%s", isc_result_totext(DST_R_NOENGINE));
|
||||
@@ -870,7 +955,7 @@ main(int argc, char **argv) {
|
||||
ctx.configfile = isc_commandline_argument;
|
||||
break;
|
||||
case 'n':
|
||||
fatal("The -n option has been deprecated.");
|
||||
ctx.nametype = isc_commandline_argument;
|
||||
break;
|
||||
case 'M': {
|
||||
unsigned long ul;
|
||||
@@ -890,7 +975,14 @@ main(int argc, char **argv) {
|
||||
case 'm':
|
||||
break;
|
||||
case 'p':
|
||||
fatal("The -p option has been deprecated.");
|
||||
ctx.protocol = strtol(isc_commandline_argument, &endp,
|
||||
10);
|
||||
if (*endp != '\0' || ctx.protocol < 0 ||
|
||||
ctx.protocol > 255)
|
||||
{
|
||||
fatal("-p must be followed by a number "
|
||||
"[0..255]");
|
||||
}
|
||||
break;
|
||||
case 'q':
|
||||
ctx.quiet = true;
|
||||
@@ -900,13 +992,21 @@ main(int argc, char **argv) {
|
||||
"System random data is always used.\n");
|
||||
break;
|
||||
case 's':
|
||||
fatal("The -s option has been deprecated.");
|
||||
ctx.signatory = strtol(isc_commandline_argument, &endp,
|
||||
10);
|
||||
if (*endp != '\0' || ctx.signatory < 0 ||
|
||||
ctx.signatory > 15)
|
||||
{
|
||||
fatal("-s must be followed by a number "
|
||||
"[0..15]");
|
||||
}
|
||||
break;
|
||||
case 'T':
|
||||
if (strcasecmp(isc_commandline_argument, "KEY") == 0) {
|
||||
ctx.options |= DST_TYPE_KEY;
|
||||
} else if (strcasecmp(isc_commandline_argument,
|
||||
"DNSKEY") == 0)
|
||||
"DNSKE"
|
||||
"Y") == 0)
|
||||
{
|
||||
/* default behavior */
|
||||
} else {
|
||||
@@ -915,7 +1015,7 @@ main(int argc, char **argv) {
|
||||
}
|
||||
break;
|
||||
case 't':
|
||||
fatal("The -t option has been deprecated.");
|
||||
ctx.type = isc_commandline_argument;
|
||||
break;
|
||||
case 'v':
|
||||
endp = NULL;
|
||||
@@ -1007,9 +1107,7 @@ main(int argc, char **argv) {
|
||||
ctx.prepub = strtottl(isc_commandline_argument);
|
||||
break;
|
||||
case 'F':
|
||||
if (isc_crypto_fips_enable() != ISC_R_SUCCESS) {
|
||||
fatal("setting FIPS mode failed");
|
||||
}
|
||||
set_fips_mode = true;
|
||||
break;
|
||||
case '?':
|
||||
if (isc_commandline_option != '?') {
|
||||
@@ -1036,11 +1134,32 @@ main(int argc, char **argv) {
|
||||
ctx.quiet = true;
|
||||
}
|
||||
|
||||
if (set_fips_mode) {
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
fips = OSSL_PROVIDER_load(NULL, "fips");
|
||||
if (fips == NULL) {
|
||||
ERR_clear_error();
|
||||
fatal("Failed to load FIPS provider");
|
||||
}
|
||||
base = OSSL_PROVIDER_load(NULL, "base");
|
||||
if (base == NULL) {
|
||||
OSSL_PROVIDER_unload(fips);
|
||||
ERR_clear_error();
|
||||
fatal("Failed to load base provider");
|
||||
}
|
||||
#endif
|
||||
if (!isc_fips_mode()) {
|
||||
if (isc_fips_set_mode(1) != ISC_R_SUCCESS) {
|
||||
fatal("setting FIPS mode failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The DST subsystem will set FIPS mode if requested at build time.
|
||||
* The minimum sizes are both raised to 2048.
|
||||
*/
|
||||
if (isc_crypto_fips_mode()) {
|
||||
if (isc_fips_mode()) {
|
||||
min_rsa = min_dh = 2048;
|
||||
}
|
||||
|
||||
@@ -1077,6 +1196,9 @@ main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (ctx.policy != NULL) {
|
||||
if (ctx.nametype != NULL) {
|
||||
fatal("-k and -n cannot be used together");
|
||||
}
|
||||
if (ctx.predecessor != NULL) {
|
||||
fatal("-k and -S cannot be used together");
|
||||
}
|
||||
@@ -1095,7 +1217,7 @@ main(int argc, char **argv) {
|
||||
if (ctx.wantrev) {
|
||||
fatal("-k and -fR cannot be used together");
|
||||
}
|
||||
if ((ctx.options & DST_TYPE_KEY) != 0) {
|
||||
if (ctx.options & DST_TYPE_KEY) {
|
||||
fatal("-k and -T KEY cannot be used together");
|
||||
}
|
||||
if (ctx.use_nsec3) {
|
||||
@@ -1184,8 +1306,16 @@ main(int argc, char **argv) {
|
||||
if (verbose > 10) {
|
||||
isc_mem_stats(mctx, stdout);
|
||||
}
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
if (base != NULL) {
|
||||
OSSL_PROVIDER_unload(base);
|
||||
}
|
||||
if (fips != NULL) {
|
||||
OSSL_PROVIDER_unload(fips);
|
||||
}
|
||||
#endif
|
||||
if (freeit != NULL) {
|
||||
free(freeit);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ dnssec-keygen: DNSSEC key generation tool
|
||||
Synopsis
|
||||
~~~~~~~~
|
||||
|
||||
:program:`dnssec-keygen` [**-3**] [**-A** date/offset] [**-a** algorithm] [**-b** keysize] [**-C**] [**-c** class] [**-D** date/offset] [**-D** sync date/offset] [**-f** flag] [**-F**] [**-G**] [**-h**] [**-I** date/offset] [**-i** interval] [**-K** directory] [**-k** policy] [**-L** ttl] [**-l** file] [**-M** tag_min:tag_max] [**-P** date/offset] [**-P** sync date/offset] [**-p** protocol] [**-q**] [**-R** date/offset] [**-S** key] [**-s** strength] [**-T** rrtype] [**-V**] [**-v** level] {name}
|
||||
:program:`dnssec-keygen` [**-3**] [**-A** date/offset] [**-a** algorithm] [**-b** keysize] [**-C**] [**-c** class] [**-D** date/offset] [**-d** bits] [**-D** sync date/offset] [**-f** flag] [**-F**] [**-G**] [**-h**] [**-I** date/offset] [**-i** interval] [**-K** directory] [**-k** policy] [**-L** ttl] [**-l** file] [**-M** tag_min:tag_max] [**-n** nametype] [**-P** date/offset] [**-P** sync date/offset] [**-p** protocol] [**-q**] [**-R** date/offset] [**-S** key] [**-s** strength] [**-T** rrtype] [**-t** type] [**-V**] [**-v** level] {name}
|
||||
|
||||
Description
|
||||
~~~~~~~~~~~
|
||||
@@ -87,6 +87,13 @@ Options
|
||||
This option indicates that the DNS record containing the key should have the
|
||||
specified class. If not specified, class IN is used.
|
||||
|
||||
.. option:: -d bits
|
||||
|
||||
This option specifies the key size in bits. For the algorithms RSASHA1, NSEC3RSASA1, RSASHA256, and
|
||||
RSASHA512 the key size must be between 1024 and 4096 bits; DH size is between 128
|
||||
and 4096 bits. This option is ignored for algorithms ECDSAP256SHA256,
|
||||
ECDSAP384SHA384, ED25519, and ED448.
|
||||
|
||||
.. option:: -f flag
|
||||
|
||||
This option sets the specified flag in the flag field of the KEY/DNSKEY record.
|
||||
@@ -156,6 +163,21 @@ Options
|
||||
key tag values to be produced. This option is ignored when ``-k policy``
|
||||
is specified.
|
||||
|
||||
.. option:: -n nametype
|
||||
|
||||
This option specifies the owner type of the key. The value of ``nametype`` must
|
||||
either be ZONE (for a DNSSEC zone key (KEY/DNSKEY)), HOST or ENTITY
|
||||
(for a key associated with a host (KEY)), USER (for a key associated
|
||||
with a user (KEY)), or OTHER (DNSKEY). These values are
|
||||
case-insensitive. The default is ZONE for DNSKEY generation.
|
||||
|
||||
.. option:: -p protocol
|
||||
|
||||
This option sets the protocol value for the generated key, for use with
|
||||
:option:`-T KEY <-T>`. The protocol is a number between 0 and 255. The default
|
||||
is 3 (DNSSEC). Other possible values for this argument are listed in
|
||||
:rfc:`2535` and its successors.
|
||||
|
||||
.. option:: -q
|
||||
|
||||
This option sets quiet mode, which suppresses unnecessary output, including progress
|
||||
@@ -176,6 +198,11 @@ Options
|
||||
set to the activation date minus the prepublication interval,
|
||||
which defaults to 30 days.
|
||||
|
||||
.. option:: -s strength
|
||||
|
||||
This option specifies the strength value of the key. The strength is a number
|
||||
between 0 and 15, and currently has no defined purpose in DNSSEC.
|
||||
|
||||
.. option:: -T rrtype
|
||||
|
||||
This option specifies the resource record type to use for the key. ``rrtype``
|
||||
@@ -183,6 +210,13 @@ Options
|
||||
DNSSEC algorithm, but it can be overridden to KEY for use with
|
||||
SIG(0).
|
||||
|
||||
.. option:: -t type
|
||||
|
||||
This option indicates the type of the key for use with :option:`-T KEY <-T>`. ``type``
|
||||
must be one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF. The default
|
||||
is AUTHCONF. AUTH refers to the ability to authenticate data, and
|
||||
CONF to the ability to encrypt data.
|
||||
|
||||
.. option:: -V
|
||||
|
||||
This option prints version information.
|
||||
|
||||
+29
-10
@@ -18,9 +18,8 @@
|
||||
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/crypto.h>
|
||||
#include <isc/fips.h>
|
||||
#include <isc/lex.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/mem.h>
|
||||
|
||||
#include <dns/callbacks.h>
|
||||
@@ -28,7 +27,6 @@
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/keymgr.h>
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/rdataclass.h>
|
||||
#include <dns/rdatalist.h>
|
||||
#include <dns/rdataset.h>
|
||||
@@ -362,7 +360,7 @@ create_key(ksr_ctx_t *ksr, dns_kasp_t *kasp, dns_kasp_key_t *kaspkey,
|
||||
switch (ksr->alg) {
|
||||
case DST_ALG_RSASHA1:
|
||||
case DST_ALG_NSEC3RSASHA1:
|
||||
if (isc_crypto_fips_mode()) {
|
||||
if (isc_fips_mode()) {
|
||||
/* verify-only in FIPS mode */
|
||||
fatal("unsupported algorithm: %s", algstr);
|
||||
}
|
||||
@@ -1008,7 +1006,7 @@ parse_dnskey(isc_lex_t *lex, char *owner, isc_buffer_t *buf, dns_ttl_t *ttl) {
|
||||
dname = dns_fixedname_initname(&dfname);
|
||||
isc_buffer_init(&b, owner, strlen(owner));
|
||||
isc_buffer_add(&b, strlen(owner));
|
||||
ret = dns_name_fromtext(dname, &b, dns_rootname, 0);
|
||||
ret = dns_name_fromtext(dname, &b, dns_rootname, 0, NULL);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
@@ -1348,6 +1346,10 @@ main(int argc, char *argv[]) {
|
||||
isc_buffer_t buf;
|
||||
int ch;
|
||||
char *endp;
|
||||
bool set_fips_mode = false;
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
OSSL_PROVIDER *fips = NULL, *base = NULL;
|
||||
#endif
|
||||
ksr_ctx_t ksr = {
|
||||
.now = isc_stdtime_now(),
|
||||
};
|
||||
@@ -1367,9 +1369,7 @@ main(int argc, char *argv[]) {
|
||||
ksr.now, &ksr.setend);
|
||||
break;
|
||||
case 'F':
|
||||
if (isc_crypto_fips_enable() != ISC_R_SUCCESS) {
|
||||
fatal("setting FIPS mode failed");
|
||||
}
|
||||
set_fips_mode = true;
|
||||
break;
|
||||
case 'f':
|
||||
ksr.file = isc_commandline_argument;
|
||||
@@ -1423,18 +1423,37 @@ main(int argc, char *argv[]) {
|
||||
* The DST subsystem will set FIPS mode if requested at build time.
|
||||
* The minimum sizes are both raised to 2048.
|
||||
*/
|
||||
if (isc_crypto_fips_mode()) {
|
||||
if (isc_fips_mode()) {
|
||||
min_rsa = min_dh = 2048;
|
||||
}
|
||||
|
||||
setup_logging();
|
||||
|
||||
if (set_fips_mode) {
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
fips = OSSL_PROVIDER_load(NULL, "fips");
|
||||
if (fips == NULL) {
|
||||
fatal("Failed to load FIPS provider");
|
||||
}
|
||||
base = OSSL_PROVIDER_load(NULL, "base");
|
||||
if (base == NULL) {
|
||||
OSSL_PROVIDER_unload(fips);
|
||||
fatal("Failed to load base provider");
|
||||
}
|
||||
#endif
|
||||
if (!isc_fips_mode()) {
|
||||
if (isc_fips_set_mode(1) != ISC_R_SUCCESS) {
|
||||
fatal("setting FIPS mode failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* zone */
|
||||
namestr = argv[1];
|
||||
name = dns_fixedname_initname(&fname);
|
||||
isc_buffer_init(&buf, argv[1], strlen(argv[1]));
|
||||
isc_buffer_add(&buf, strlen(argv[1]));
|
||||
ret = dns_name_fromtext(name, &buf, dns_rootname, 0);
|
||||
ret = dns_name_fromtext(name, &buf, dns_rootname, 0, NULL);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
fatal("invalid zone name %s: %s", argv[1],
|
||||
isc_result_totext(ret));
|
||||
|
||||
@@ -23,14 +23,12 @@
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/string.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
|
||||
#include <dst/dst.h>
|
||||
|
||||
@@ -248,7 +246,7 @@ cleanup:
|
||||
if (dir != NULL) {
|
||||
isc_mem_free(mctx, dir);
|
||||
}
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/result.h>
|
||||
@@ -34,7 +33,6 @@
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
|
||||
#include <dst/dst.h>
|
||||
|
||||
@@ -949,7 +947,7 @@ main(int argc, char **argv) {
|
||||
isc_mem_stats(mctx, stdout);
|
||||
}
|
||||
isc_mem_free(mctx, directory);
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/dir.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/fips.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/hex.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/managers.h>
|
||||
@@ -71,7 +71,6 @@
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/kasp.h>
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/master.h>
|
||||
#include <dns/masterdump.h>
|
||||
#include <dns/nsec.h>
|
||||
@@ -89,6 +88,10 @@
|
||||
#include <dns/zoneverify.h>
|
||||
|
||||
#include <dst/dst.h>
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/provider.h>
|
||||
#endif
|
||||
|
||||
#include "dnssectool.h"
|
||||
|
||||
@@ -416,9 +419,10 @@ keythatsigned(dns_rdata_rrsig_t *rrsig) {
|
||||
dns_dnsseckey_create(mctx, &privkey, &key);
|
||||
} else {
|
||||
dns_dnsseckey_create(mctx, &pubkey, &key);
|
||||
key->pubkey = true;
|
||||
}
|
||||
|
||||
key->force_publish = false;
|
||||
key->force_sign = false;
|
||||
key->index = keycount++;
|
||||
ISC_LIST_APPEND(keylist, key, link);
|
||||
|
||||
@@ -536,7 +540,7 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
|
||||
}
|
||||
|
||||
while (result == ISC_R_SUCCESS) {
|
||||
bool expired, refresh, future, offline;
|
||||
bool expired, future;
|
||||
bool keep = false, resign = false;
|
||||
|
||||
dns_rdataset_current(&sigset, &sigrdata);
|
||||
@@ -547,10 +551,8 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
|
||||
future = isc_serial_lt(now, rrsig.timesigned);
|
||||
|
||||
key = keythatsigned(&rrsig);
|
||||
offline = (key != NULL) ? key->pubkey : false;
|
||||
sig_format(&rrsig, sigstr, sizeof(sigstr));
|
||||
expired = isc_serial_gt(now, rrsig.timeexpire);
|
||||
refresh = isc_serial_gt(now + cycle, rrsig.timeexpire);
|
||||
expired = isc_serial_gt(now + cycle, rrsig.timeexpire);
|
||||
|
||||
if (isc_serial_gt(rrsig.timesigned, rrsig.timeexpire)) {
|
||||
/* rrsig is dropped and not replaced */
|
||||
@@ -579,21 +581,15 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
|
||||
} else if (issigningkey(key)) {
|
||||
wassignedby[key->index] = true;
|
||||
|
||||
if (!refresh && rrsig.originalttl == set->ttl &&
|
||||
if (!expired && rrsig.originalttl == set->ttl &&
|
||||
setverifies(name, set, key->key, &sigrdata))
|
||||
{
|
||||
vbprintf(2, "\trrsig by %s retained\n", sigstr);
|
||||
keep = true;
|
||||
} else if (offline) {
|
||||
vbprintf(2,
|
||||
"\trrsig by %s retained - private key "
|
||||
"missing\n",
|
||||
sigstr);
|
||||
keep = true;
|
||||
} else {
|
||||
vbprintf(2, "\trrsig by %s dropped - %s\n",
|
||||
sigstr,
|
||||
refresh ? "refresh"
|
||||
expired ? "expired"
|
||||
: rrsig.originalttl != set->ttl
|
||||
? "ttl change"
|
||||
: "failed to "
|
||||
@@ -606,32 +602,25 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
|
||||
} else if (iszonekey(key)) {
|
||||
wassignedby[key->index] = true;
|
||||
|
||||
if (!refresh && rrsig.originalttl == set->ttl &&
|
||||
if (!expired && rrsig.originalttl == set->ttl &&
|
||||
setverifies(name, set, key->key, &sigrdata))
|
||||
{
|
||||
vbprintf(2, "\trrsig by %s retained\n", sigstr);
|
||||
keep = true;
|
||||
} else if (offline) {
|
||||
vbprintf(2,
|
||||
"\trrsig by %s retained - private key "
|
||||
"missing\n",
|
||||
sigstr);
|
||||
keep = true;
|
||||
} else {
|
||||
vbprintf(2, "\trrsig by %s dropped - %s\n",
|
||||
sigstr,
|
||||
refresh ? "refresh"
|
||||
expired ? "expired"
|
||||
: rrsig.originalttl != set->ttl
|
||||
? "ttl change"
|
||||
: "failed to "
|
||||
"verify");
|
||||
}
|
||||
} else if (!refresh) {
|
||||
} else if (!expired) {
|
||||
vbprintf(2, "\trrsig by %s retained\n", sigstr);
|
||||
keep = true;
|
||||
} else {
|
||||
vbprintf(2, "\trrsig by %s %s\n", sigstr,
|
||||
expired ? "expired" : "needs refresh");
|
||||
vbprintf(2, "\trrsig by %s expired\n", sigstr);
|
||||
}
|
||||
|
||||
if (keep) {
|
||||
@@ -954,7 +943,7 @@ addnowildcardhash(hashlist_t *l,
|
||||
|
||||
wild = dns_fixedname_initname(&fixed);
|
||||
|
||||
result = dns_name_concatenate(dns_wildcardname, name, wild);
|
||||
result = dns_name_concatenate(dns_wildcardname, name, wild, NULL);
|
||||
if (result == ISC_R_NOSPACE) {
|
||||
return;
|
||||
}
|
||||
@@ -2029,7 +2018,7 @@ addnsec3(dns_name_t *name, dns_dbnode_t *node, const unsigned char *salt,
|
||||
dns_fixedname_init(&hashname);
|
||||
dns_rdataset_init(&rdataset);
|
||||
|
||||
dns_name_downcase(name, name);
|
||||
dns_name_downcase(name, name, NULL);
|
||||
result = dns_nsec3_hashname(&hashname, hash, &hash_len, name, gorigin,
|
||||
dns_hash_sha1, iterations, salt, salt_len);
|
||||
check_result(result, "addnsec3: dns_nsec3_hashname()");
|
||||
@@ -2397,7 +2386,7 @@ nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
|
||||
fatal("iterating through the database failed: %s",
|
||||
isc_result_totext(result));
|
||||
}
|
||||
dns_name_downcase(name, name);
|
||||
dns_name_downcase(name, name, NULL);
|
||||
hashlist_add_dns_name(hashlist, name, hashalg, iterations, salt,
|
||||
salt_len, false);
|
||||
dns_db_detachnode(gdb, &node);
|
||||
@@ -2407,7 +2396,7 @@ nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
|
||||
* node for another <name,nextname> span so we don't add
|
||||
* it here. Empty labels on nextname are within the span.
|
||||
*/
|
||||
dns_name_downcase(nextname, nextname);
|
||||
dns_name_downcase(nextname, nextname, NULL);
|
||||
dns_name_fullcompare(name, nextname, &order, &nlabels);
|
||||
addnowildcardhash(hashlist, name, hashalg, iterations, salt,
|
||||
salt_len);
|
||||
@@ -2574,7 +2563,7 @@ loadzone(char *file, char *origin, dns_rdataclass_t rdclass, dns_db_t **db) {
|
||||
isc_buffer_add(&b, len);
|
||||
|
||||
name = dns_fixedname_initname(&fname);
|
||||
result = dns_name_fromtext(name, &b, dns_rootname, 0);
|
||||
result = dns_name_fromtext(name, &b, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("failed converting name '%s' to dns format: %s", origin,
|
||||
isc_result_totext(result));
|
||||
@@ -3375,16 +3364,17 @@ main(int argc, char *argv[]) {
|
||||
bool set_optout = false;
|
||||
bool set_iter = false;
|
||||
bool nonsecify = false;
|
||||
bool set_fips_mode = false;
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
OSSL_PROVIDER *fips = NULL, *base = NULL;
|
||||
#endif
|
||||
|
||||
atomic_init(&shuttingdown, false);
|
||||
atomic_init(&finished, false);
|
||||
|
||||
/*
|
||||
* Unused letters: Bb G J l q Yy (and F is reserved).
|
||||
* l was previously used for DLV lookaside.
|
||||
*/
|
||||
#define CMDLINE_FLAGS \
|
||||
"3:AaCc:Dd:E:e:f:FgG:hH:i:I:j:J:K:k:L:m:M:n:N:o:O:PpQqRr:s:ST:tuUv:" \
|
||||
/* Unused letters: Bb G J q Yy (and F is reserved). */
|
||||
#define CMDLINE_FLAGS \
|
||||
"3:AaCc:Dd:E:e:f:FgG:hH:i:I:j:J:K:k:L:l:m:M:n:N:o:O:PpQqRr:s:ST:tuUv:" \
|
||||
"VX:xzZ:"
|
||||
|
||||
/*
|
||||
@@ -3558,6 +3548,10 @@ main(int argc, char *argv[]) {
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
fatal("-l option (DLV lookaside) is obsolete");
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
endp = NULL;
|
||||
set_maxttl = true;
|
||||
@@ -3663,9 +3657,7 @@ main(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
if (isc_crypto_fips_enable() != ISC_R_SUCCESS) {
|
||||
fatal("setting FIPS mode failed");
|
||||
}
|
||||
set_fips_mode = true;
|
||||
break;
|
||||
|
||||
case '?':
|
||||
@@ -3736,6 +3728,27 @@ main(int argc, char *argv[]) {
|
||||
|
||||
isc_managers_create(&mctx, nloops, &loopmgr, &netmgr);
|
||||
|
||||
if (set_fips_mode) {
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
fips = OSSL_PROVIDER_load(NULL, "fips");
|
||||
if (fips == NULL) {
|
||||
ERR_clear_error();
|
||||
fatal("Failed to load FIPS provider");
|
||||
}
|
||||
base = OSSL_PROVIDER_load(NULL, "base");
|
||||
if (base == NULL) {
|
||||
OSSL_PROVIDER_unload(fips);
|
||||
ERR_clear_error();
|
||||
fatal("Failed to load base provider");
|
||||
}
|
||||
#endif
|
||||
if (!isc_fips_mode()) {
|
||||
if (isc_fips_set_mode(1) != ISC_R_SUCCESS) {
|
||||
fatal("setting FIPS mode failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setup_logging();
|
||||
|
||||
argc -= isc_commandline_index;
|
||||
@@ -4107,6 +4120,15 @@ main(int argc, char *argv[]) {
|
||||
isc_mem_stats(mctx, stdout);
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
if (base != NULL) {
|
||||
OSSL_PROVIDER_unload(base);
|
||||
}
|
||||
if (fips != NULL) {
|
||||
OSSL_PROVIDER_unload(fips);
|
||||
}
|
||||
#endif
|
||||
|
||||
isc_managers_destroy(&mctx, &loopmgr, &netmgr);
|
||||
|
||||
if (printstats) {
|
||||
|
||||
@@ -174,11 +174,6 @@ Options
|
||||
days. Therefore, if any existing RRSIG records are due to expire in
|
||||
less than 7.5 days, they are replaced.
|
||||
|
||||
Note that the calculation of cycle interval is based upon the validity
|
||||
period of the replacement signatures that would be generated by
|
||||
``dnssec-signzone``, not on the valid lifetimes of the input RRSIGs being
|
||||
considered for pre-expiry replacement.
|
||||
|
||||
.. option:: -I input-format
|
||||
|
||||
This option sets the format of the input zone file. Possible formats are
|
||||
@@ -274,7 +269,7 @@ Options
|
||||
with cached copies of the old DNSKEY RRset. The :option:`-Q` option forces
|
||||
:program:`dnssec-signzone` to remove signatures from keys that are no longer
|
||||
active. This enables ZSK rollover using the procedure described in
|
||||
:rfc:`6781#section-4.1.1.1` ("Pre-Publish Zone Signing Key Rollover").
|
||||
:rfc:`6781#4.1.1.1` ("Pre-Publish Key Rollover").
|
||||
|
||||
.. option:: -q
|
||||
|
||||
@@ -291,7 +286,7 @@ Options
|
||||
This option is similar to :option:`-Q`, except it forces
|
||||
:program:`dnssec-signzone` to remove signatures from keys that are no longer
|
||||
published. This enables ZSK rollover using the procedure described in
|
||||
:rfc:`6781#section-4.1.1.2` ("Double Signature Zone Signing Key
|
||||
:rfc:`6781#4.1.1.2` ("Double Signature Zone Signing Key
|
||||
Rollover").
|
||||
|
||||
.. option:: -S
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <isc/file.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/hex.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/mutex.h>
|
||||
@@ -44,7 +43,6 @@
|
||||
#include <dns/ds.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/keyvalues.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/master.h>
|
||||
#include <dns/masterdump.h>
|
||||
#include <dns/nsec.h>
|
||||
@@ -105,7 +103,7 @@ loadzone(char *file, char *origin, dns_rdataclass_t rdclass, dns_db_t **db) {
|
||||
isc_buffer_add(&b, len);
|
||||
|
||||
name = dns_fixedname_initname(&fname);
|
||||
result = dns_name_fromtext(name, &b, dns_rootname, 0);
|
||||
result = dns_name_fromtext(name, &b, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("failed converting name '%s' to dns format: %s", origin,
|
||||
isc_result_totext(result));
|
||||
@@ -330,7 +328,7 @@ main(int argc, char *argv[]) {
|
||||
if (verbose > 10) {
|
||||
isc_mem_stats(mctx, stdout);
|
||||
}
|
||||
isc_mem_detach(&mctx);
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
return result == ISC_R_SUCCESS ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -460,7 +460,9 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
||||
dns_secalg_t alg;
|
||||
isc_stdtime_t now = isc_stdtime_now();
|
||||
|
||||
SET_IF_NOT_NULL(exact, false);
|
||||
if (exact != NULL) {
|
||||
*exact = false;
|
||||
}
|
||||
|
||||
id = dst_key_id(dstkey);
|
||||
rid = dst_key_rid(dstkey);
|
||||
|
||||
@@ -931,7 +931,6 @@
|
||||
<th>Messages Received</th>
|
||||
<th>Records Received</th>
|
||||
<th>Bytes Received</th>
|
||||
<th>Transfer Rate (B/s)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -960,7 +959,6 @@
|
||||
<td><xsl:value-of select="nmsg"/></td>
|
||||
<td><xsl:value-of select="nrecs"/></td>
|
||||
<td><xsl:value-of select="nbytes"/></td>
|
||||
<td><xsl:value-of select="rate"/></td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
|
||||
+5
-5
@@ -459,7 +459,7 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name, bdbnode_t *node) {
|
||||
|
||||
static isc_result_t
|
||||
builtin_lookup(bdb_t *bdb, const dns_name_t *name, bdbnode_t *node) {
|
||||
if (name->length == 0) {
|
||||
if (name->labels == 0 && name->length == 0) {
|
||||
return bdb->lookup(node);
|
||||
} else if ((node->bdb->implementation->flags & BDB_DNS64) != 0) {
|
||||
return dns64_cname(&bdb->common.origin, name, node);
|
||||
@@ -839,7 +839,7 @@ getoriginnode(dns_db_t *db, dns_dbnode_t **nodep DNS__DB_FLARG) {
|
||||
REQUIRE(VALID_BDB(bdb));
|
||||
REQUIRE(nodep != NULL && *nodep == NULL);
|
||||
|
||||
dns_name_init(&relname);
|
||||
dns_name_init(&relname, NULL);
|
||||
name = &relname;
|
||||
|
||||
result = createnode(bdb, &node);
|
||||
@@ -881,7 +881,7 @@ findnode(dns_db_t *db, const dns_name_t *name, bool create,
|
||||
isorigin = dns_name_equal(name, &bdb->common.origin);
|
||||
|
||||
labels = dns_name_countlabels(name) - dns_name_countlabels(&db->origin);
|
||||
dns_name_init(&relname);
|
||||
dns_name_init(&relname, NULL);
|
||||
dns_name_getlabelsequence(name, 0, labels, &relname);
|
||||
name = &relname;
|
||||
|
||||
@@ -1197,8 +1197,8 @@ create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
|
||||
|
||||
isc_refcount_init(&bdb->common.references, 1);
|
||||
isc_mem_attach(mctx, &bdb->common.mctx);
|
||||
dns_name_init(&bdb->common.origin);
|
||||
dns_name_dup(origin, mctx, &bdb->common.origin);
|
||||
dns_name_init(&bdb->common.origin, NULL);
|
||||
dns_name_dupwithoffsets(origin, mctx, &bdb->common.origin);
|
||||
|
||||
INSIST(argc >= 1);
|
||||
if (strcmp(argv[0], "authors") == 0) {
|
||||
|
||||
+35
-25
@@ -111,8 +111,6 @@ options {\n\
|
||||
session-keyname local-ddns;\n\
|
||||
startup-notify-rate 20;\n\
|
||||
sig0checks-quota 1;\n\
|
||||
sig0key-checks-limit 16;\n\
|
||||
sig0message-checks-limit 2;\n\
|
||||
statistics-file \"named.stats\";\n\
|
||||
tcp-advertised-timeout 300;\n\
|
||||
tcp-clients 150;\n\
|
||||
@@ -195,6 +193,7 @@ options {\n\
|
||||
require-server-cookie no;\n\
|
||||
root-key-sentinel yes;\n\
|
||||
servfail-ttl 1;\n\
|
||||
# sortlist <none>\n\
|
||||
stale-answer-client-timeout off;\n\
|
||||
stale-answer-enable false;\n\
|
||||
stale-answer-ttl 30; /* 30 seconds */\n\
|
||||
@@ -234,7 +233,6 @@ options {\n\
|
||||
max-transfer-time-out 120;\n\
|
||||
min-refresh-time 300;\n\
|
||||
min-retry-time 500;\n\
|
||||
min-transfer-rate-in 10240 5;\n\
|
||||
multi-master no;\n\
|
||||
notify yes;\n\
|
||||
notify-delay 5;\n\
|
||||
@@ -334,7 +332,7 @@ dnssec-policy \"insecure\" {\n\
|
||||
|
||||
"# END TRUST ANCHORS\n\
|
||||
\n\
|
||||
remote-servers " DEFAULT_IANA_ROOT_ZONE_PRIMARIES " {\n\
|
||||
primaries " DEFAULT_IANA_ROOT_ZONE_PRIMARIES " {\n\
|
||||
2801:1b8:10::b; # b.root-servers.net\n\
|
||||
2001:500:2::c; # c.root-servers.net\n\
|
||||
2001:500:2f::f; # f.root-servers.net\n\
|
||||
@@ -506,9 +504,9 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) {
|
||||
return ztype;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
named_config_getremotesdef(const cfg_obj_t *cctx, const char *list,
|
||||
const char *name, const cfg_obj_t **ret) {
|
||||
static isc_result_t
|
||||
getremotesdef(const cfg_obj_t *cctx, const char *list, const char *name,
|
||||
const cfg_obj_t **ret) {
|
||||
isc_result_t result;
|
||||
const cfg_obj_t *obj = NULL;
|
||||
const cfg_listelt_t *elt;
|
||||
@@ -535,6 +533,23 @@ named_config_getremotesdef(const cfg_obj_t *cctx, const char *list,
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
named_config_getremotesdef(const cfg_obj_t *cctx, const char *list,
|
||||
const char *name, const cfg_obj_t **ret) {
|
||||
isc_result_t result;
|
||||
|
||||
if (strcmp(list, "parental-agents") == 0) {
|
||||
return getremotesdef(cctx, list, name, ret);
|
||||
} else if (strcmp(list, "primaries") == 0) {
|
||||
result = getremotesdef(cctx, list, name, ret);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
result = getremotesdef(cctx, "masters", name, ret);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
named_config_getname(isc_mem_t *mctx, const cfg_obj_t *obj,
|
||||
dns_name_t **namep) {
|
||||
@@ -551,14 +566,14 @@ named_config_getname(isc_mem_t *mctx, const cfg_obj_t *obj,
|
||||
}
|
||||
|
||||
*namep = isc_mem_get(mctx, sizeof(**namep));
|
||||
dns_name_init(*namep);
|
||||
dns_name_init(*namep, NULL);
|
||||
|
||||
objstr = cfg_obj_asstring(obj);
|
||||
isc_buffer_constinit(&b, objstr, strlen(objstr));
|
||||
isc_buffer_add(&b, strlen(objstr));
|
||||
dns_fixedname_init(&fname);
|
||||
result = dns_name_fromtext(dns_fixedname_name(&fname), &b, dns_rootname,
|
||||
0);
|
||||
0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mem_put(mctx, *namep, sizeof(**namep));
|
||||
*namep = NULL;
|
||||
@@ -583,12 +598,10 @@ named_config_getname(isc_mem_t *mctx, const cfg_obj_t *obj,
|
||||
oldlen = newlen; \
|
||||
}
|
||||
|
||||
static const char *remotesnames[4] = { "remote-servers", "parental-agents",
|
||||
"primaries", "masters" };
|
||||
|
||||
isc_result_t
|
||||
named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
|
||||
isc_mem_t *mctx, dns_ipkeylist_t *ipkl) {
|
||||
named_config_getipandkeylist(const cfg_obj_t *config, const char *listtype,
|
||||
const cfg_obj_t *list, isc_mem_t *mctx,
|
||||
dns_ipkeylist_t *ipkl) {
|
||||
uint32_t addrcount = 0, srccount = 0;
|
||||
uint32_t keycount = 0, tlscount = 0;
|
||||
uint32_t listcount = 0, l = 0, i = 0;
|
||||
@@ -671,6 +684,8 @@ newlist:
|
||||
isc_sockaddr_any6(&src6);
|
||||
}
|
||||
|
||||
result = ISC_R_NOMEMORY;
|
||||
|
||||
element = cfg_list_first(addrlist);
|
||||
resume:
|
||||
for (; element != NULL; element = cfg_list_next(element)) {
|
||||
@@ -701,22 +716,17 @@ resume:
|
||||
continue;
|
||||
}
|
||||
list = NULL;
|
||||
tresult = ISC_R_NOTFOUND;
|
||||
for (size_t n = 0; n < ARRAY_SIZE(remotesnames); n++) {
|
||||
tresult = named_config_getremotesdef(
|
||||
config, remotesnames[n], listname,
|
||||
&list);
|
||||
if (tresult == ISC_R_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
tresult = named_config_getremotesdef(config, listtype,
|
||||
listname, &list);
|
||||
if (tresult == ISC_R_NOTFOUND) {
|
||||
cfg_obj_log(addr, ISC_LOG_ERROR,
|
||||
"remote-servers \"%s\" not found",
|
||||
"%s \"%s\" not found", listtype,
|
||||
listname);
|
||||
|
||||
result = tresult;
|
||||
goto cleanup;
|
||||
}
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
result = tresult;
|
||||
goto cleanup;
|
||||
}
|
||||
lists[l++].name = listname;
|
||||
|
||||
@@ -233,8 +233,6 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
|
||||
command_compare(command, NAMED_COMMAND_SIGN))
|
||||
{
|
||||
result = named_server_rekey(named_g_server, lex, text);
|
||||
} else if (command_compare(command, NAMED_COMMAND_MEMPROF)) {
|
||||
result = named_server_togglememprof(lex);
|
||||
} else if (command_compare(command, NAMED_COMMAND_MKEYS)) {
|
||||
result = named_server_mkeys(named_g_server, lex, text);
|
||||
} else if (command_compare(command, NAMED_COMMAND_NOTIFY)) {
|
||||
|
||||
+20
-10
@@ -31,13 +31,13 @@
|
||||
#include <isc/result.h>
|
||||
#include <isc/stdtime.h>
|
||||
#include <isc/string.h>
|
||||
#include <isc/symtab.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <isccc/alist.h>
|
||||
#include <isccc/cc.h>
|
||||
#include <isccc/ccmsg.h>
|
||||
#include <isccc/sexpr.h>
|
||||
#include <isccc/symtab.h>
|
||||
#include <isccc/util.h>
|
||||
|
||||
#include <isccfg/check.h>
|
||||
@@ -108,7 +108,7 @@ struct named_controls {
|
||||
controllistenerlist_t listeners;
|
||||
bool shuttingdown;
|
||||
isc_mutex_t symtab_lock;
|
||||
isc_symtab_t *symtab;
|
||||
isccc_symtab_t *symtab;
|
||||
};
|
||||
|
||||
static isc_result_t
|
||||
@@ -489,7 +489,7 @@ control_recvmessage(isc_nmhandle_t *handle ISC_ATTR_UNUSED, isc_result_t result,
|
||||
if ((sent + CLOCKSKEW) < conn->now ||
|
||||
(sent - CLOCKSKEW) > conn->now)
|
||||
{
|
||||
result = DNS_R_CLOCKSKEW;
|
||||
result = ISCCC_R_CLOCKSKEW;
|
||||
goto cleanup;
|
||||
}
|
||||
} else {
|
||||
@@ -503,7 +503,7 @@ control_recvmessage(isc_nmhandle_t *handle ISC_ATTR_UNUSED, isc_result_t result,
|
||||
if (isccc_cc_lookupuint32(conn->ctrl, "_exp", &exp) == ISC_R_SUCCESS &&
|
||||
conn->now > exp)
|
||||
{
|
||||
result = DNS_R_EXPIRED;
|
||||
result = ISCCC_R_EXPIRED;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -736,6 +736,7 @@ controlkeylist_fromcfg(const cfg_obj_t *keylist, isc_mem_t *mctx,
|
||||
key->secret.length = 0;
|
||||
ISC_LINK_INIT(key, link);
|
||||
ISC_LIST_APPEND(*keyids, key, link);
|
||||
newstr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -841,12 +842,15 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
|
||||
CHECK(cfg_map_get(config, "key", &key));
|
||||
|
||||
keyid = isc_mem_get(mctx, sizeof(*keyid));
|
||||
*keyid = (controlkey_t){
|
||||
.algorithm = DST_ALG_UNKNOWN,
|
||||
.link = ISC_LINK_INITIALIZER,
|
||||
};
|
||||
keyid->keyname = isc_mem_strdup(mctx,
|
||||
cfg_obj_asstring(cfg_map_getname(key)));
|
||||
keyid->secret.base = NULL;
|
||||
keyid->secret.length = 0;
|
||||
keyid->algorithm = DST_ALG_UNKNOWN;
|
||||
ISC_LINK_INIT(keyid, link);
|
||||
if (keyid->keyname == NULL) {
|
||||
CHECK(ISC_R_NOMEMORY);
|
||||
}
|
||||
|
||||
CHECK(isccfg_check_key(key));
|
||||
|
||||
@@ -1335,6 +1339,7 @@ named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
|
||||
isc_result_t
|
||||
named_controls_create(named_server_t *server, named_controls_t **ctrlsp) {
|
||||
isc_mem_t *mctx = server->mctx;
|
||||
isc_result_t result;
|
||||
named_controls_t *controls = isc_mem_get(mctx, sizeof(*controls));
|
||||
|
||||
*controls = (named_controls_t){
|
||||
@@ -1345,9 +1350,14 @@ named_controls_create(named_server_t *server, named_controls_t **ctrlsp) {
|
||||
|
||||
isc_mutex_init(&controls->symtab_lock);
|
||||
LOCK(&controls->symtab_lock);
|
||||
isccc_cc_createsymtab(mctx, &controls->symtab);
|
||||
result = isccc_cc_createsymtab(&controls->symtab);
|
||||
UNLOCK(&controls->symtab_lock);
|
||||
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mutex_destroy(&controls->symtab_lock);
|
||||
isc_mem_put(server->mctx, controls, sizeof(*controls));
|
||||
return result;
|
||||
}
|
||||
*ctrlsp = controls;
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
@@ -1361,7 +1371,7 @@ named_controls_destroy(named_controls_t **ctrlsp) {
|
||||
REQUIRE(ISC_LIST_EMPTY(controls->listeners));
|
||||
|
||||
LOCK(&controls->symtab_lock);
|
||||
isc_symtab_destroy(&controls->symtab);
|
||||
isccc_symtab_destroy(&controls->symtab);
|
||||
UNLOCK(&controls->symtab_lock);
|
||||
isc_mutex_destroy(&controls->symtab_lock);
|
||||
isc_mem_put(controls->server->mctx, controls, sizeof(*controls));
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <isc/condition.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/mutex.h>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <isc/lang.h>
|
||||
#include <isc/types.h>
|
||||
|
||||
#include <dns/clientinfo.h>
|
||||
|
||||
@@ -57,8 +57,9 @@ named_config_getremotesdef(const cfg_obj_t *cctx, const char *list,
|
||||
const char *name, const cfg_obj_t **ret);
|
||||
|
||||
isc_result_t
|
||||
named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
|
||||
isc_mem_t *mctx, dns_ipkeylist_t *ipkl);
|
||||
named_config_getipandkeylist(const cfg_obj_t *config, const char *listtype,
|
||||
const cfg_obj_t *list, isc_mem_t *mctx,
|
||||
dns_ipkeylist_t *ipkl);
|
||||
|
||||
isc_result_t
|
||||
named_config_getport(const cfg_obj_t *config, const char *type,
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#define NAMED_COMMAND_FREEZE "freeze"
|
||||
#define NAMED_COMMAND_HALT "halt"
|
||||
#define NAMED_COMMAND_LOADKEYS "loadkeys"
|
||||
#define NAMED_COMMAND_MEMPROF "memprof"
|
||||
#define NAMED_COMMAND_MKEYS "managed-keys"
|
||||
#define NAMED_COMMAND_MODZONE "modzone"
|
||||
#define NAMED_COMMAND_NOTIFY "notify"
|
||||
|
||||
@@ -86,6 +86,7 @@ EXTERN named_server_t *named_g_server INIT(NULL);
|
||||
/*
|
||||
* Logging.
|
||||
*/
|
||||
EXTERN bool named_g_logging INIT(false);
|
||||
EXTERN unsigned int named_g_debuglevel INIT(0);
|
||||
|
||||
/*
|
||||
|
||||
@@ -388,15 +388,3 @@ named_server_fetchlimit(named_server_t *server, isc_lex_t *lex,
|
||||
*/
|
||||
isc_result_t
|
||||
named_server_skr(named_server_t *server, isc_lex_t *lex, isc_buffer_t **text);
|
||||
|
||||
/*%
|
||||
* Toggle memory profiling if supported.
|
||||
*/
|
||||
isc_result_t
|
||||
named_server_togglememprof(isc_lex_t *lex);
|
||||
|
||||
/*%
|
||||
* Get status of memory profiling.
|
||||
*/
|
||||
const char *
|
||||
named_server_getmemprof(void);
|
||||
|
||||
@@ -15,10 +15,13 @@
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <isc/lang.h>
|
||||
#include <isc/types.h>
|
||||
|
||||
#include <isccfg/cfg.h>
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
isc_result_t
|
||||
named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
|
||||
dns_tkeyctx_t **tctxp);
|
||||
@@ -34,5 +37,7 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
|
||||
*
|
||||
* Returns:
|
||||
*\li ISC_R_SUCCESS
|
||||
*\li return codes from dns_name_fromtext()
|
||||
*\li ISC_R_NOMEMORY
|
||||
*/
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -15,12 +15,15 @@
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <isc/lang.h>
|
||||
#include <isc/types.h>
|
||||
|
||||
#include <dns/transport.h>
|
||||
|
||||
#include <isccfg/cfg.h>
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
isc_result_t
|
||||
named_transports_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
isc_mem_t *mctx, dns_transport_list_t **listp);
|
||||
@@ -36,3 +39,5 @@ named_transports_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
* \li 'listp' is not NULL, and '*listp' is NULL
|
||||
*
|
||||
*/
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -15,8 +15,11 @@
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <isc/lang.h>
|
||||
#include <isc/types.h>
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
isc_result_t
|
||||
named_tsigkeyring_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
isc_mem_t *mctx, dns_tsigkeyring_t **ringp);
|
||||
@@ -32,6 +35,7 @@ named_tsigkeyring_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
*
|
||||
* Returns:
|
||||
* \li ISC_R_SUCCESS
|
||||
* \li DNS_R_BADALG
|
||||
* \li return codes from dns_name_fromtext()
|
||||
* \li ISC_R_NOMEMORY
|
||||
*/
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -17,11 +17,14 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/lang.h>
|
||||
#include <isc/types.h>
|
||||
|
||||
#include <isccfg/aclconf.h>
|
||||
#include <isccfg/cfg.h>
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
isc_result_t
|
||||
named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
const cfg_obj_t *zconfig, cfg_aclconfctx_t *ac,
|
||||
@@ -73,3 +76,5 @@ named_zone_configure_writeable_dlz(dns_dlzdb_t *dlzdatabase, dns_zone_t *zone,
|
||||
* \li 'rdclass' to be a valid rdataclass
|
||||
* \li 'name' to be a valid zone origin name
|
||||
*/
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -52,6 +52,8 @@ named_log_init(bool safe) {
|
||||
named_log_setdefaultsslkeylogfile(lcfg);
|
||||
rcu_read_unlock();
|
||||
|
||||
named_g_logging = true;
|
||||
|
||||
return ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
|
||||
+119
-47
@@ -30,9 +30,9 @@
|
||||
#include <isc/crypto.h>
|
||||
#include <isc/dir.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/fips.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/httpd.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/managers.h>
|
||||
#include <isc/netmgr.h>
|
||||
#include <isc/os.h>
|
||||
@@ -47,7 +47,6 @@
|
||||
|
||||
#include <dns/dispatch.h>
|
||||
#include <dns/dyndb.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/resolver.h>
|
||||
#include <dns/view.h>
|
||||
@@ -90,6 +89,10 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/opensslv.h>
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/provider.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBXML2
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xmlversion.h>
|
||||
@@ -129,7 +132,6 @@ static int maxudp = 0;
|
||||
/*
|
||||
* -T options:
|
||||
*/
|
||||
static bool cookiealwaysvalid = false;
|
||||
static bool dropedns = false;
|
||||
static bool ednsformerr = false;
|
||||
static bool ednsnotimp = false;
|
||||
@@ -151,13 +153,24 @@ static bool transferstuck = false;
|
||||
static bool disable6 = false;
|
||||
static bool disable4 = false;
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
static OSSL_PROVIDER *fips = NULL, *base = NULL;
|
||||
#endif
|
||||
|
||||
void
|
||||
named_main_earlywarning(const char *format, ...) {
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_WARNING, format, args);
|
||||
if (named_g_logging) {
|
||||
isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_WARNING, format, args);
|
||||
} else {
|
||||
fprintf(stderr, "%s: ", program_name);
|
||||
vfprintf(stderr, format, args);
|
||||
fprintf(stderr, "\n");
|
||||
fflush(stderr);
|
||||
}
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
@@ -166,10 +179,18 @@ named_main_earlyfatal(const char *format, ...) {
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL, format, args);
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL, "exiting (due to early fatal error)");
|
||||
if (named_g_logging) {
|
||||
isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL, format, args);
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL,
|
||||
"exiting (due to early fatal error)");
|
||||
} else {
|
||||
fprintf(stderr, "%s: ", program_name);
|
||||
vfprintf(stderr, format, args);
|
||||
fprintf(stderr, "\n");
|
||||
fflush(stderr);
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
_exit(EXIT_FAILURE);
|
||||
@@ -186,19 +207,26 @@ assertion_failed(const char *file, int line, isc_assertiontype_t type,
|
||||
* Handle assertion failures.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Reset the assertion callback in case it is the log
|
||||
* routines causing the assertion.
|
||||
*/
|
||||
isc_assertion_setcallback(NULL);
|
||||
if (named_g_logging) {
|
||||
/*
|
||||
* Reset the assertion callback in case it is the log
|
||||
* routines causing the assertion.
|
||||
*/
|
||||
isc_assertion_setcallback(NULL);
|
||||
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL, "%s:%d: %s(%s) failed", file, line,
|
||||
isc_assertion_typetotext(type), cond);
|
||||
isc_backtrace_log(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL);
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL, "exiting (due to assertion failure)");
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL, "%s:%d: %s(%s) failed", file,
|
||||
line, isc_assertion_typetotext(type), cond);
|
||||
isc_backtrace_log(NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL);
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL,
|
||||
"exiting (due to assertion failure)");
|
||||
} else {
|
||||
fprintf(stderr, "%s:%d: %s(%s) failed\n", file, line,
|
||||
isc_assertion_typetotext(type), cond);
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
if (named_g_coreok) {
|
||||
abort();
|
||||
@@ -217,20 +245,27 @@ library_fatal_error(const char *file, int line, const char *func,
|
||||
* Handle isc_error_fatal() calls from our libraries.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Reset the error callback in case it is the log
|
||||
* routines causing the assertion.
|
||||
*/
|
||||
isc_error_setfatal(NULL);
|
||||
if (named_g_logging) {
|
||||
/*
|
||||
* Reset the error callback in case it is the log
|
||||
* routines causing the assertion.
|
||||
*/
|
||||
isc_error_setfatal(NULL);
|
||||
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL, "%s:%d:%s(): fatal error: ", file, line,
|
||||
func);
|
||||
isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL, format, args);
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL,
|
||||
"exiting (due to fatal error in library)");
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL,
|
||||
"%s:%d:%s(): fatal error: ", file, line, func);
|
||||
isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL, format, args);
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL,
|
||||
"exiting (due to fatal error in library)");
|
||||
} else {
|
||||
fprintf(stderr, "%s:%d:%s(): fatal error: ", file, line, func);
|
||||
vfprintf(stderr, format, args);
|
||||
fprintf(stderr, "\n");
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
if (named_g_coreok) {
|
||||
abort();
|
||||
@@ -250,11 +285,19 @@ library_unexpected_error(const char *file, int line, const char *func,
|
||||
* Handle isc_error_unexpected() calls from our libraries.
|
||||
*/
|
||||
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_ERROR, "%s:%d:%s(): unexpected error: ", file,
|
||||
line, func);
|
||||
isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_ERROR, format, args);
|
||||
if (named_g_logging) {
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_ERROR,
|
||||
"%s:%d:%s(): unexpected error: ", file, line,
|
||||
func);
|
||||
isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_ERROR, format, args);
|
||||
} else {
|
||||
fprintf(stderr, "%s:%d:%s(): fatal error: ", file, line, func);
|
||||
vfprintf(stderr, format, args);
|
||||
fprintf(stderr, "\n");
|
||||
fflush(stderr);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -653,9 +696,7 @@ parse_T_opt(char *option) {
|
||||
* force the server to behave (or misbehave) in
|
||||
* specified ways for testing purposes.
|
||||
*/
|
||||
if (!strcmp(option, "cookiealwaysvalid")) {
|
||||
cookiealwaysvalid = true;
|
||||
} else if (!strcmp(option, "dropedns")) {
|
||||
if (!strcmp(option, "dropedns")) {
|
||||
dropedns = true;
|
||||
} else if (!strcmp(option, "ednsformerr")) {
|
||||
ednsformerr = true;
|
||||
@@ -909,7 +950,25 @@ parse_command_line(int argc, char *argv[]) {
|
||||
named_main_earlyfatal("option '-X' has been removed");
|
||||
break;
|
||||
case 'F':
|
||||
if (isc_crypto_fips_enable() != ISC_R_SUCCESS) {
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
fips = OSSL_PROVIDER_load(NULL, "fips");
|
||||
if (fips == NULL) {
|
||||
ERR_clear_error();
|
||||
named_main_earlyfatal(
|
||||
"Failed to load FIPS provider");
|
||||
}
|
||||
base = OSSL_PROVIDER_load(NULL, "base");
|
||||
if (base == NULL) {
|
||||
OSSL_PROVIDER_unload(fips);
|
||||
ERR_clear_error();
|
||||
named_main_earlyfatal(
|
||||
"Failed to load base provider");
|
||||
}
|
||||
#endif
|
||||
if (isc_fips_mode()) { /* Already in FIPS mode. */
|
||||
break;
|
||||
}
|
||||
if (isc_fips_set_mode(1) != ISC_R_SUCCESS) {
|
||||
named_main_earlyfatal(
|
||||
"setting FIPS mode failed");
|
||||
}
|
||||
@@ -1223,9 +1282,6 @@ setup(void) {
|
||||
/*
|
||||
* Modify server context according to command line options
|
||||
*/
|
||||
if (cookiealwaysvalid) {
|
||||
ns_server_setoption(sctx, NS_SERVER_COOKIEALWAYSVALID, true);
|
||||
}
|
||||
if (disable4) {
|
||||
ns_server_setoption(sctx, NS_SERVER_DISABLE4, true);
|
||||
}
|
||||
@@ -1358,7 +1414,14 @@ named_smf_get_instance(char **ins_name, int debug, isc_mem_t *mctx) {
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
instance = isc_mem_allocate(mctx, namelen + 1);
|
||||
if ((instance = isc_mem_allocate(mctx, namelen + 1)) == NULL) {
|
||||
UNEXPECTED_ERROR("named_smf_get_instance memory "
|
||||
"allocation failed: %s",
|
||||
isc_result_totext(ISC_R_NOMEMORY));
|
||||
scf_handle_destroy(h);
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
if (scf_myname(h, instance, namelen + 1) == -1) {
|
||||
if (debug) {
|
||||
UNEXPECTED_ERROR("scf_myname() failed: %s",
|
||||
@@ -1516,6 +1579,15 @@ main(int argc, char *argv[]) {
|
||||
|
||||
named_os_shutdown();
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
if (base != NULL) {
|
||||
OSSL_PROVIDER_unload(base);
|
||||
}
|
||||
if (fips != NULL) {
|
||||
OSSL_PROVIDER_unload(fips);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GPERFTOOLS_PROFILER
|
||||
ProfilerStop();
|
||||
#endif /* ifdef HAVE_GPERFTOOLS_PROFILER */
|
||||
|
||||
+163
-271
@@ -38,6 +38,7 @@
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/dir.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/fips.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/hex.h>
|
||||
#include <isc/hmac.h>
|
||||
@@ -139,15 +140,6 @@
|
||||
#include <named/smf_globals.h>
|
||||
#endif /* ifdef HAVE_LIBSCF */
|
||||
|
||||
/* On DragonFly BSD the header does not provide jemalloc API */
|
||||
#if defined(HAVE_MALLOC_NP_H) && !defined(__DragonFly__)
|
||||
#include <malloc_np.h>
|
||||
#define JEMALLOC_API_SUPPORTED 1
|
||||
#elif defined(HAVE_JEMALLOC)
|
||||
#include <jemalloc/jemalloc.h>
|
||||
#define JEMALLOC_API_SUPPORTED 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LMDB
|
||||
#include <lmdb.h>
|
||||
#define configure_newzones configure_newzones_db
|
||||
@@ -366,22 +358,6 @@ typedef struct {
|
||||
isc_result_t result;
|
||||
} ns_dzarg_t;
|
||||
|
||||
typedef enum {
|
||||
MEMPROF_UNSUPPORTED = 0x00,
|
||||
MEMPROF_INACTIVE = 0x01,
|
||||
MEMPROF_FAILING = 0x02,
|
||||
MEMPROF_OFF = 0x03,
|
||||
MEMPROF_ON = 0x04,
|
||||
} memprof_status;
|
||||
|
||||
static const char *memprof_status_text[] = {
|
||||
[MEMPROF_UNSUPPORTED] = "UNSUPPORTED",
|
||||
[MEMPROF_INACTIVE] = "INACTIVE",
|
||||
[MEMPROF_FAILING] = "FAILING",
|
||||
[MEMPROF_OFF] = "OFF",
|
||||
[MEMPROF_ON] = "ON",
|
||||
};
|
||||
|
||||
/*
|
||||
* These zones should not leak onto the Internet.
|
||||
*/
|
||||
@@ -608,6 +584,51 @@ configure_view_acl(const cfg_obj_t *vconfig, const cfg_obj_t *config,
|
||||
return result;
|
||||
}
|
||||
|
||||
/*%
|
||||
* Configure a sortlist at '*aclp'. Essentially the same as
|
||||
* configure_view_acl() except it calls cfg_acl_fromconfig with a
|
||||
* nest_level value of 2.
|
||||
*/
|
||||
static isc_result_t
|
||||
configure_view_sortlist(const cfg_obj_t *vconfig, const cfg_obj_t *config,
|
||||
cfg_aclconfctx_t *actx, isc_mem_t *mctx,
|
||||
dns_acl_t **aclp) {
|
||||
isc_result_t result;
|
||||
const cfg_obj_t *maps[3];
|
||||
const cfg_obj_t *aclobj = NULL;
|
||||
int i = 0;
|
||||
|
||||
if (*aclp != NULL) {
|
||||
dns_acl_detach(aclp);
|
||||
}
|
||||
if (vconfig != NULL) {
|
||||
maps[i++] = cfg_tuple_get(vconfig, "options");
|
||||
}
|
||||
if (config != NULL) {
|
||||
const cfg_obj_t *options = NULL;
|
||||
(void)cfg_map_get(config, "options", &options);
|
||||
if (options != NULL) {
|
||||
maps[i++] = options;
|
||||
}
|
||||
}
|
||||
maps[i] = NULL;
|
||||
|
||||
(void)named_config_get(maps, "sortlist", &aclobj);
|
||||
if (aclobj == NULL) {
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Use a nest level of 3 for the "top level" of the sortlist;
|
||||
* this means each entry in the top three levels will be stored
|
||||
* as lists of separate, nested ACLs, rather than merged together
|
||||
* into IP tables as is usually done with ACLs.
|
||||
*/
|
||||
result = cfg_acl_fromconfig(aclobj, config, actx, mctx, 3, aclp);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
configure_view_nametable(const cfg_obj_t *vconfig, const cfg_obj_t *config,
|
||||
const char *confname, const char *conftuplename,
|
||||
@@ -663,7 +684,7 @@ configure_view_nametable(const cfg_obj_t *vconfig, const cfg_obj_t *config,
|
||||
str = cfg_obj_asstring(nameobj);
|
||||
isc_buffer_constinit(&b, str, strlen(str));
|
||||
isc_buffer_add(&b, strlen(str));
|
||||
CHECK(dns_name_fromtext(name, &b, dns_rootname, 0));
|
||||
CHECK(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
|
||||
result = dns_nametree_add(*ntp, name, true);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(nameobj, ISC_LOG_ERROR,
|
||||
@@ -723,7 +744,7 @@ ta_fromconfig(const cfg_obj_t *key, bool *initialp, const char **namestrp,
|
||||
name = dns_fixedname_initname(&fname);
|
||||
isc_buffer_constinit(&namebuf, namestr, strlen(namestr));
|
||||
isc_buffer_add(&namebuf, strlen(namestr));
|
||||
CHECK(dns_name_fromtext(name, &namebuf, dns_rootname, 0));
|
||||
CHECK(dns_name_fromtext(name, &namebuf, dns_rootname, 0, NULL));
|
||||
|
||||
if (*initialp) {
|
||||
atstr = cfg_obj_asstring(cfg_tuple_get(key, "anchortype"));
|
||||
@@ -912,7 +933,7 @@ process_key(const cfg_obj_t *key, dns_keytable_t *secroots,
|
||||
isc_buffer_constinit(&b, namestr, strlen(namestr));
|
||||
isc_buffer_add(&b, strlen(namestr));
|
||||
keyname = dns_fixedname_initname(&fkeyname);
|
||||
result = dns_name_fromtext(keyname, &b, dns_rootname, 0);
|
||||
result = dns_name_fromtext(keyname, &b, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
@@ -928,6 +949,15 @@ process_key(const cfg_obj_t *key, dns_keytable_t *secroots,
|
||||
initializing ? "initial-key" : "static-key",
|
||||
namestr, isc_result_totext(result));
|
||||
return ISC_R_SUCCESS;
|
||||
case DST_R_NOCRYPTO:
|
||||
/*
|
||||
* Crypto support is not available.
|
||||
*/
|
||||
cfg_obj_log(key, ISC_LOG_ERROR,
|
||||
"ignoring %s for '%s': no crypto support",
|
||||
initializing ? "initial-key" : "static-key",
|
||||
namestr);
|
||||
return result;
|
||||
default:
|
||||
/*
|
||||
* Something unexpected happened; we have no choice but to
|
||||
@@ -1009,6 +1039,9 @@ cleanup:
|
||||
if (secroots != NULL) {
|
||||
dns_keytable_detach(&secroots);
|
||||
}
|
||||
if (result == DST_R_NOCRYPTO) {
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1305,7 +1338,7 @@ configure_order(dns_order_t *order, const cfg_obj_t *ent) {
|
||||
isc_buffer_add(&b, strlen(str));
|
||||
dns_fixedname_init(&fixed);
|
||||
result = dns_name_fromtext(dns_fixedname_name(&fixed), &b, dns_rootname,
|
||||
0);
|
||||
0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
@@ -1329,12 +1362,15 @@ configure_order(dns_order_t *order, const cfg_obj_t *ent) {
|
||||
* explicit entry for "." when the name is "*".
|
||||
*/
|
||||
if (addroot) {
|
||||
dns_order_add(order, dns_rootname, rdtype, rdclass, mode);
|
||||
result = dns_order_add(order, dns_rootname, rdtype, rdclass,
|
||||
mode);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
dns_order_add(order, dns_fixedname_name(&fixed), rdtype, rdclass, mode);
|
||||
|
||||
return ISC_R_SUCCESS;
|
||||
return dns_order_add(order, dns_fixedname_name(&fixed), rdtype, rdclass,
|
||||
mode);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
@@ -1590,7 +1626,7 @@ disable_algorithms(const cfg_obj_t *disabled, dns_resolver_t *resolver) {
|
||||
str = cfg_obj_asstring(cfg_tuple_get(disabled, "name"));
|
||||
isc_buffer_constinit(&b, str, strlen(str));
|
||||
isc_buffer_add(&b, strlen(str));
|
||||
CHECK(dns_name_fromtext(name, &b, dns_rootname, 0));
|
||||
CHECK(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
|
||||
|
||||
algorithms = cfg_tuple_get(disabled, "algorithms");
|
||||
for (element = cfg_list_first(algorithms); element != NULL;
|
||||
@@ -1633,7 +1669,7 @@ disable_ds_digests(const cfg_obj_t *disabled, dns_resolver_t *resolver) {
|
||||
str = cfg_obj_asstring(cfg_tuple_get(disabled, "name"));
|
||||
isc_buffer_constinit(&b, str, strlen(str));
|
||||
isc_buffer_add(&b, strlen(str));
|
||||
CHECK(dns_name_fromtext(name, &b, dns_rootname, 0));
|
||||
CHECK(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
|
||||
|
||||
digests = cfg_tuple_get(disabled, "digests");
|
||||
for (element = cfg_list_first(digests); element != NULL;
|
||||
@@ -1677,7 +1713,7 @@ on_disable_list(const cfg_obj_t *disablelist, dns_name_t *zonename) {
|
||||
str = cfg_obj_asstring(value);
|
||||
isc_buffer_constinit(&b, str, strlen(str));
|
||||
isc_buffer_add(&b, strlen(str));
|
||||
result = dns_name_fromtext(name, &b, dns_rootname, 0);
|
||||
result = dns_name_fromtext(name, &b, dns_rootname, 0, NULL);
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
if (dns_name_equal(name, zonename)) {
|
||||
return true;
|
||||
@@ -1693,7 +1729,7 @@ check_dbtype(dns_zone_t *zone, unsigned int dbtypec, const char **dbargv,
|
||||
unsigned int i;
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
|
||||
dns_zone_getdbtype(zone, &argv, mctx);
|
||||
CHECK(dns_zone_getdbtype(zone, &argv, mctx));
|
||||
|
||||
/*
|
||||
* Check that all the arguments match.
|
||||
@@ -1860,9 +1896,9 @@ dns64_reverse(dns_view_t *view, isc_mem_t *mctx, isc_netaddr_t *na,
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
isc_buffer_constinit(&b, reverse, strlen(reverse));
|
||||
isc_buffer_add(&b, strlen(reverse));
|
||||
CHECK(dns_name_fromtext(name, &b, dns_rootname, 0));
|
||||
CHECK(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
|
||||
dns_zone_create(&zone, mctx, 0);
|
||||
dns_zone_setorigin(zone, name);
|
||||
CHECK(dns_zone_setorigin(zone, name));
|
||||
dns_zone_setview(zone, view);
|
||||
CHECK(dns_zonemgr_managezone(named_g_server->zonemgr, zone));
|
||||
dns_zone_setclass(zone, view->rdclass);
|
||||
@@ -2744,7 +2780,7 @@ configure_catz_zone(dns_view_t *view, dns_view_t *pview,
|
||||
dns_name_t origin;
|
||||
dns_catz_options_t *opts;
|
||||
|
||||
dns_name_init(&origin);
|
||||
dns_name_init(&origin, NULL);
|
||||
catz_obj = cfg_listelt_value(element);
|
||||
|
||||
str = cfg_obj_asstring(cfg_tuple_get(catz_obj, "zone name"));
|
||||
@@ -2788,8 +2824,8 @@ configure_catz_zone(dns_view_t *view, dns_view_t *pview,
|
||||
obj = cfg_tuple_get(catz_obj, "default-primaries");
|
||||
}
|
||||
if (obj != NULL && cfg_obj_istuple(obj)) {
|
||||
result = named_config_getipandkeylist(config, obj, view->mctx,
|
||||
&opts->masters);
|
||||
result = named_config_getipandkeylist(
|
||||
config, "primaries", obj, view->mctx, &opts->masters);
|
||||
}
|
||||
|
||||
obj = cfg_tuple_get(catz_obj, "in-memory");
|
||||
@@ -3087,7 +3123,7 @@ add_ns(dns_db_t *db, dns_dbversion_t *version, const dns_name_t *name,
|
||||
ns.common.rdtype = dns_rdatatype_ns;
|
||||
ns.common.rdclass = dns_db_class(db);
|
||||
ns.mctx = NULL;
|
||||
dns_name_init(&ns.name);
|
||||
dns_name_init(&ns.name, NULL);
|
||||
dns_name_clone(nsname, &ns.name);
|
||||
CHECK(dns_rdata_fromstruct(&rdata, dns_db_class(db), dns_rdatatype_ns,
|
||||
&ns, &b));
|
||||
@@ -3232,7 +3268,7 @@ create_empty_zone(dns_zone_t *pzone, dns_name_t *name, dns_view_t *view,
|
||||
|
||||
if (pzone == NULL) {
|
||||
CHECK(dns_zonemgr_createzone(named_g_server->zonemgr, &zone));
|
||||
dns_zone_setorigin(zone, name);
|
||||
CHECK(dns_zone_setorigin(zone, name));
|
||||
CHECK(dns_zonemgr_managezone(named_g_server->zonemgr, zone));
|
||||
if (db == NULL) {
|
||||
dns_zone_setdbtype(zone, empty_dbtypec, empty_dbtype);
|
||||
@@ -3339,7 +3375,7 @@ create_ipv4only_zone(dns_zone_t *pzone, dns_view_t *view,
|
||||
* Create the actual zone.
|
||||
*/
|
||||
dns_zone_create(&zone, mctx, 0);
|
||||
dns_zone_setorigin(zone, name);
|
||||
CHECK(dns_zone_setorigin(zone, name));
|
||||
CHECK(dns_zonemgr_managezone(named_g_server->zonemgr, zone));
|
||||
dns_zone_setclass(zone, view->rdclass);
|
||||
dns_zone_settype(zone, dns_zone_primary);
|
||||
@@ -3762,7 +3798,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
||||
uint32_t maxbits;
|
||||
unsigned int resopts = 0;
|
||||
dns_zone_t *zone = NULL;
|
||||
uint32_t clients_per_query, max_clients_per_query;
|
||||
uint32_t max_clients_per_query;
|
||||
bool empty_zones_enable;
|
||||
const cfg_obj_t *disablelist = NULL;
|
||||
isc_stats_t *resstats = NULL;
|
||||
@@ -3922,6 +3958,11 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
||||
const cfg_obj_t *name, *search = NULL;
|
||||
char *s = isc_mem_strdup(mctx, cfg_obj_asstring(obj));
|
||||
|
||||
if (s == NULL) {
|
||||
result = ISC_R_NOMEMORY;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
result = isc_commandline_strtoargv(mctx, s, &dlzargc,
|
||||
&dlzargv, 0);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
@@ -4151,9 +4192,12 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
||||
dns64options |= DNS_DNS64_BREAK_DNSSEC;
|
||||
}
|
||||
|
||||
dns_dns64_create(mctx, &na, prefixlen, sp, clients,
|
||||
mapped, excluded, dns64options,
|
||||
&dns64);
|
||||
result = dns_dns64_create(mctx, &na, prefixlen, sp,
|
||||
clients, mapped, excluded,
|
||||
dns64options, &dns64);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup;
|
||||
}
|
||||
dns_dns64_append(&view->dns64, dns64);
|
||||
view->dns64cnt++;
|
||||
result = dns64_reverse(view, mctx, &na, prefixlen,
|
||||
@@ -4702,19 +4746,6 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
||||
dns_view_settransports(view, transports);
|
||||
dns_transport_list_detach(&transports);
|
||||
|
||||
/*
|
||||
* Configure SIG(0) check limits when matching a DNS message to a view.
|
||||
*/
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "sig0key-checks-limit", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
view->sig0key_checks_limit = cfg_obj_asuint32(obj);
|
||||
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "sig0message-checks-limit", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
view->sig0message_checks_limit = cfg_obj_asuint32(obj);
|
||||
|
||||
/*
|
||||
* Configure the view's TSIG keys.
|
||||
*/
|
||||
@@ -4762,7 +4793,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
||||
dns_peerlist_t *newpeers = NULL;
|
||||
|
||||
(void)named_config_get(cfgmaps, "server", &peers);
|
||||
dns_peerlist_new(mctx, &newpeers);
|
||||
CHECK(dns_peerlist_new(mctx, &newpeers));
|
||||
for (element = cfg_list_first(peers); element != NULL;
|
||||
element = cfg_list_next(element))
|
||||
{
|
||||
@@ -4784,7 +4815,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
||||
const cfg_obj_t *rrsetorder = NULL;
|
||||
|
||||
(void)named_config_get(maps, "rrset-order", &rrsetorder);
|
||||
dns_order_create(mctx, &order);
|
||||
CHECK(dns_order_create(mctx, &order));
|
||||
for (element = cfg_list_first(rrsetorder); element != NULL;
|
||||
element = cfg_list_next(element))
|
||||
{
|
||||
@@ -5090,6 +5121,12 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
||||
"except-from", named_g_mctx,
|
||||
&view->answernames_exclude));
|
||||
|
||||
/*
|
||||
* Configure sortlist, if set
|
||||
*/
|
||||
CHECK(configure_view_sortlist(vconfig, config, actx, named_g_mctx,
|
||||
&view->sortlist));
|
||||
|
||||
/*
|
||||
* Configure default allow-update and allow-update-forwarding ACLs,
|
||||
* so they can be inherited by zones. (XXX: These are not
|
||||
@@ -5168,26 +5205,15 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
view->v6bias = cfg_obj_asuint32(obj) * 1000;
|
||||
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "clients-per-query", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
clients_per_query = cfg_obj_asuint32(obj);
|
||||
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "max-clients-per-query", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
max_clients_per_query = cfg_obj_asuint32(obj);
|
||||
|
||||
if (max_clients_per_query < clients_per_query) {
|
||||
cfg_obj_log(obj, ISC_LOG_WARNING,
|
||||
"configured clients-per-query (%u) exceeds "
|
||||
"max-clients-per-query (%u); automatically "
|
||||
"adjusting max-clients-per-query to (%u)",
|
||||
clients_per_query, max_clients_per_query,
|
||||
clients_per_query);
|
||||
max_clients_per_query = clients_per_query;
|
||||
}
|
||||
dns_resolver_setclientsperquery(view->resolver, clients_per_query,
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "clients-per-query", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
dns_resolver_setclientsperquery(view->resolver, cfg_obj_asuint32(obj),
|
||||
max_clients_per_query);
|
||||
|
||||
/*
|
||||
@@ -5341,9 +5367,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
||||
|
||||
if (dctx == NULL) {
|
||||
const void *hashinit = isc_hash_get_initializer();
|
||||
dns_dyndb_createctx(mctx, hashinit, view,
|
||||
named_g_server->zonemgr,
|
||||
named_g_loopmgr, &dctx);
|
||||
CHECK(dns_dyndb_createctx(mctx, hashinit, view,
|
||||
named_g_server->zonemgr,
|
||||
named_g_loopmgr, &dctx));
|
||||
}
|
||||
|
||||
CHECK(configure_dyndb(dyndb, mctx, dctx));
|
||||
@@ -5886,8 +5912,8 @@ configure_alternates(const cfg_obj_t *config, dns_view_t *view,
|
||||
isc_buffer_constinit(&buffer, str, strlen(str));
|
||||
isc_buffer_add(&buffer, strlen(str));
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
CHECK(dns_name_fromtext(name, &buffer, dns_rootname,
|
||||
0));
|
||||
CHECK(dns_name_fromtext(name, &buffer, dns_rootname, 0,
|
||||
NULL));
|
||||
|
||||
portobj = cfg_tuple_get(alternate, "port");
|
||||
if (cfg_obj_isuint32(portobj)) {
|
||||
@@ -5942,7 +5968,7 @@ validate_tls(const cfg_obj_t *config, dns_view_t *view, const cfg_obj_t *obj,
|
||||
|
||||
if (name != NULL && *name == NULL) {
|
||||
*name = isc_mem_get(view->mctx, sizeof(dns_name_t));
|
||||
dns_name_init(*name);
|
||||
dns_name_init(*name, NULL);
|
||||
dns_name_dup(nm, view->mctx, *name);
|
||||
}
|
||||
|
||||
@@ -6185,8 +6211,12 @@ create_view(const cfg_obj_t *vconfig, dns_viewlist_t *viewlist,
|
||||
}
|
||||
INSIST(view == NULL);
|
||||
|
||||
dns_view_create(named_g_mctx, named_g_loopmgr, named_g_dispatchmgr,
|
||||
viewclass, viewname, &view);
|
||||
result = dns_view_create(named_g_mctx, named_g_loopmgr,
|
||||
named_g_dispatchmgr, viewclass, viewname,
|
||||
&view);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_nonce_buf(view->secret, sizeof(view->secret));
|
||||
|
||||
@@ -6242,7 +6272,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
|
||||
isc_buffer_add(&buffer, strlen(zname));
|
||||
dns_fixedname_init(&fixorigin);
|
||||
CHECK(dns_name_fromtext(dns_fixedname_name(&fixorigin), &buffer,
|
||||
dns_rootname, 0));
|
||||
dns_rootname, 0, NULL));
|
||||
origin = dns_fixedname_name(&fixorigin);
|
||||
|
||||
CHECK(named_config_getclass(cfg_tuple_get(zconfig, "class"),
|
||||
@@ -6390,7 +6420,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
|
||||
} else {
|
||||
CHECK(dns_zonemgr_createzone(named_g_server->zonemgr,
|
||||
&zone));
|
||||
dns_zone_setorigin(zone, origin);
|
||||
CHECK(dns_zone_setorigin(zone, origin));
|
||||
dns_zone_setview(zone, view);
|
||||
CHECK(dns_zonemgr_managezone(named_g_server->zonemgr,
|
||||
zone));
|
||||
@@ -6493,7 +6523,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
|
||||
* to create a new one.
|
||||
*/
|
||||
CHECK(dns_zonemgr_createzone(named_g_server->zonemgr, &zone));
|
||||
dns_zone_setorigin(zone, origin);
|
||||
CHECK(dns_zone_setorigin(zone, origin));
|
||||
dns_zone_setview(zone, view);
|
||||
CHECK(dns_zonemgr_managezone(named_g_server->zonemgr, zone));
|
||||
dns_zone_setstats(zone, named_g_server->zonestats);
|
||||
@@ -6551,7 +6581,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
|
||||
if (raw == NULL) {
|
||||
dns_zone_create(&raw, dns_zone_getmem(zone),
|
||||
dns_zone_gettid(zone));
|
||||
dns_zone_setorigin(raw, origin);
|
||||
CHECK(dns_zone_setorigin(raw, origin));
|
||||
dns_zone_setview(raw, view);
|
||||
dns_zone_setstats(raw, named_g_server->zonestats);
|
||||
CHECK(dns_zone_link(zone, raw));
|
||||
@@ -6652,14 +6682,14 @@ add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx) {
|
||||
|
||||
/* No existing keydata zone was found; create one */
|
||||
CHECK(dns_zonemgr_createzone(named_g_server->zonemgr, &zone));
|
||||
dns_zone_setorigin(zone, dns_rootname);
|
||||
CHECK(dns_zone_setorigin(zone, dns_rootname));
|
||||
|
||||
defaultview = (strcmp(view->name, "_default") == 0);
|
||||
CHECK(isc_file_sanitize(
|
||||
directory, defaultview ? "managed-keys" : view->name,
|
||||
defaultview ? "bind" : "mkeys", filename, sizeof(filename)));
|
||||
dns_zone_setfile(zone, filename, dns_masterformat_text,
|
||||
&dns_master_style_default);
|
||||
CHECK(dns_zone_setfile(zone, filename, dns_masterformat_text,
|
||||
&dns_master_style_default));
|
||||
|
||||
dns_zone_setview(zone, view);
|
||||
dns_zone_settype(zone, dns_zone_key);
|
||||
@@ -6959,7 +6989,7 @@ tat_send(void *arg) {
|
||||
result = dns_resolver_createfetch(
|
||||
tat->view->resolver, tatname, dns_rdatatype_null,
|
||||
domain, &nameservers, NULL, NULL, 0, 0, 0, NULL, NULL,
|
||||
tat->loop, tat_done, tat, NULL, &tat->rdataset,
|
||||
tat->loop, tat_done, tat, &tat->rdataset,
|
||||
&tat->sigrdataset, &tat->fetch);
|
||||
}
|
||||
|
||||
@@ -7253,7 +7283,7 @@ configure_session_key(const cfg_obj_t **maps, named_server_t *server,
|
||||
isc_buffer_constinit(&buffer, keynamestr, strlen(keynamestr));
|
||||
isc_buffer_add(&buffer, strlen(keynamestr));
|
||||
keyname = dns_fixedname_initname(&fname);
|
||||
result = dns_name_fromtext(keyname, &buffer, dns_rootname, 0);
|
||||
result = dns_name_fromtext(keyname, &buffer, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
@@ -7305,7 +7335,7 @@ configure_session_key(const cfg_obj_t **maps, named_server_t *server,
|
||||
INSIST(server->session_keybits == 0);
|
||||
|
||||
server->session_keyname = isc_mem_get(mctx, sizeof(dns_name_t));
|
||||
dns_name_init(server->session_keyname);
|
||||
dns_name_init(server->session_keyname, NULL);
|
||||
dns_name_dup(keyname, mctx, server->session_keyname);
|
||||
|
||||
server->session_keyfile = isc_mem_strdup(mctx, keyfile);
|
||||
@@ -7811,7 +7841,8 @@ get_newzone_config(dns_view_t *view, const char *zonename,
|
||||
isc_buffer_constinit(&b, zonename, strlen(zonename));
|
||||
isc_buffer_add(&b, strlen(zonename));
|
||||
name = dns_fixedname_initname(&fname);
|
||||
CHECK(dns_name_fromtext(name, &b, dns_rootname, DNS_NAME_DOWNCASE));
|
||||
CHECK(dns_name_fromtext(name, &b, dns_rootname, DNS_NAME_DOWNCASE,
|
||||
NULL));
|
||||
dns_name_format(name, zname, sizeof(zname));
|
||||
|
||||
key.mv_data = zname;
|
||||
@@ -7921,7 +7952,7 @@ load_configuration(const char *filename, named_server_t *server,
|
||||
/*
|
||||
* Shut down all dyndb instances.
|
||||
*/
|
||||
dns_dyndb_cleanup();
|
||||
dns_dyndb_cleanup(false);
|
||||
|
||||
/*
|
||||
* Parse the global default pseudo-config file.
|
||||
@@ -8271,8 +8302,20 @@ load_configuration(const char *filename, named_server_t *server,
|
||||
/*
|
||||
* Configure sets of UDP query source ports.
|
||||
*/
|
||||
isc_portset_create(named_g_mctx, &v4portset);
|
||||
isc_portset_create(named_g_mctx, &v6portset);
|
||||
result = isc_portset_create(named_g_mctx, &v4portset);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
|
||||
ISC_LOG_ERROR, "creating UDP/IPv4 port set: %s",
|
||||
isc_result_totext(result));
|
||||
goto cleanup_bindkeys_parser;
|
||||
}
|
||||
result = isc_portset_create(named_g_mctx, &v6portset);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
|
||||
ISC_LOG_ERROR, "creating UDP/IPv6 port set: %s",
|
||||
isc_result_totext(result));
|
||||
goto cleanup_v4portset;
|
||||
}
|
||||
|
||||
result = isc_net_getudpportrange(AF_INET, &udpport_low, &udpport_high);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
@@ -8280,7 +8323,7 @@ load_configuration(const char *filename, named_server_t *server,
|
||||
ISC_LOG_ERROR,
|
||||
"get the default UDP/IPv4 port range: %s",
|
||||
isc_result_totext(result));
|
||||
goto cleanup_portsets;
|
||||
goto cleanup_v6portset;
|
||||
}
|
||||
|
||||
isc_portset_addrange(v4portset, udpport_low, udpport_high);
|
||||
@@ -8298,7 +8341,7 @@ load_configuration(const char *filename, named_server_t *server,
|
||||
ISC_LOG_ERROR,
|
||||
"get the default UDP/IPv6 port range: %s",
|
||||
isc_result_totext(result));
|
||||
goto cleanup_portsets;
|
||||
goto cleanup_v6portset;
|
||||
}
|
||||
isc_portset_addrange(v6portset, udpport_low, udpport_high);
|
||||
if (!ns_server_getoption(server->sctx, NS_SERVER_DISABLE6)) {
|
||||
@@ -8377,7 +8420,7 @@ load_configuration(const char *filename, named_server_t *server,
|
||||
} else {
|
||||
result = named_config_getport(config, "port", &listen_port);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_portsets;
|
||||
goto cleanup_v6portset;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8424,13 +8467,13 @@ load_configuration(const char *filename, named_server_t *server,
|
||||
|
||||
result = named_config_get(maps, "listen-on", &clistenon);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_portsets;
|
||||
goto cleanup_v6portset;
|
||||
}
|
||||
result = listenlist_fromconfig(
|
||||
clistenon, config, named_g_aclconfctx, named_g_mctx,
|
||||
AF_INET, server->tlsctx_server_cache, &listenon);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_portsets;
|
||||
goto cleanup_v6portset;
|
||||
}
|
||||
if (listenon != NULL) {
|
||||
ns_interfacemgr_setlistenon4(server->interfacemgr,
|
||||
@@ -8448,13 +8491,13 @@ load_configuration(const char *filename, named_server_t *server,
|
||||
|
||||
result = named_config_get(maps, "listen-on-v6", &clistenon);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_portsets;
|
||||
goto cleanup_v6portset;
|
||||
}
|
||||
result = listenlist_fromconfig(
|
||||
clistenon, config, named_g_aclconfctx, named_g_mctx,
|
||||
AF_INET6, server->tlsctx_server_cache, &listenon);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_portsets;
|
||||
goto cleanup_v6portset;
|
||||
}
|
||||
if (listenon != NULL) {
|
||||
ns_interfacemgr_setlistenon6(server->interfacemgr,
|
||||
@@ -8484,7 +8527,7 @@ load_configuration(const char *filename, named_server_t *server,
|
||||
"unable to listen on any configured "
|
||||
"interfaces");
|
||||
result = ISC_R_FAILURE;
|
||||
goto cleanup_portsets;
|
||||
goto cleanup_v6portset;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9291,8 +9334,10 @@ cleanup_keystorelist:
|
||||
dns_keystore_detach(&keystore);
|
||||
}
|
||||
|
||||
cleanup_portsets:
|
||||
cleanup_v6portset:
|
||||
isc_portset_destroy(named_g_mctx, &v6portset);
|
||||
|
||||
cleanup_v4portset:
|
||||
isc_portset_destroy(named_g_mctx, &v4portset);
|
||||
|
||||
cleanup_bindkeys_parser:
|
||||
@@ -9387,7 +9432,7 @@ view_loaded(void *arg) {
|
||||
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
|
||||
ISC_LOG_NOTICE, "FIPS mode is %s",
|
||||
isc_crypto_fips_mode() ? "enabled" : "disabled");
|
||||
isc_fips_mode() ? "enabled" : "disabled");
|
||||
|
||||
#if HAVE_LIBSYSTEMD
|
||||
sd_notifyf(0,
|
||||
@@ -9600,7 +9645,7 @@ shutdown_server(void *arg) {
|
||||
/*
|
||||
* Shut down all dyndb instances.
|
||||
*/
|
||||
dns_dyndb_cleanup();
|
||||
dns_dyndb_cleanup(true);
|
||||
|
||||
while ((nsc = ISC_LIST_HEAD(server->cachelist)) != NULL) {
|
||||
ISC_LIST_UNLINK(server->cachelist, nsc, link);
|
||||
@@ -10105,39 +10150,6 @@ named_server_closelogswanted(void *arg, int signum) {
|
||||
isc_async_run(named_g_mainloop, named_server_closelogs, server);
|
||||
}
|
||||
|
||||
#ifdef JEMALLOC_API_SUPPORTED
|
||||
static isc_result_t
|
||||
memprof_toggle(bool active) {
|
||||
if (mallctl("prof.active", NULL, NULL, &active, sizeof(active)) != 0) {
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
memprof_dump(void) {
|
||||
if (mallctl("prof.dump", NULL, NULL, NULL, 0) != 0) {
|
||||
return ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
#else
|
||||
static isc_result_t
|
||||
memprof_toggle(bool active) {
|
||||
UNUSED(active);
|
||||
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
memprof_dump(void) {
|
||||
return ISC_R_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
#endif /* JEMALLOC_API_SUPPORTED */
|
||||
|
||||
void
|
||||
named_server_scan_interfaces(named_server_t *server) {
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
|
||||
@@ -11842,7 +11854,7 @@ named_server_flushnode(named_server_t *server, isc_lex_t *lex, bool tree) {
|
||||
isc_buffer_constinit(&b, target, strlen(target));
|
||||
isc_buffer_add(&b, strlen(target));
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
result = dns_name_fromtext(name, &b, dns_rootname, 0);
|
||||
result = dns_name_fromtext(name, &b, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
@@ -12010,10 +12022,6 @@ named_server_status(named_server_t *server, isc_buffer_t **text) {
|
||||
: "OFF");
|
||||
CHECK(putstr(text, line));
|
||||
|
||||
snprintf(line, sizeof(line), "memory profiling is %s\n",
|
||||
named_server_getmemprof());
|
||||
CHECK(putstr(text, line));
|
||||
|
||||
snprintf(line, sizeof(line), "recursive clients: %u/%u/%u\n",
|
||||
isc_quota_getused(&server->sctx->recursionquota),
|
||||
isc_quota_getsoft(&server->sctx->recursionquota),
|
||||
@@ -12550,7 +12558,7 @@ nzd_setkey(MDB_val *key, dns_name_t *name, char *namebuf, size_t buflen) {
|
||||
dns_fixedname_t fixed;
|
||||
|
||||
dns_fixedname_init(&fixed);
|
||||
dns_name_downcase(name, dns_fixedname_name(&fixed));
|
||||
dns_name_downcase(name, dns_fixedname_name(&fixed), NULL);
|
||||
dns_name_format(dns_fixedname_name(&fixed), namebuf, buflen);
|
||||
|
||||
key->mv_data = namebuf;
|
||||
@@ -12952,7 +12960,7 @@ load_nzf(dns_view_t *view, ns_cfgctx_t *nzcfg) {
|
||||
isc_buffer_add(&b, strlen(origin));
|
||||
name = dns_fixedname_initname(&fname);
|
||||
CHECK(dns_name_fromtext(name, &b, dns_rootname,
|
||||
DNS_NAME_DOWNCASE));
|
||||
DNS_NAME_DOWNCASE, NULL));
|
||||
dns_name_format(name, zname, sizeof(zname));
|
||||
|
||||
key.mv_data = zname;
|
||||
@@ -13661,7 +13669,7 @@ named_server_changezone(named_server_t *server, char *command,
|
||||
isc_buffer_add(&buf, strlen(zonename));
|
||||
|
||||
dnsname = dns_fixedname_initname(&fname);
|
||||
CHECK(dns_name_fromtext(dnsname, &buf, dns_rootname, 0));
|
||||
CHECK(dns_name_fromtext(dnsname, &buf, dns_rootname, 0, NULL));
|
||||
|
||||
if (redirect) {
|
||||
if (!dns_name_equal(dnsname, dns_rootname)) {
|
||||
@@ -14633,16 +14641,10 @@ named_server_dnssec(named_server_t *server, isc_lex_t *lex,
|
||||
/*
|
||||
* Output the DNSSEC status of the key and signing policy.
|
||||
*/
|
||||
isc_result_t r;
|
||||
LOCK(&kasp->lock);
|
||||
r = dns_keymgr_status(kasp, &keys, now, &output[0],
|
||||
sizeof(output));
|
||||
dns_keymgr_status(kasp, &keys, now, &output[0], sizeof(output));
|
||||
UNLOCK(&kasp->lock);
|
||||
CHECK(putstr(text, output));
|
||||
if (r != ISC_R_SUCCESS) {
|
||||
CHECK(putstr(text,
|
||||
"\n\nStatus output is truncated..."));
|
||||
}
|
||||
} else if (checkds) {
|
||||
/*
|
||||
* Mark DS record has been seen, so it may move to the
|
||||
@@ -15227,7 +15229,7 @@ named_server_nta(named_server_t *server, isc_lex_t *lex, bool readonly,
|
||||
isc_buffer_t b;
|
||||
isc_buffer_init(&b, namebuf, strlen(namebuf));
|
||||
isc_buffer_add(&b, strlen(namebuf));
|
||||
CHECK(dns_name_fromtext(fname, &b, dns_rootname, 0));
|
||||
CHECK(dns_name_fromtext(fname, &b, dns_rootname, 0, NULL));
|
||||
ntaname = fname;
|
||||
}
|
||||
|
||||
@@ -16224,113 +16226,3 @@ cleanup:
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
named_server_togglememprof(isc_lex_t *lex) {
|
||||
isc_result_t result = ISC_R_FAILURE;
|
||||
bool active;
|
||||
char *ptr;
|
||||
|
||||
/* Skip the command name. */
|
||||
ptr = next_token(lex, NULL);
|
||||
if (ptr == NULL) {
|
||||
return ISC_R_UNEXPECTEDEND;
|
||||
}
|
||||
|
||||
ptr = next_token(lex, NULL);
|
||||
if (ptr == NULL) {
|
||||
return ISC_R_UNEXPECTEDEND;
|
||||
} else if (!strcasecmp(ptr, "dump")) {
|
||||
result = memprof_dump();
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
|
||||
"failed to dump memory profile");
|
||||
|
||||
} else {
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
|
||||
"memory profile dumped");
|
||||
}
|
||||
|
||||
goto done;
|
||||
} else if (!strcasecmp(ptr, "on") || !strcasecmp(ptr, "yes") ||
|
||||
!strcasecmp(ptr, "enable") || !strcasecmp(ptr, "true"))
|
||||
{
|
||||
active = true;
|
||||
} else if (!strcasecmp(ptr, "off") || !strcasecmp(ptr, "no") ||
|
||||
!strcasecmp(ptr, "disable") || !strcasecmp(ptr, "false"))
|
||||
{
|
||||
active = false;
|
||||
} else {
|
||||
return DNS_R_SYNTAX;
|
||||
}
|
||||
|
||||
result = memprof_toggle(active);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
|
||||
ISC_LOG_ERROR,
|
||||
"failed to toggle memory profiling");
|
||||
} else {
|
||||
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
|
||||
ISC_LOG_INFO, "memory profiling %s",
|
||||
active ? "enabled" : "disabled");
|
||||
}
|
||||
|
||||
done:
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef JEMALLOC_API_SUPPORTED
|
||||
const char *
|
||||
named_server_getmemprof(void) {
|
||||
memprof_status status = MEMPROF_ON;
|
||||
bool is_enabled;
|
||||
size_t len = sizeof(is_enabled);
|
||||
|
||||
if (mallctl("config.prof", &is_enabled, &len, NULL, 0) != 0) {
|
||||
status = MEMPROF_FAILING;
|
||||
goto done;
|
||||
}
|
||||
|
||||
INSIST(len == sizeof(is_enabled));
|
||||
|
||||
if (!is_enabled) {
|
||||
status = MEMPROF_UNSUPPORTED;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (mallctl("opt.prof", &is_enabled, &len, NULL, 0) != 0) {
|
||||
status = MEMPROF_FAILING;
|
||||
goto done;
|
||||
}
|
||||
|
||||
INSIST(len == sizeof(is_enabled));
|
||||
|
||||
if (!is_enabled) {
|
||||
status = MEMPROF_INACTIVE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
len = sizeof(is_enabled);
|
||||
if (mallctl("prof.active", &is_enabled, &len, NULL, 0) != 0) {
|
||||
status = MEMPROF_FAILING;
|
||||
goto done;
|
||||
}
|
||||
|
||||
INSIST(len == sizeof(is_enabled));
|
||||
|
||||
if (!is_enabled) {
|
||||
status = MEMPROF_OFF;
|
||||
}
|
||||
|
||||
done:
|
||||
return memprof_status_text[status];
|
||||
}
|
||||
|
||||
#else /* JEMALLOC_API_SUPPORTED */
|
||||
const char *
|
||||
named_server_getmemprof(void) {
|
||||
return memprof_status_text[MEMPROF_UNSUPPORTED];
|
||||
}
|
||||
#endif /* JEMALLOC_API_SUPPORTED */
|
||||
|
||||
+12
-30
@@ -97,7 +97,7 @@ typedef struct stats_dumparg {
|
||||
isc_result_t result;
|
||||
} stats_dumparg_t;
|
||||
|
||||
static isc_once_t once = ISC_ONCE_INITIALIZER;
|
||||
static isc_once_t once = ISC_ONCE_INIT;
|
||||
|
||||
#if defined(HAVE_LIBXML2) || defined(HAVE_JSON_C)
|
||||
#define EXTENDED_STATS
|
||||
@@ -1488,7 +1488,6 @@ xfrin_xmlrender(dns_zone_t *zone, void *arg) {
|
||||
unsigned int nmsg = 0;
|
||||
unsigned int nrecs = 0;
|
||||
uint64_t nbytes = 0;
|
||||
uint64_t rate = 0;
|
||||
|
||||
statlevel = dns_zone_getstatlevel(zone);
|
||||
if (statlevel == dns_zonestat_none) {
|
||||
@@ -1603,7 +1602,7 @@ xfrin_xmlrender(dns_zone_t *zone, void *arg) {
|
||||
isc_sockaddr_format(addrp, addr_buf, sizeof(addr_buf));
|
||||
TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR addr_buf));
|
||||
} else if (is_presoa) {
|
||||
dns_zone_getsourceaddr(zone, &addr);
|
||||
addr = dns_zone_getsourceaddr(zone);
|
||||
isc_sockaddr_format(&addr, addr_buf, sizeof(addr_buf));
|
||||
TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR addr_buf));
|
||||
} else {
|
||||
@@ -1617,13 +1616,9 @@ xfrin_xmlrender(dns_zone_t *zone, void *arg) {
|
||||
isc_sockaddr_format(addrp, addr_buf, sizeof(addr_buf));
|
||||
TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR addr_buf));
|
||||
} else if (is_presoa) {
|
||||
if (dns_zone_getprimaryaddr(zone, &addr) == ISC_R_SUCCESS) {
|
||||
isc_sockaddr_format(&addr, addr_buf, sizeof(addr_buf));
|
||||
TRY0(xmlTextWriterWriteString(writer,
|
||||
ISC_XMLCHAR addr_buf));
|
||||
} else {
|
||||
TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR "-"));
|
||||
}
|
||||
addr = dns_zone_getprimaryaddr(zone);
|
||||
isc_sockaddr_format(&addr, addr_buf, sizeof(addr_buf));
|
||||
TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR addr_buf));
|
||||
} else {
|
||||
TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR "-"));
|
||||
}
|
||||
@@ -1706,7 +1701,7 @@ xfrin_xmlrender(dns_zone_t *zone, void *arg) {
|
||||
TRY0(xmlTextWriterEndElement(writer));
|
||||
|
||||
if (is_running) {
|
||||
dns_xfrin_getstats(xfr, &nmsg, &nrecs, &nbytes, &rate);
|
||||
dns_xfrin_getstats(xfr, &nmsg, &nrecs, &nbytes);
|
||||
}
|
||||
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "nmsg"));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer, "%u", nmsg));
|
||||
@@ -1717,9 +1712,6 @@ xfrin_xmlrender(dns_zone_t *zone, void *arg) {
|
||||
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "nbytes"));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer, "%" PRIu64, nbytes));
|
||||
TRY0(xmlTextWriterEndElement(writer));
|
||||
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "rate"));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer, "%" PRIu64, rate));
|
||||
TRY0(xmlTextWriterEndElement(writer));
|
||||
|
||||
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "ixfr"));
|
||||
if (is_running && is_first_data_received) {
|
||||
@@ -2567,7 +2559,6 @@ xfrin_jsonrender(dns_zone_t *zone, void *arg) {
|
||||
unsigned int nmsg = 0;
|
||||
unsigned int nrecs = 0;
|
||||
uint64_t nbytes = 0;
|
||||
uint64_t rate = 0;
|
||||
|
||||
statlevel = dns_zone_getstatlevel(zone);
|
||||
if (statlevel == dns_zonestat_none) {
|
||||
@@ -2660,7 +2651,7 @@ xfrin_jsonrender(dns_zone_t *zone, void *arg) {
|
||||
json_object_object_add(xfrinobj, "localaddr",
|
||||
json_object_new_string(addr_buf));
|
||||
} else if (is_presoa) {
|
||||
dns_zone_getsourceaddr(zone, &addr);
|
||||
addr = dns_zone_getsourceaddr(zone);
|
||||
isc_sockaddr_format(&addr, addr_buf, sizeof(addr_buf));
|
||||
json_object_object_add(xfrinobj, "localaddr",
|
||||
json_object_new_string(addr_buf));
|
||||
@@ -2675,15 +2666,10 @@ xfrin_jsonrender(dns_zone_t *zone, void *arg) {
|
||||
json_object_object_add(xfrinobj, "remoteaddr",
|
||||
json_object_new_string(addr_buf));
|
||||
} else if (is_presoa) {
|
||||
if (dns_zone_getprimaryaddr(zone, &addr) == ISC_R_SUCCESS) {
|
||||
isc_sockaddr_format(&addr, addr_buf, sizeof(addr_buf));
|
||||
json_object_object_add(
|
||||
xfrinobj, "remoteaddr",
|
||||
json_object_new_string(addr_buf));
|
||||
} else {
|
||||
json_object_object_add(xfrinobj, "remoteaddr",
|
||||
json_object_new_string("-"));
|
||||
}
|
||||
addr = dns_zone_getprimaryaddr(zone);
|
||||
isc_sockaddr_format(&addr, addr_buf, sizeof(addr_buf));
|
||||
json_object_object_add(xfrinobj, "remoteaddr",
|
||||
json_object_new_string(addr_buf));
|
||||
} else {
|
||||
json_object_object_add(xfrinobj, "remoteaddr",
|
||||
json_object_new_string("-"));
|
||||
@@ -2770,7 +2756,7 @@ xfrin_jsonrender(dns_zone_t *zone, void *arg) {
|
||||
}
|
||||
|
||||
if (is_running) {
|
||||
dns_xfrin_getstats(xfr, &nmsg, &nrecs, &nbytes, &rate);
|
||||
dns_xfrin_getstats(xfr, &nmsg, &nrecs, &nbytes);
|
||||
}
|
||||
json_object_object_add(xfrinobj, "nmsg",
|
||||
json_object_new_int64((int64_t)nmsg));
|
||||
@@ -2780,10 +2766,6 @@ xfrin_jsonrender(dns_zone_t *zone, void *arg) {
|
||||
xfrinobj, "nbytes",
|
||||
json_object_new_int64(nbytes > INT64_MAX ? INT64_MAX
|
||||
: (int64_t)nbytes));
|
||||
json_object_object_add(xfrinobj, "rate",
|
||||
json_object_new_int64(rate > INT64_MAX
|
||||
? INT64_MAX
|
||||
: (int64_t)rate));
|
||||
|
||||
if (is_running && is_first_data_received) {
|
||||
json_object_object_add(
|
||||
|
||||
@@ -53,7 +53,10 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
|
||||
isc_buffer_t b;
|
||||
const cfg_obj_t *obj;
|
||||
|
||||
dns_tkeyctx_create(mctx, &tctx);
|
||||
result = dns_tkeyctx_create(mctx, &tctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
result = cfg_map_get(options, "tkey-domain", &obj);
|
||||
@@ -62,9 +65,9 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
|
||||
isc_buffer_constinit(&b, s, strlen(s));
|
||||
isc_buffer_add(&b, strlen(s));
|
||||
name = dns_fixedname_initname(&fname);
|
||||
RETERR(dns_name_fromtext(name, &b, dns_rootname, 0));
|
||||
RETERR(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
|
||||
tctx->domain = isc_mem_get(mctx, sizeof(dns_name_t));
|
||||
dns_name_init(tctx->domain);
|
||||
dns_name_init(tctx->domain, NULL);
|
||||
dns_name_dup(name, mctx, tctx->domain);
|
||||
}
|
||||
|
||||
@@ -76,7 +79,7 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
|
||||
isc_buffer_constinit(&b, s, strlen(s));
|
||||
isc_buffer_add(&b, strlen(s));
|
||||
name = dns_fixedname_initname(&fname);
|
||||
RETERR(dns_name_fromtext(name, &b, dns_rootname, 0));
|
||||
RETERR(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
|
||||
RETERR(dst_gssapi_acquirecred(name, false, &tctx->gsscred));
|
||||
}
|
||||
|
||||
|
||||
+23
-21
@@ -27,16 +27,17 @@
|
||||
#include <named/log.h>
|
||||
#include <named/transportconf.h>
|
||||
|
||||
#define create_name(id, name) \
|
||||
isc_buffer_t namesrc; \
|
||||
dns_fixedname_t _fn; \
|
||||
name = dns_fixedname_initname(&_fn); \
|
||||
isc_buffer_constinit(&namesrc, id, strlen(id)); \
|
||||
isc_buffer_add(&namesrc, strlen(id)); \
|
||||
result = (dns_name_fromtext(name, &namesrc, dns_rootname, \
|
||||
DNS_NAME_DOWNCASE)); \
|
||||
if (result != ISC_R_SUCCESS) { \
|
||||
goto failure; \
|
||||
#define create_name(id, name) \
|
||||
isc_buffer_t namesrc, namebuf; \
|
||||
char namedata[DNS_NAME_FORMATSIZE + 1]; \
|
||||
dns_name_init(name, NULL); \
|
||||
isc_buffer_constinit(&namesrc, id, strlen(id)); \
|
||||
isc_buffer_add(&namesrc, strlen(id)); \
|
||||
isc_buffer_init(&namebuf, namedata, sizeof(namedata)); \
|
||||
result = (dns_name_fromtext(name, &namesrc, dns_rootname, \
|
||||
DNS_NAME_DOWNCASE, &namebuf)); \
|
||||
if (result != ISC_R_SUCCESS) { \
|
||||
goto failure; \
|
||||
}
|
||||
|
||||
#define parse_transport_option(map, transport, name, setter) \
|
||||
@@ -99,15 +100,15 @@ add_doh_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
|
||||
for (const cfg_listelt_t *element = cfg_list_first(transportlist);
|
||||
element != NULL; element = cfg_list_next(element))
|
||||
{
|
||||
dns_name_t *dohname = NULL;
|
||||
dns_transport_t *transport = NULL;
|
||||
dns_name_t dohname;
|
||||
dns_transport_t *transport;
|
||||
|
||||
doh = cfg_listelt_value(element);
|
||||
dohid = cfg_obj_asstring(cfg_map_getname(doh));
|
||||
|
||||
create_name(dohid, dohname);
|
||||
create_name(dohid, &dohname);
|
||||
|
||||
transport = dns_transport_new(dohname, DNS_TRANSPORT_HTTP,
|
||||
transport = dns_transport_new(&dohname, DNS_TRANSPORT_HTTP,
|
||||
list);
|
||||
|
||||
dns_transport_set_tlsname(transport, dohid);
|
||||
@@ -147,8 +148,8 @@ add_tls_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
|
||||
for (const cfg_listelt_t *element = cfg_list_first(transportlist);
|
||||
element != NULL; element = cfg_list_next(element))
|
||||
{
|
||||
dns_name_t *tlsname = NULL;
|
||||
dns_transport_t *transport = NULL;
|
||||
dns_name_t tlsname;
|
||||
dns_transport_t *transport;
|
||||
|
||||
tls = cfg_listelt_value(element);
|
||||
tlsid = cfg_obj_asstring(cfg_map_getname(tls));
|
||||
@@ -158,9 +159,10 @@ add_tls_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
create_name(tlsid, tlsname);
|
||||
create_name(tlsid, &tlsname);
|
||||
|
||||
transport = dns_transport_new(tlsname, DNS_TRANSPORT_TLS, list);
|
||||
transport = dns_transport_new(&tlsname, DNS_TRANSPORT_TLS,
|
||||
list);
|
||||
|
||||
dns_transport_set_tlsname(transport, tlsid);
|
||||
parse_transport_option(tls, transport, "key-file",
|
||||
@@ -220,12 +222,12 @@ transport_list_fromconfig(const cfg_obj_t *config, dns_transport_list_t *list) {
|
||||
static void
|
||||
transport_list_add_ephemeral(dns_transport_list_t *list) {
|
||||
isc_result_t result;
|
||||
dns_name_t *tlsname = NULL;
|
||||
dns_name_t tlsname;
|
||||
dns_transport_t *transport;
|
||||
|
||||
create_name("ephemeral", tlsname);
|
||||
create_name("ephemeral", &tlsname);
|
||||
|
||||
transport = dns_transport_new(tlsname, DNS_TRANSPORT_TLS, list);
|
||||
transport = dns_transport_new(&tlsname, DNS_TRANSPORT_TLS, list);
|
||||
dns_transport_set_tlsname(transport, "ephemeral");
|
||||
|
||||
return;
|
||||
|
||||
@@ -46,11 +46,11 @@ add_initial_keys(const cfg_obj_t *list, dns_tsigkeyring_t *ring,
|
||||
{
|
||||
const cfg_obj_t *algobj = NULL;
|
||||
const cfg_obj_t *secretobj = NULL;
|
||||
dns_fixedname_t fkey;
|
||||
dns_name_t *keyname = dns_fixedname_initname(&fkey);
|
||||
dns_name_t keyname;
|
||||
dst_algorithm_t alg = DST_ALG_UNKNOWN;
|
||||
const char *algstr = NULL;
|
||||
isc_buffer_t keynamesrc;
|
||||
char keynamedata[1024];
|
||||
isc_buffer_t keynamesrc, keynamebuf;
|
||||
const char *secretstr = NULL;
|
||||
isc_buffer_t secretbuf;
|
||||
int secretlen = 0;
|
||||
@@ -68,10 +68,12 @@ add_initial_keys(const cfg_obj_t *list, dns_tsigkeyring_t *ring,
|
||||
/*
|
||||
* Create the key name.
|
||||
*/
|
||||
dns_name_init(&keyname, NULL);
|
||||
isc_buffer_constinit(&keynamesrc, keyid, strlen(keyid));
|
||||
isc_buffer_add(&keynamesrc, strlen(keyid));
|
||||
ret = dns_name_fromtext(keyname, &keynamesrc, dns_rootname,
|
||||
DNS_NAME_DOWNCASE);
|
||||
isc_buffer_init(&keynamebuf, keynamedata, sizeof(keynamedata));
|
||||
ret = dns_name_fromtext(&keyname, &keynamesrc, dns_rootname,
|
||||
DNS_NAME_DOWNCASE, &keynamebuf);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
goto failure;
|
||||
}
|
||||
@@ -101,7 +103,7 @@ add_initial_keys(const cfg_obj_t *list, dns_tsigkeyring_t *ring,
|
||||
}
|
||||
secretlen = isc_buffer_usedlength(&secretbuf);
|
||||
|
||||
ret = dns_tsigkey_create(keyname, alg, secret, secretlen, mctx,
|
||||
ret = dns_tsigkey_create(&keyname, alg, secret, secretlen, mctx,
|
||||
&tsigkey);
|
||||
isc_mem_put(mctx, secret, secretalloc);
|
||||
secret = NULL;
|
||||
|
||||
+32
-62
@@ -253,7 +253,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
||||
isc_buffer_constinit(&b, str, strlen(str));
|
||||
isc_buffer_add(&b, strlen(str));
|
||||
result = dns_name_fromtext(dns_fixedname_name(&fident), &b,
|
||||
dns_rootname, 0);
|
||||
dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(identity, ISC_LOG_ERROR,
|
||||
"'%s' is not a valid name", str);
|
||||
@@ -283,7 +283,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
||||
isc_buffer_constinit(&b, str, strlen(str));
|
||||
isc_buffer_add(&b, strlen(str));
|
||||
result = dns_name_fromtext(dns_fixedname_name(&fname),
|
||||
&b, dns_rootname, 0);
|
||||
&b, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(identity, ISC_LOG_ERROR,
|
||||
"'%s' is not a valid name", str);
|
||||
@@ -518,7 +518,7 @@ configure_staticstub_servernames(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
||||
|
||||
isc_buffer_constinit(&b, str, strlen(str));
|
||||
isc_buffer_add(&b, strlen(str));
|
||||
result = dns_name_fromtext(nsname, &b, dns_rootname, 0);
|
||||
result = dns_name_fromtext(nsname, &b, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(zconfig, ISC_LOG_ERROR,
|
||||
"server-name '%s' is not a valid "
|
||||
@@ -633,7 +633,7 @@ configure_staticstub(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
||||
*/
|
||||
CHECK(dns_db_newversion(db, &dbversion));
|
||||
|
||||
dns_name_init(&apexname);
|
||||
dns_name_init(&apexname, NULL);
|
||||
dns_name_clone(dns_zone_getorigin(zone), &apexname);
|
||||
CHECK(dns_db_findnode(db, &apexname, false, &apexnode));
|
||||
|
||||
@@ -897,7 +897,6 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
const char *dupcheck;
|
||||
dns_checkdstype_t checkdstype = dns_checkdstype_yes;
|
||||
dns_notifytype_t notifytype = dns_notifytype_yes;
|
||||
uint32_t count;
|
||||
unsigned int dbargc;
|
||||
char **dbargv;
|
||||
static char default_dbtype[] = ZONEDB_DEFAULT;
|
||||
@@ -907,7 +906,6 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
dns_zonetype_t ztype;
|
||||
int i;
|
||||
int32_t journal_size;
|
||||
bool multi;
|
||||
dns_kasp_t *kasp = NULL;
|
||||
bool check = false, fail = false;
|
||||
bool warn = false, ignore = false;
|
||||
@@ -978,6 +976,9 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
cpval = isc_mem_strdup(mctx, cfg_obj_asstring(obj));
|
||||
}
|
||||
if (cpval == NULL) {
|
||||
CHECK(ISC_R_NOMEMORY);
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
result = cfg_map_get(zoptions, "dlz", &obj);
|
||||
@@ -1106,20 +1107,24 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
size_t signedlen = strlen(filename) + sizeof(SIGNED);
|
||||
char *signedname;
|
||||
|
||||
dns_zone_setfile(raw, filename, masterformat, masterstyle);
|
||||
CHECK(dns_zone_setfile(raw, filename, masterformat,
|
||||
masterstyle));
|
||||
signedname = isc_mem_get(mctx, signedlen);
|
||||
|
||||
(void)snprintf(signedname, signedlen, "%s" SIGNED, filename);
|
||||
dns_zone_setfile(zone, signedname, dns_masterformat_raw, NULL);
|
||||
result = dns_zone_setfile(zone, signedname,
|
||||
dns_masterformat_raw, NULL);
|
||||
isc_mem_put(mctx, signedname, signedlen);
|
||||
CHECK(result);
|
||||
} else {
|
||||
dns_zone_setfile(zone, filename, masterformat, masterstyle);
|
||||
CHECK(dns_zone_setfile(zone, filename, masterformat,
|
||||
masterstyle));
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
result = cfg_map_get(zoptions, "journal", &obj);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
dns_zone_setjournal(mayberaw, cfg_obj_asstring(obj));
|
||||
CHECK(dns_zone_setjournal(mayberaw, cfg_obj_asstring(obj)));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1266,8 +1271,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
dns_ipkeylist_t ipkl;
|
||||
dns_ipkeylist_init(&ipkl);
|
||||
|
||||
CHECK(named_config_getipandkeylist(config, obj, mctx,
|
||||
&ipkl));
|
||||
CHECK(named_config_getipandkeylist(config, "primaries",
|
||||
obj, mctx, &ipkl));
|
||||
dns_zone_setalsonotify(zone, ipkl.addrs, ipkl.sources,
|
||||
ipkl.keys, ipkl.tlss,
|
||||
ipkl.count);
|
||||
@@ -1279,22 +1284,22 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "parental-source", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS && obj != NULL);
|
||||
dns_zone_setparentalsrc4(zone, cfg_obj_assockaddr(obj));
|
||||
CHECK(dns_zone_setparentalsrc4(zone, cfg_obj_assockaddr(obj)));
|
||||
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "parental-source-v6", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS && obj != NULL);
|
||||
dns_zone_setparentalsrc6(zone, cfg_obj_assockaddr(obj));
|
||||
CHECK(dns_zone_setparentalsrc6(zone, cfg_obj_assockaddr(obj)));
|
||||
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "notify-source", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS && obj != NULL);
|
||||
dns_zone_setnotifysrc4(zone, cfg_obj_assockaddr(obj));
|
||||
CHECK(dns_zone_setnotifysrc4(zone, cfg_obj_assockaddr(obj)));
|
||||
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "notify-source-v6", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS && obj != NULL);
|
||||
dns_zone_setnotifysrc6(zone, cfg_obj_assockaddr(obj));
|
||||
CHECK(dns_zone_setnotifysrc6(zone, cfg_obj_assockaddr(obj)));
|
||||
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "notify-to-soa", &obj);
|
||||
@@ -1620,7 +1625,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
result = named_config_get(maps, "key-directory", &obj);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
filename = cfg_obj_asstring(obj);
|
||||
dns_zone_setkeydirectory(zone, filename);
|
||||
CHECK(dns_zone_setkeydirectory(zone, filename));
|
||||
}
|
||||
/* Also save a reference to the keystore list. */
|
||||
dns_zone_setkeystores(zone, keystorelist);
|
||||
@@ -1672,8 +1677,9 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
if (parentals != NULL) {
|
||||
dns_ipkeylist_t ipkl;
|
||||
dns_ipkeylist_init(&ipkl);
|
||||
CHECK(named_config_getipandkeylist(config, parentals,
|
||||
mctx, &ipkl));
|
||||
CHECK(named_config_getipandkeylist(
|
||||
config, "parental-agents", parentals, mctx,
|
||||
&ipkl));
|
||||
dns_zone_setparentals(zone, ipkl.addrs, ipkl.sources,
|
||||
ipkl.keys, ipkl.tlss, ipkl.count);
|
||||
dns_ipkeylist_clear(mctx, &ipkl);
|
||||
@@ -1830,7 +1836,6 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
case dns_zone_secondary:
|
||||
case dns_zone_stub:
|
||||
case dns_zone_redirect:
|
||||
count = 0;
|
||||
obj = NULL;
|
||||
(void)cfg_map_get(zoptions, "primaries", &obj);
|
||||
if (obj == NULL) {
|
||||
@@ -1845,7 +1850,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
dns_name_equal(dns_zone_getorigin(zone), dns_rootname))
|
||||
{
|
||||
result = named_config_getremotesdef(
|
||||
named_g_config, "remote-servers",
|
||||
named_g_config, "primaries",
|
||||
DEFAULT_IANA_ROOT_ZONE_PRIMARIES, &obj);
|
||||
CHECK(result);
|
||||
}
|
||||
@@ -1853,54 +1858,17 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
dns_ipkeylist_t ipkl;
|
||||
dns_ipkeylist_init(&ipkl);
|
||||
|
||||
CHECK(named_config_getipandkeylist(config, obj, mctx,
|
||||
&ipkl));
|
||||
CHECK(named_config_getipandkeylist(config, "primaries",
|
||||
obj, mctx, &ipkl));
|
||||
dns_zone_setprimaries(mayberaw, ipkl.addrs,
|
||||
ipkl.sources, ipkl.keys,
|
||||
ipkl.tlss, ipkl.count);
|
||||
count = ipkl.count;
|
||||
dns_ipkeylist_clear(mctx, &ipkl);
|
||||
} else {
|
||||
dns_zone_setprimaries(mayberaw, NULL, NULL, NULL, NULL,
|
||||
0);
|
||||
}
|
||||
|
||||
multi = false;
|
||||
if (count > 1) {
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "multi-master", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS && obj != NULL);
|
||||
multi = cfg_obj_asboolean(obj);
|
||||
}
|
||||
dns_zone_setoption(mayberaw, DNS_ZONEOPT_MULTIMASTER, multi);
|
||||
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "min-transfer-rate-in", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS && obj != NULL);
|
||||
uint32_t traffic_bytes =
|
||||
cfg_obj_asuint32(cfg_tuple_get(obj, "traffic_bytes"));
|
||||
uint32_t time_minutes =
|
||||
cfg_obj_asuint32(cfg_tuple_get(obj, "time_minutes"));
|
||||
if (traffic_bytes == 0) {
|
||||
cfg_obj_log(obj, ISC_LOG_ERROR,
|
||||
"zone '%s': 'min-transfer-rate-in' bytes"
|
||||
"value can not be '0'",
|
||||
zname);
|
||||
CHECK(ISC_R_FAILURE);
|
||||
}
|
||||
/* Max. 28 days (in minutes). */
|
||||
const unsigned int time_minutes_max = 28 * 24 * 60;
|
||||
if (time_minutes < 1 || time_minutes > time_minutes_max) {
|
||||
cfg_obj_log(obj, ISC_LOG_ERROR,
|
||||
"zone '%s': 'min-transfer-rate-in' minutes"
|
||||
"value is out of range (1..%u)",
|
||||
zname, time_minutes_max);
|
||||
CHECK(ISC_R_FAILURE);
|
||||
}
|
||||
dns_zone_setminxfrratein(mayberaw, traffic_bytes,
|
||||
transferinsecs ? time_minutes
|
||||
: time_minutes * 60);
|
||||
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "max-transfer-time-in", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS && obj != NULL);
|
||||
@@ -1938,12 +1906,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "transfer-source", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS && obj != NULL);
|
||||
dns_zone_setxfrsource4(mayberaw, cfg_obj_assockaddr(obj));
|
||||
CHECK(dns_zone_setxfrsource4(mayberaw,
|
||||
cfg_obj_assockaddr(obj)));
|
||||
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "transfer-source-v6", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS && obj != NULL);
|
||||
dns_zone_setxfrsource6(mayberaw, cfg_obj_assockaddr(obj));
|
||||
CHECK(dns_zone_setxfrsource6(mayberaw,
|
||||
cfg_obj_assockaddr(obj)));
|
||||
|
||||
obj = NULL;
|
||||
(void)named_config_get(maps, "try-tcp-refresh", &obj);
|
||||
|
||||
+47
-43
@@ -30,7 +30,6 @@
|
||||
#include <isc/getaddresses.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/lex.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/managers.h>
|
||||
@@ -53,7 +52,6 @@
|
||||
#include <dns/dispatch.h>
|
||||
#include <dns/dnssec.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/lib.h>
|
||||
#include <dns/masterdump.h>
|
||||
#include <dns/message.h>
|
||||
#include <dns/name.h>
|
||||
@@ -523,7 +521,8 @@ setup_keystr(void) {
|
||||
isc_buffer_add(&keynamesrc, (unsigned int)(n - name));
|
||||
|
||||
debug("namefromtext");
|
||||
result = dns_name_fromtext(mykeyname, &keynamesrc, dns_rootname, 0);
|
||||
result = dns_name_fromtext(mykeyname, &keynamesrc, dns_rootname, 0,
|
||||
NULL);
|
||||
check_result(result, "dns_name_fromtext");
|
||||
|
||||
secretlen = strlen(secretstr) * 3 / 4;
|
||||
@@ -767,12 +766,14 @@ set_source_ports(dns_dispatchmgr_t *manager) {
|
||||
in_port_t udpport_low, udpport_high;
|
||||
isc_result_t result;
|
||||
|
||||
isc_portset_create(gmctx, &v4portset);
|
||||
result = isc_portset_create(gmctx, &v4portset);
|
||||
check_result(result, "isc_portset_create (v4)");
|
||||
result = isc_net_getudpportrange(AF_INET, &udpport_low, &udpport_high);
|
||||
check_result(result, "isc_net_getudpportrange (v4)");
|
||||
isc_portset_addrange(v4portset, udpport_low, udpport_high);
|
||||
|
||||
isc_portset_create(gmctx, &v6portset);
|
||||
result = isc_portset_create(gmctx, &v6portset);
|
||||
check_result(result, "isc_portset_create (v6)");
|
||||
result = isc_net_getudpportrange(AF_INET6, &udpport_low, &udpport_high);
|
||||
check_result(result, "isc_net_getudpportrange (v6)");
|
||||
isc_portset_addrange(v6portset, udpport_low, udpport_high);
|
||||
@@ -785,14 +786,16 @@ set_source_ports(dns_dispatchmgr_t *manager) {
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
create_name(const char *str, dns_name_t *name) {
|
||||
isc_buffer_t namesrc;
|
||||
create_name(const char *str, char *namedata, size_t len, dns_name_t *name) {
|
||||
isc_buffer_t namesrc, namebuf;
|
||||
|
||||
dns_name_init(name, NULL);
|
||||
isc_buffer_constinit(&namesrc, str, strlen(str));
|
||||
isc_buffer_add(&namesrc, strlen(str));
|
||||
isc_buffer_init(&namebuf, namedata, len);
|
||||
|
||||
return dns_name_fromtext(name, &namesrc, dns_rootname,
|
||||
DNS_NAME_DOWNCASE);
|
||||
DNS_NAME_DOWNCASE, &namebuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -802,8 +805,8 @@ setup_system(void *arg ISC_ATTR_UNUSED) {
|
||||
isc_sockaddrlist_t *nslist;
|
||||
isc_logconfig_t *logconfig = NULL;
|
||||
irs_resconf_t *resconf = NULL;
|
||||
dns_fixedname_t ftls;
|
||||
dns_name_t *tlsname = dns_fixedname_initname(&ftls);
|
||||
dns_name_t tlsname;
|
||||
char namedata[DNS_NAME_FORMATSIZE + 1];
|
||||
|
||||
ddebug("setup_system()");
|
||||
|
||||
@@ -937,15 +940,17 @@ setup_system(void *arg ISC_ATTR_UNUSED) {
|
||||
isc_tlsctx_cache_create(gmctx, &tls_ctx_cache);
|
||||
|
||||
if (tls_client_key_file == NULL) {
|
||||
result = create_name("tls-non-auth-client", tlsname);
|
||||
result = create_name("tls-non-auth-client", namedata,
|
||||
sizeof(namedata), &tlsname);
|
||||
check_result(result, "create_name (tls-non-auth-client)");
|
||||
transport = dns_transport_new(tlsname, DNS_TRANSPORT_TLS,
|
||||
transport = dns_transport_new(&tlsname, DNS_TRANSPORT_TLS,
|
||||
transport_list);
|
||||
dns_transport_set_tlsname(transport, "tls-non-auth-client");
|
||||
} else {
|
||||
result = create_name("tls-auth-client", tlsname);
|
||||
result = create_name("tls-auth-client", namedata,
|
||||
sizeof(namedata), &tlsname);
|
||||
check_result(result, "create_name (tls-auth-client)");
|
||||
transport = dns_transport_new(tlsname, DNS_TRANSPORT_TLS,
|
||||
transport = dns_transport_new(&tlsname, DNS_TRANSPORT_TLS,
|
||||
transport_list);
|
||||
dns_transport_set_tlsname(transport, "tls-auth-client");
|
||||
dns_transport_set_keyfile(transport, tls_client_key_file);
|
||||
@@ -1304,7 +1309,7 @@ parse_name(char **cmdlinep, dns_message_t *msg, dns_name_t **namep) {
|
||||
dns_message_gettempname(msg, namep);
|
||||
isc_buffer_init(&source, word, strlen(word));
|
||||
isc_buffer_add(&source, strlen(word));
|
||||
result = dns_name_fromtext(*namep, &source, dns_rootname, 0);
|
||||
result = dns_name_fromtext(*namep, &source, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
error("invalid owner name: %s", isc_result_totext(result));
|
||||
isc_buffer_invalidate(&source);
|
||||
@@ -1730,7 +1735,7 @@ evaluate_key(char *cmdline) {
|
||||
|
||||
isc_buffer_init(&b, namestr, strlen(namestr));
|
||||
isc_buffer_add(&b, strlen(namestr));
|
||||
result = dns_name_fromtext(mykeyname, &b, dns_rootname, 0);
|
||||
result = dns_name_fromtext(mykeyname, &b, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "could not parse key name\n");
|
||||
return STATUS_SYNTAX;
|
||||
@@ -1784,7 +1789,7 @@ evaluate_zone(char *cmdline) {
|
||||
userzone = dns_fixedname_initname(&fuserzone);
|
||||
isc_buffer_init(&b, word, strlen(word));
|
||||
isc_buffer_add(&b, strlen(word));
|
||||
result = dns_name_fromtext(userzone, &b, dns_rootname, 0);
|
||||
result = dns_name_fromtext(userzone, &b, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
userzone = NULL; /* Lest it point to an invalid name */
|
||||
fprintf(stderr, "could not parse zone name\n");
|
||||
@@ -2609,8 +2614,8 @@ done:
|
||||
if (usegsstsig) {
|
||||
dns_name_free(&tmpzonename, gmctx);
|
||||
dns_name_free(&restart_primary, gmctx);
|
||||
dns_name_init(&tmpzonename);
|
||||
dns_name_init(&restart_primary);
|
||||
dns_name_init(&tmpzonename, 0);
|
||||
dns_name_init(&restart_primary, 0);
|
||||
}
|
||||
done_update();
|
||||
}
|
||||
@@ -2660,9 +2665,9 @@ send_update(dns_name_t *zone, isc_sockaddr_t *primary) {
|
||||
|
||||
result = dns_request_create(requestmgr, updatemsg, srcaddr, primary,
|
||||
req_transport, req_tls_ctx_cache, options,
|
||||
tsigkey, timeout, timeout, udp_timeout,
|
||||
udp_retries, isc_loop_main(loopmgr),
|
||||
update_completed, NULL, &request);
|
||||
tsigkey, timeout, udp_timeout, udp_retries,
|
||||
isc_loop_main(loopmgr), update_completed,
|
||||
NULL, &request);
|
||||
check_result(result, "dns_request_create");
|
||||
|
||||
if (debugging) {
|
||||
@@ -2765,11 +2770,11 @@ recvsoa(void *arg) {
|
||||
srcaddr = localaddr4;
|
||||
}
|
||||
|
||||
result = dns_request_create(
|
||||
requestmgr, soaquery, srcaddr, addr, req_transport,
|
||||
req_tls_ctx_cache, options, NULL, timeout, timeout,
|
||||
udp_timeout, udp_retries, isc_loop_main(loopmgr),
|
||||
recvsoa, reqinfo, &request);
|
||||
result = dns_request_create(requestmgr, soaquery, srcaddr, addr,
|
||||
req_transport, req_tls_ctx_cache,
|
||||
options, NULL, timeout, udp_timeout,
|
||||
udp_retries, isc_loop_main(loopmgr),
|
||||
recvsoa, reqinfo, &request);
|
||||
check_result(result, "dns_request_create");
|
||||
requests++;
|
||||
return;
|
||||
@@ -2876,7 +2881,7 @@ lookforsoa:
|
||||
result = dns_rdata_tostruct(&soarr, &soa, NULL);
|
||||
check_result(result, "dns_rdata_tostruct");
|
||||
|
||||
dns_name_init(&primary);
|
||||
dns_name_init(&primary, NULL);
|
||||
dns_name_clone(&soa.origin, &primary);
|
||||
|
||||
if (userzone != NULL) {
|
||||
@@ -2932,9 +2937,9 @@ lookforsoa:
|
||||
|
||||
#if HAVE_GSSAPI
|
||||
if (usegsstsig) {
|
||||
dns_name_init(&tmpzonename);
|
||||
dns_name_init(&tmpzonename, NULL);
|
||||
dns_name_dup(zname, gmctx, &tmpzonename);
|
||||
dns_name_init(&restart_primary);
|
||||
dns_name_init(&restart_primary, NULL);
|
||||
dns_name_dup(&primary, gmctx, &restart_primary);
|
||||
start_gssrequest(&primary);
|
||||
} else {
|
||||
@@ -2963,7 +2968,7 @@ droplabel:
|
||||
if (nlabels == 1) {
|
||||
fatal("could not find enclosing zone");
|
||||
}
|
||||
dns_name_init(&tname);
|
||||
dns_name_init(&tname, NULL);
|
||||
dns_name_getlabelsequence(name, 1, nlabels - 1, &tname);
|
||||
dns_name_clone(&tname, name);
|
||||
dns_request_destroy(&request);
|
||||
@@ -3004,8 +3009,8 @@ sendrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
|
||||
result = dns_request_create(
|
||||
requestmgr, msg, srcaddr, destaddr, req_transport,
|
||||
req_tls_ctx_cache, options, default_servers ? NULL : tsigkey,
|
||||
timeout, timeout, udp_timeout, udp_retries,
|
||||
isc_loop_main(loopmgr), recvsoa, reqinfo, request);
|
||||
timeout, udp_timeout, udp_retries, isc_loop_main(loopmgr),
|
||||
recvsoa, reqinfo, request);
|
||||
check_result(result, "dns_request_create");
|
||||
requests++;
|
||||
}
|
||||
@@ -3070,8 +3075,8 @@ failed_gssrequest(void) {
|
||||
|
||||
dns_name_free(&tmpzonename, gmctx);
|
||||
dns_name_free(&restart_primary, gmctx);
|
||||
dns_name_init(&tmpzonename);
|
||||
dns_name_init(&restart_primary);
|
||||
dns_name_init(&tmpzonename, NULL);
|
||||
dns_name_init(&restart_primary, NULL);
|
||||
|
||||
done_update();
|
||||
}
|
||||
@@ -3118,7 +3123,7 @@ start_gssrequest(dns_name_t *primary) {
|
||||
RUNTIME_CHECK(result < sizeof(servicename));
|
||||
isc_buffer_init(&buf, servicename, strlen(servicename));
|
||||
isc_buffer_add(&buf, strlen(servicename));
|
||||
result = dns_name_fromtext(servname, &buf, dns_rootname, 0);
|
||||
result = dns_name_fromtext(servname, &buf, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("dns_name_fromtext(servname) failed: %s",
|
||||
isc_result_totext(result));
|
||||
@@ -3135,7 +3140,7 @@ start_gssrequest(dns_name_t *primary) {
|
||||
isc_buffer_init(&buf, mykeystr, strlen(mykeystr));
|
||||
isc_buffer_add(&buf, strlen(mykeystr));
|
||||
|
||||
result = dns_name_fromtext(keyname, &buf, dns_rootname, 0);
|
||||
result = dns_name_fromtext(keyname, &buf, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("dns_name_fromtext(keyname) failed: %s",
|
||||
isc_result_totext(result));
|
||||
@@ -3205,11 +3210,10 @@ send_gssrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
|
||||
srcaddr = localaddr4;
|
||||
}
|
||||
|
||||
result = dns_request_create(requestmgr, msg, srcaddr, destaddr,
|
||||
req_transport, req_tls_ctx_cache, options,
|
||||
tsigkey, timeout, timeout, udp_timeout,
|
||||
udp_retries, isc_loop_main(loopmgr),
|
||||
recvgss, reqinfo, request);
|
||||
result = dns_request_create(
|
||||
requestmgr, msg, srcaddr, destaddr, req_transport,
|
||||
req_tls_ctx_cache, options, tsigkey, timeout, udp_timeout,
|
||||
udp_retries, isc_loop_main(loopmgr), recvgss, reqinfo, request);
|
||||
check_result(result, "dns_request_create");
|
||||
if (debugging) {
|
||||
show_message(stdout, msg, "Outgoing update query:");
|
||||
@@ -3294,7 +3298,7 @@ recvgss(void *arg) {
|
||||
servname = dns_fixedname_initname(&fname);
|
||||
isc_buffer_init(&buf, servicename, strlen(servicename));
|
||||
isc_buffer_add(&buf, strlen(servicename));
|
||||
result = dns_name_fromtext(servname, &buf, dns_rootname, 0);
|
||||
result = dns_name_fromtext(servname, &buf, dns_rootname, 0, NULL);
|
||||
check_result(result, "dns_name_fromtext");
|
||||
|
||||
result = dns_tkey_gssnegotiate(tsigquery, rcvmsg, servname, &context,
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/getaddresses.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/managers.h>
|
||||
@@ -37,7 +36,6 @@
|
||||
#include <isc/thread.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <dns/lib.h>
|
||||
#include <dns/name.h>
|
||||
|
||||
#include <isccc/alist.h>
|
||||
@@ -145,10 +143,6 @@ command is one of the following:\n\
|
||||
Display RFC 5011 managed keys information\n\
|
||||
managed-keys sync [class [view]]\n\
|
||||
Write RFC 5011 managed keys to disk\n\
|
||||
memprof [ on | off | dump ]\n\
|
||||
Enable / disable memory profiling or dump the profile.\n\
|
||||
Requires named to built with jemalloc and run with the relevant\n\
|
||||
MALLOC_CONF environment variables.\n\
|
||||
modzone zone [class [view]] { zone-options }\n\
|
||||
Modify a zone's configuration.\n\
|
||||
Requires allow-new-zones option.\n\
|
||||
|
||||
@@ -322,19 +322,6 @@ Currently supported commands are:
|
||||
keys in the event of a trust anchor rollover, or as a brute-force
|
||||
repair for key maintenance problems.
|
||||
|
||||
.. option:: memprof [(on | off | dump)]
|
||||
|
||||
This command controls memory profiling. To have any effect, :iscman:`named` must be
|
||||
built with jemalloc, the library have profiling support enabled and run with the
|
||||
``prof:true`` allocator configuration. (either via ``MALLOC_CONF`` or ``/etc/malloc.conf``)
|
||||
|
||||
The ``prof_active:false`` option is recommended to ensure the profiling overhead does
|
||||
not affect :iscman:`named` when not needed.
|
||||
|
||||
The ``on`` and ``off`` options will start and stop the jemalloc memory profiling respectively.
|
||||
When run with the `dump` option, :iscman:`named` will dump the profile to the working
|
||||
directory. The name will be chosen automatically by jemalloc.
|
||||
|
||||
.. option:: modzone zone [class [view]] configuration
|
||||
|
||||
This command modifies the configuration of a zone while the server is running. This
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <isc/attributes.h>
|
||||
#include <isc/formatcheck.h>
|
||||
#include <isc/lang.h>
|
||||
|
||||
#define NS_CONTROL_PORT 953
|
||||
|
||||
@@ -30,8 +31,12 @@
|
||||
notify("%s", name); \
|
||||
} while (0)
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
void
|
||||
notify(const char *fmt, ...) ISC_FORMAT_PRINTF(1, 2);
|
||||
|
||||
ISC_NORETURN void
|
||||
fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -150,6 +150,7 @@ TESTS = \
|
||||
sfcache \
|
||||
shutdown \
|
||||
smartsign \
|
||||
sortlist \
|
||||
spf \
|
||||
staticstub \
|
||||
statistics \
|
||||
|
||||
@@ -34,6 +34,6 @@ zone "." {
|
||||
file "redirect.db";
|
||||
};
|
||||
|
||||
remote-servers "test" {
|
||||
primaries "test" {
|
||||
10.53.0.99;
|
||||
};
|
||||
|
||||
@@ -28,7 +28,6 @@ options {
|
||||
} except-from {
|
||||
"example";
|
||||
};
|
||||
qname-minimization disabled; // Regression test for GL #4652
|
||||
};
|
||||
|
||||
trust-anchors { };
|
||||
|
||||
+1
-1
@@ -11,5 +11,5 @@
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
remote-servers duplicate { 1.2.3.4; };
|
||||
primaries duplicate { 1.2.3.4; };
|
||||
primaries duplicate { 4.3.2.1; };
|
||||
+2
-2
@@ -11,5 +11,5 @@
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
remote-servers duplicate { 1.2.3.4; };
|
||||
remote-servers duplicate { 4.3.2.1; };
|
||||
masters duplicate { 1.2.3.4; };
|
||||
primaries duplicate { 4.3.2.1; };
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
view "test" {
|
||||
remote-servers "net" {
|
||||
parental-agents "net" {
|
||||
192.168.1.2;
|
||||
};
|
||||
zone "example.net" {
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
remote-servers "net" {
|
||||
parental-agents "net" {
|
||||
192.168.1.1;
|
||||
};
|
||||
|
||||
remote-servers "net" {
|
||||
parental-agents "net" {
|
||||
192.168.1.2;
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
remote-servers "net" { };
|
||||
parental-agents "net" { };
|
||||
|
||||
zone "example.net" {
|
||||
type primary;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
remote-servers "com" {
|
||||
parental-agents "com" {
|
||||
192.168.1.2;
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
remote-servers "net" {
|
||||
primaries "net" {
|
||||
192.168.1.2;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
options {
|
||||
dnssec-validation yes;
|
||||
max-zone-ttl 600;
|
||||
|
||||
sortlist { };
|
||||
};
|
||||
|
||||
trust-anchors {
|
||||
|
||||
+2
-2
@@ -11,5 +11,5 @@
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
remote-servers a { 1.2.3.4; };
|
||||
remote-servers b { 1.2.3.4; };
|
||||
masters a { 1.2.3.4; };
|
||||
primaries b { 1.2.3.4; };
|
||||
@@ -86,7 +86,7 @@ options {
|
||||
transfer-source 0.0.0.0;
|
||||
zone-statistics none;
|
||||
};
|
||||
remote-servers "parents" port 5353 source 10.10.10.10 source-v6 2001:db8::10 {
|
||||
parental-agents "parents" port 5353 source 10.10.10.10 source-v6 2001:db8::10 {
|
||||
10.10.10.11;
|
||||
2001:db8::11;
|
||||
};
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
*/
|
||||
|
||||
acl "transferees" {};
|
||||
remote-servers "stealthPrimaries" {127.0.0.1;};
|
||||
remote-servers "publicSecondaries" {127.0.0.1;};
|
||||
primaries "stealthPrimaries" {127.0.0.1;};
|
||||
primaries "publicSecondaries" {127.0.0.1;};
|
||||
zone "example.net" {
|
||||
type secondary;
|
||||
key-directory "/var/lib/bind/example.net";
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
*/
|
||||
|
||||
acl "transferees" {};
|
||||
remote-servers "stealthPrimaries" {127.0.0.1;};
|
||||
remote-servers "publicSecondaries" {127.0.0.1;};
|
||||
primaries "stealthPrimaries" {127.0.0.1;};
|
||||
primaries "publicSecondaries" {127.0.0.1;};
|
||||
zone "example.net" {
|
||||
type secondary;
|
||||
file "/var/cache/bind/example.net.db";
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
*/
|
||||
|
||||
acl "transferees" {};
|
||||
remote-servers "stealthPrimaries" {127.0.0.1;};
|
||||
remote-servers "publicSecondaries" {127.0.0.1;};
|
||||
primaries "stealthPrimaries" {127.0.0.1;};
|
||||
primaries "publicSecondaries" {127.0.0.1;};
|
||||
zone "example.net" {
|
||||
type secondary;
|
||||
key-directory "/var/lib/bind/example.net";
|
||||
|
||||
@@ -184,6 +184,7 @@ echo_i "checking named-checkconf deprecate warnings ($n)"
|
||||
ret=0
|
||||
$CHECKCONF deprecated.conf >checkconf.out$n.1 2>&1 || ret=1
|
||||
grep "option 'max-zone-ttl' is deprecated" <checkconf.out$n.1 >/dev/null || ret=1
|
||||
grep "option 'sortlist' is deprecated" <checkconf.out$n.1 >/dev/null || ret=1
|
||||
if [ $ret -ne 0 ]; then echo_i "failed"; fi
|
||||
status=$((status + ret))
|
||||
# set -i to ignore deprecate warnings
|
||||
@@ -735,5 +736,16 @@ if [ $ret != 0 ]; then
|
||||
fi
|
||||
status=$((status + ret))
|
||||
|
||||
n=$((n + 1))
|
||||
echo_i "check for obsolete option warnings ($n)"
|
||||
ret=0
|
||||
$CHECKCONF warn-obsolete.conf >checkconf.out$n 2>&1 || ret=1
|
||||
grep -F "option 'multi-master' is obsolete and should be removed" checkconf.out$n >/dev/null || ret=1
|
||||
if [ $ret != 0 ]; then
|
||||
echo_i "failed"
|
||||
ret=1
|
||||
fi
|
||||
status=$((status + ret))
|
||||
|
||||
echo_i "exit status: $status"
|
||||
[ $status -eq 0 ] || exit 1
|
||||
|
||||
+4
-14
@@ -11,18 +11,8 @@
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
remote-servers "one" {
|
||||
1.2.3.4;
|
||||
};
|
||||
|
||||
parental-agents "two" {
|
||||
1.2.3.5;
|
||||
};
|
||||
|
||||
primaries "three" {
|
||||
1.2.3.6;
|
||||
};
|
||||
|
||||
masters "four" {
|
||||
1.2.3.7;
|
||||
zone . {
|
||||
type secondary;
|
||||
primaries { 10.53.0.1; 10.53.0.2; };
|
||||
multi-master yes;
|
||||
};
|
||||
@@ -22,8 +22,8 @@ zonefile=root.db
|
||||
|
||||
echo_i "ns1/setup.sh"
|
||||
|
||||
ksk=$("$KEYGEN" -q -fk -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" "$zone")
|
||||
zsk=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" "$zone")
|
||||
ksk=$("$KEYGEN" -q -fk -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
|
||||
zsk=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
|
||||
|
||||
cat "$infile" "$ksk.key" "$zsk.key" >"$zonefile"
|
||||
"$SIGNER" -g -o "$zone" "$zonefile" >/dev/null 2>&1
|
||||
|
||||
@@ -37,7 +37,7 @@ controls {
|
||||
inet 10.53.0.9 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
||||
};
|
||||
|
||||
remote-servers "ns8" port @PORT@ {
|
||||
parental-agents "ns8" port @PORT@ {
|
||||
10.53.0.8;
|
||||
};
|
||||
|
||||
|
||||
@@ -44,10 +44,6 @@ for db in zones/bad*.db; do
|
||||
zones/bad-dns-sd-reverse.db | zones/bad-svcb-servername.db)
|
||||
$CHECKZONE -k fail -i local 0.0.0.0.in-addr.arpa $db >test.out.$n 2>&1 || v=$?
|
||||
;;
|
||||
bad-cname-and*.db)
|
||||
$CHECKZONE -i local example $db >test.out.$n 2>&1 || v=$?
|
||||
grep "CNAME and other data" test.out.$n >/dev/null || ret=1
|
||||
;;
|
||||
*)
|
||||
$CHECKZONE -i local example $db >test.out.$n 2>&1 || v=$?
|
||||
;;
|
||||
@@ -131,13 +127,11 @@ status=$((status + ret))
|
||||
echo_i "checking that log-report-channel zones fail if '*._er/TXT' is missing ($n)"
|
||||
ret=0
|
||||
$CHECKZONE -R fail example zones/er.db >test.out2.$n 2>&1 || ret=1
|
||||
grep -F "no '*._er/TXT' wildcard found" test.out2.$n >/dev/null && ret=1
|
||||
grep -F "no '*._er/TXT' wildcard found" test.out4.$n >/dev/null && ret=1
|
||||
$CHECKZONE example zones/er-missing.db >test.out3.$n 2>&1 || ret=1
|
||||
grep -F "no '*._er/TXT' wildcard found" test.out3.$n >/dev/null && ret=1
|
||||
grep -F "no '*._er/TXT' wildcard found" test.out4.$n >/dev/null && ret=1
|
||||
$CHECKZONE -R fail example zones/er-missing.db >test.out4.$n 2>&1 && ret=1
|
||||
grep -F "no '*._er/TXT' wildcard found" test.out4.$n >/dev/null || ret=1
|
||||
n=$((n + 1))
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=$((status + ret))
|
||||
|
||||
echo_i "checking that raw zone with bad class is handled ($n)"
|
||||
@@ -224,41 +218,5 @@ echo $lines
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=$((status + ret))
|
||||
|
||||
echo_i "Checking for 'zone has A records but is not served by IPv4 servers' warning ($n)"
|
||||
ret=0
|
||||
$CHECKZONE example zones/warn.no-a.server.db >test.out1.$n 2>&1 || ret=1
|
||||
grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null || ret=1
|
||||
grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null && ret=1
|
||||
n=$((n + 1))
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=$((status + ret))
|
||||
|
||||
echo_i "Checking for 'zone has AAAA records but is not served by IPv6 servers' warning ($n)"
|
||||
ret=0
|
||||
$CHECKZONE example zones/warn.no-aaaa.server.db >test.out1.$n 2>&1 || ret=1
|
||||
grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null || ret=1
|
||||
grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null && ret=1
|
||||
n=$((n + 1))
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=$((status + ret))
|
||||
|
||||
echo_i "Checking for 'zone has A records but is not served by IPv4 servers' warning for glue ($n)"
|
||||
ret=0
|
||||
$CHECKZONE example zones/warn.no-a.server.glue.db >test.out1.$n 2>&1 || ret=1
|
||||
grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null || ret=1
|
||||
grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null && ret=1
|
||||
n=$((n + 1))
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=$((status + ret))
|
||||
|
||||
echo_i "Checking for 'zone has AAAA records but is not served by IPv6 servers' warning for glue ($n)"
|
||||
ret=0
|
||||
$CHECKZONE example zones/warn.no-aaaa.server.glue.db >test.out1.$n 2>&1 || ret=1
|
||||
grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null || ret=1
|
||||
grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null && ret=1
|
||||
n=$((n + 1))
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=$((status + ret))
|
||||
|
||||
echo_i "exit status: $status"
|
||||
[ $status -eq 0 ] || exit 1
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad A 192.0.2.1
|
||||
bad CNAME @
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A6 0 ::1
|
||||
bad WKS 10.0.0.1 tcp telnet ftp 0 1 2
|
||||
bad CNAME @
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad AAAA ::1
|
||||
bad CNAME @
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad BAD 65535 .
|
||||
bad CNAME @
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad APL
|
||||
bad CNAME @
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad ATMA +61200000000
|
||||
bad CNAME @
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad ATMRELAY 0 0 0
|
||||
bad CNAME @
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad AVC foo:bar
|
||||
bad CNAME @
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad CAA 128 tbs "Unknown"
|
||||
bad CNAME @
|
||||
@@ -1,20 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad CDNSKEY 512 ( 255 1 AQMFD5raczCJHViKtLYhWGz8hMY
|
||||
9UGRuniJDBzC7w0aRyzWZriO6i2odGWWQVucZqKV
|
||||
sENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esg
|
||||
a60zyGW6LFe9r8n6paHrlG5ojqf0BaqHT+8= )
|
||||
bad CNAME @
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad CDS 30795 1 1 310D27F4D82C1FC2400704EA9939FE6E1CEA A3B9
|
||||
bad CNAME @
|
||||
@@ -1,20 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad CERT 65534 65535 254 (
|
||||
MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45I
|
||||
kskceFGgiWCn/GxHhai6VAuHAoNUz4YoU1t
|
||||
VfSCSqQYn6//11U6Nld80jEeC8aTrO+KKmCaY= )
|
||||
bad CNAME @
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad CSYNC 0 0 A NS AAAA
|
||||
bad CNAME @
|
||||
@@ -1,17 +0,0 @@
|
||||
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
;
|
||||
; SPDX-License-Identifier: MPL-2.0
|
||||
;
|
||||
; 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 https://mozilla.org/MPL/2.0/.
|
||||
;
|
||||
; See the COPYRIGHT file distributed with this work for additional
|
||||
; information regarding copyright ownership.
|
||||
|
||||
$TTL 600
|
||||
@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
|
||||
NS ns
|
||||
ns A 192.0.2.1
|
||||
bad DHCID AAIBY2/AuCccgoJbsaxcQc9TUapptP69l OjxfNuVAA2kjEA=
|
||||
bad CNAME @
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user