Compare commits

..
Author SHA1 Message Date
Ondřej Surý 4483abc880 Use sync_file_range() if available
When rewriting the transaction and journal headers, instead of running
fdatasync() on the whole file use sync_file_range() if available.
2024-11-27 18:55:33 +01:00
Ondřej Surý d097f61706 Disable buffered IO in isc_stdio API
Instead of doing excessive flushes when using isc_stdio API, disable the
buffered IO for the FILE * pointer completely and disable the guts of
the isc_stdio_flush() function as there are no buffered data now.
2024-11-27 18:55:33 +01:00
Ondřej Surý f316e9fee7 Change isc_stdio_sync() to use fdatasync()
THe isc_stdio_sync() would call fsync() and have an extra check that
sync is called only over regular files.  Remove the extra check and use
fdatasync() instead of fsync() to lighten the load.
2024-11-27 18:55:33 +01:00
Ondřej Surý 0786b78ca9 Flush the new journal at very end in dns_journal_compact()
When compacting journal, we don't need to flush/fsync the new journal
continuously, but only at the very end before we close and rename the
journal.

Closes: #3556
2024-11-27 18:55:33 +01:00
Ondřej Surý 47ffd0884c Then rename(2) is guaranteed to succeed
As we don't support Windows anymore, we can rely on the fact that rename
on POSIX guarantees that the newpath will be atomically replaced.
2024-11-27 18:55:33 +01:00
623 changed files with 8489 additions and 10650 deletions
-1
View File
@@ -96,7 +96,6 @@ doc/man/pkcs11-tokens.8in
/GPATH
/GRTAGS
/GTAGS
TAGS
# Emacs specific files
\.dir-locals-2.el
/emacs.desktop
+323 -111
View File
@@ -51,10 +51,11 @@ variables:
# cross-testrun files as there is no need to use that feature in CI.
PYTEST_ADDOPTS: "-p no:cacheprovider"
HYPOTHESIS_PROFILE: "ci"
# Default platforms to run "stress" tests on
BIND_STRESS_TEST_OS: linux
BIND_STRESS_TEST_ARCH: amd64
# Some jobs may clean up the build artifacts unless this is set to 0.
CLEAN_BUILD_ARTIFACTS_ON_SUCCESS: 1
HYPOTHESIS_PROFILE: "ci"
default:
# Allow all running CI jobs to be automatically canceled when a new
@@ -122,8 +123,8 @@ stages:
# Alpine Linux
.alpine-3.21-amd64: &alpine_3_21_amd64_image
image: "$CI_REGISTRY_IMAGE:alpine-3.21-amd64"
.alpine-3.20-amd64: &alpine_3_20_amd64_image
image: "$CI_REGISTRY_IMAGE:alpine-3.20-amd64"
<<: *linux_amd64
# Oracle Linux
@@ -170,16 +171,16 @@ stages:
# Fedora
.tsan-fedora-41-amd64: &tsan_fedora_41_amd64_image
image: "$CI_REGISTRY_IMAGE:tsan-fedora-41-amd64"
.tsan-fedora-40-amd64: &tsan_fedora_40_amd64_image
image: "$CI_REGISTRY_IMAGE:tsan-fedora-40-amd64"
<<: *linux_amd64
.fedora-41-amd64: &fedora_41_amd64_image
image: "$CI_REGISTRY_IMAGE:fedora-41-amd64"
.fedora-40-amd64: &fedora_40_amd64_image
image: "$CI_REGISTRY_IMAGE:fedora-40-amd64"
<<: *linux_amd64
.fedora-41-arm64: &fedora_41_arm64_image
image: "$CI_REGISTRY_IMAGE:fedora-41-arm64"
.fedora-40-arm64: &fedora_40_arm64_image
image: "$CI_REGISTRY_IMAGE:fedora-40-arm64"
<<: *linux_arm64
# Ubuntu
@@ -205,15 +206,15 @@ stages:
### QCOW2 Image Templates
.freebsd-13-amd64: &freebsd_13_amd64_image
image: "freebsd-13.4-x86_64"
image: "freebsd-13.3-x86_64"
<<: *libvirt_amd64
.freebsd-14-amd64: &freebsd_14_amd64_image
image: "freebsd-14.2-x86_64"
image: "freebsd-14.1-x86_64"
<<: *libvirt_amd64
.openbsd-amd64: &openbsd_amd64_image
image: "openbsd-7.6-x86_64"
image: "openbsd-7.5-x86_64"
<<: *libvirt_amd64
### Job Templates
@@ -376,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
@@ -431,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"
@@ -468,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
@@ -567,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
@@ -615,6 +604,11 @@ 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
@@ -630,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/"
@@ -669,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
@@ -768,28 +745,28 @@ cross-version-config-tests:
expire_in: "1 day"
when: always
# Jobs for regular GCC builds on Alpine Linux 3.21 (amd64)
# Jobs for regular GCC builds on Alpine Linux 3.20 (amd64)
gcc:alpine3.21:amd64:
gcc:alpine3.20:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "${WITHOUT_READLINE}"
<<: *alpine_3_21_amd64_image
<<: *alpine_3_20_amd64_image
<<: *build_job
system:gcc:alpine3.21:amd64:
<<: *alpine_3_21_amd64_image
system:gcc:alpine3.20:amd64:
<<: *alpine_3_20_amd64_image
<<: *system_test_job
needs:
- job: gcc:alpine3.21:amd64
- job: gcc:alpine3.20:amd64
artifacts: true
unit:gcc:alpine3.21:amd64:
<<: *alpine_3_21_amd64_image
unit:gcc:alpine3.20:amd64:
<<: *alpine_3_20_amd64_image
<<: *unit_test_job
needs:
- job: gcc:alpine3.21:amd64
- job: gcc:alpine3.20:amd64
artifacts: true
# Jobs for regular GCC builds on Oracle Linux 8 (amd64)
@@ -913,8 +890,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
@@ -924,9 +900,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
@@ -935,7 +910,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
@@ -954,7 +928,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:
@@ -1231,7 +1205,7 @@ unit:gcc:noble:amd64:
- job: gcc:noble:amd64
artifacts: true
# Jobs for ASAN builds on Fedora 41 (amd64)
# Jobs for ASAN builds on Fedora 40 (amd64)
gcc:asan:
variables:
@@ -1239,20 +1213,20 @@ gcc:asan:
CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined"
LDFLAGS: "-fsanitize=address,undefined"
EXTRA_CONFIGURE: "--with-libidn2 --without-jemalloc"
<<: *fedora_41_amd64_image
<<: *fedora_40_amd64_image
<<: *build_job
system:gcc:asan:
variables:
LSAN_OPTIONS: "suppressions=$CI_PROJECT_DIR/suppr-lsan.txt"
<<: *fedora_41_amd64_image
<<: *fedora_40_amd64_image
<<: *system_test_job
needs:
- job: gcc:asan
artifacts: true
unit:gcc:asan:
<<: *fedora_41_amd64_image
<<: *fedora_40_amd64_image
<<: *unit_test_job
needs:
- job: gcc:asan
@@ -1281,7 +1255,7 @@ unit:clang:asan:
- job: clang:asan
artifacts: true
# Jobs for TSAN builds on Fedora 41 (amd64)
# Jobs for TSAN builds on Fedora 40 (amd64)
gcc:tsan:
variables:
@@ -1289,13 +1263,13 @@ gcc:tsan:
CFLAGS: "${CFLAGS_COMMON} -Wno-stringop-overread -ggdb -O2 -fsanitize=thread"
LDFLAGS: "-fsanitize=thread"
EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock --without-jemalloc PKG_CONFIG_PATH=/opt/tsan/lib/pkgconfig"
<<: *tsan_fedora_41_amd64_image
<<: *tsan_fedora_40_amd64_image
<<: *build_job
system:gcc:tsan:
variables:
TSAN_OPTIONS: "${TSAN_OPTIONS_FEDORA}"
<<: *tsan_fedora_41_amd64_image
<<: *tsan_fedora_40_amd64_image
<<: *system_test_tsan_job
needs:
- job: gcc:tsan
@@ -1304,7 +1278,7 @@ system:gcc:tsan:
unit:gcc:tsan:
variables:
TSAN_OPTIONS: "${TSAN_OPTIONS_FEDORA}"
<<: *tsan_fedora_41_amd64_image
<<: *tsan_fedora_40_amd64_image
<<: *unit_test_tsan_job
needs:
- job: gcc:tsan
@@ -1603,10 +1577,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
@@ -1617,10 +1590,9 @@ 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
@@ -1631,11 +1603,10 @@ respdiff:tsan:
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
@@ -1647,10 +1618,9 @@ 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
@@ -1679,39 +1649,281 @@ shotgun:dot:
when: delayed
start_in: 5 minutes
shotgun:doh-get:
<<: *shotgun_job
variables:
SHOTGUN_SCENARIO: doh-get
SHOTGUN_TRAFFIC_MULTIPLIER: 3
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:40:amd64:
<<: *fedora_40_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:40:amd64:
<<: *fedora_40_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:40:amd64:
<<: *fedora_40_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:40:arm64:
<<: *fedora_40_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:40:arm64:
<<: *fedora_40_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:40:arm64:
<<: *fedora_40_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:40:amd64:
<<: *fedora_40_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:40:amd64:
<<: *fedora_40_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:40:amd64:
<<: *fedora_40_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:40:arm64:
<<: *fedora_40_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:40:arm64:
<<: *fedora_40_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:40:arm64:
<<: *fedora_40_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.
@@ -1802,10 +2014,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:
@@ -1821,6 +2033,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,15 +68,15 @@ confidential!
### On the Day of Public Disclosure
- [ ] [:link:][step_clearance] **(IM)** Grant QA & Marketing clearance to proceed with public release
- [ ] [: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_publish] **(QA/Marketing)** Publish the releases (as outlined in the release checklist)
- [ ] [: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
@@ -86,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
@@ -103,25 +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_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_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_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
View File
@@ -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
+47 -130
View File
@@ -112,8 +112,11 @@ add(char *key, int value) {
}
if (symtab == NULL) {
isc_symtab_create(sym_mctx, 100, 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);
@@ -141,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")];
@@ -239,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);
@@ -250,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.
@@ -259,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
@@ -304,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;
@@ -434,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.
@@ -464,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
@@ -499,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:
@@ -522,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;
@@ -531,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.
@@ -553,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
@@ -588,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:
@@ -611,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;
@@ -657,17 +575,17 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
isc_buffer_add(&buffer, strlen(zonename));
origin = dns_fixedname_initname(&fixorigin);
CHECK(dns_name_fromtext(origin, &buffer, dns_rootname, 0, NULL));
dns_zone_setorigin(zone, origin);
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);
@@ -685,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);
+5
View File
@@ -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
+1 -3
View File
@@ -73,9 +73,7 @@ Options
.. option:: -n
Do not print errors when encountering options that are disabled in
this build. This allows checking of configuration files for other
builds, in which those options are enabled.
Do not error on options that are disabled in this build.
.. option:: -p
-4
View File
@@ -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.
+6
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+46 -55
View File
@@ -93,8 +93,7 @@
#define MAXNAME (DNS_NAME_MAXTEXT + 1)
#define MAX_QUERIES 50
#define MAX_TOTAL 200
#define MAX_QUERIES 32
#define MAX_RESTARTS 11
/* Variables used internally by delv. */
@@ -139,7 +138,6 @@ static bool showcomments = true, showdnssec = true, showtrust = true,
yaml = false, fulltrace = false;
static uint32_t maxqueries = MAX_QUERIES;
static uint32_t maxtotal = MAX_TOTAL;
static uint32_t restarts = MAX_RESTARTS;
static bool resolve_trace = false, validator_trace = false,
@@ -228,6 +226,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 "
@@ -667,7 +666,7 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client, dns_view_t *toview) {
if (cfg_obj_isvoid(obj)) {
/*
* "anchortype" is not defined, this must be a static-key
* configured with trust-anchors.
* configured with trusted-keys.
*/
anchortype = STATIC_KEY;
} else {
@@ -787,7 +786,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));
@@ -821,6 +822,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;
}
@@ -828,6 +832,8 @@ static isc_result_t
setup_dnsseckeys(dns_client_t *client, dns_view_t *toview) {
isc_result_t result;
cfg_parser_t *parser = NULL;
const cfg_obj_t *trusted_keys = NULL;
const cfg_obj_t *managed_keys = NULL;
const cfg_obj_t *trust_anchors = NULL;
cfg_obj_t *bindkeys = NULL;
@@ -869,7 +875,16 @@ setup_dnsseckeys(dns_client_t *client, dns_view_t *toview) {
}
INSIST(bindkeys != NULL);
cfg_map_get(bindkeys, "trusted-keys", &trusted_keys);
cfg_map_get(bindkeys, "managed-keys", &managed_keys);
cfg_map_get(bindkeys, "trust-anchors", &trust_anchors);
if (trusted_keys != NULL) {
CHECK(load_keys(trusted_keys, client, toview));
}
if (managed_keys != NULL) {
CHECK(load_keys(managed_keys, client, toview));
}
if (trust_anchors != NULL) {
CHECK(load_keys(trust_anchors, client, toview));
}
@@ -1119,6 +1134,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;
@@ -1145,46 +1168,22 @@ plus_option(char *option) {
break;
case 'm':
switch (cmd[1]) {
case 'a':
switch (cmd[3]) {
case 'q': /* maxqueries */
FULLCHECK("maxqueries");
if (value == NULL) {
goto need_value;
}
if (!state) {
goto invalid_option;
}
result = parse_uint(&maxqueries, value,
UINT_MAX, "maxqueries");
if (result != ISC_R_SUCCESS) {
fatal("Couldn't parse maxqueries");
}
if (maxqueries == 0) {
fatal("maxqueries must be nonzero");
}
break;
case 't': /* maxtotalqueries */
FULLCHECK("maxtotalqueries");
if (value == NULL) {
goto need_value;
}
if (!state) {
goto invalid_option;
}
result = parse_uint(&maxtotal, value, UINT_MAX,
"maxtotalqueries");
if (result != ISC_R_SUCCESS) {
fatal("Couldn't parse maxtotalqueries");
}
if (maxtotal == 0) {
fatal("maxtotalqueries must be "
"nonzero");
}
break;
default:
case 'a': /* maxqueries */
FULLCHECK("maxqueries");
if (value == NULL) {
goto need_value;
}
if (!state) {
goto invalid_option;
}
result = parse_uint(&maxqueries, value, UINT_MAX,
"maxqueries");
if (result != ISC_R_SUCCESS) {
fatal("Couldn't parse maxqueries");
}
if (maxqueries == 0) {
fatal("maxqueries must be nonzero");
}
break;
case 't': /* mtrace */
FULLCHECK("mtrace");
@@ -1932,7 +1931,6 @@ run_resolve(void *arg) {
CHECK(dns_client_create(mctx, loopmgr, netmgr, 0, tlsctx_client_cache,
&client, srcaddr4, srcaddr6));
dns_client_setmaxrestarts(client, restarts);
dns_client_setmaxqueries(client, maxtotal);
/* Set the nameserver */
if (server != NULL) {
@@ -2137,15 +2135,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:
@@ -2197,14 +2189,13 @@ 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);
dns_view_setdstport(view, destport);
dns_view_setmaxrestarts(view, restarts);
dns_view_setmaxqueries(view, maxtotal);
CHECK(dns_rootns_create(mctx, dns_rdataclass_in, hintfile, &roothints));
dns_view_sethints(view, roothints);
+1 -6
View File
@@ -351,12 +351,7 @@ assign values to options like the timeout interval. They have the form
.. option:: +maxqueries
This option specifies the maximum number of queries to send to resolve
a name before giving up. The default is 50.
.. option:: +maxtotalqueries
This option specifies the maximum number of queries to send to resolve
a client request before giving up. The default is 200.
a name before giving up. The default is 32.
.. option:: +trust, +notrust
+9 -14
View File
@@ -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>
@@ -2779,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) {
@@ -2831,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
@@ -3045,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) {
@@ -3066,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;
+5
View File
@@ -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;
@@ -463,3 +466,5 @@ dig_shutdown(void);
bool
dig_lookup_is_tls(const dig_lookup_t *lookup);
ISC_LANG_ENDDECLS
+4 -1
View File
@@ -381,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':
@@ -417,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;
+1 -1
View File
@@ -190,7 +190,7 @@ usage(void) {
"(default: AUTHCONF)\n");
fprintf(stderr, " -h: print usage and exit\n");
fprintf(stderr, " -m <memory debugging mode>:\n");
fprintf(stderr, " usage | trace | record\n");
fprintf(stderr, " usage | trace | record | size | mctx\n");
fprintf(stderr, " -v <level>: set verbosity level (0 - 10)\n");
fprintf(stderr, " -V: print version information\n");
fprintf(stderr, "Timing options:\n");
+17 -34
View File
@@ -419,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);
@@ -539,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);
@@ -550,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->pubkey;
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 */
@@ -582,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 "
@@ -609,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) {
@@ -687,10 +673,6 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
for (key = ISC_LIST_HEAD(keylist); key != NULL;
key = ISC_LIST_NEXT(key, link))
{
if (REVOKE(key->key) && set->type != dns_rdatatype_dnskey) {
continue;
}
if (nowsignedby[key->index]) {
continue;
}
@@ -3386,12 +3368,9 @@ main(int argc, char *argv[]) {
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:"
/*
@@ -3565,6 +3544,10 @@ main(int argc, char *argv[]) {
}
break;
case 'l':
fatal("-l option (DLV lookaside) is obsolete");
break;
case 'M':
endp = NULL;
set_maxttl = true;
+2 -7
View File
@@ -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
+3 -1
View File
@@ -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);
+34 -22
View File
@@ -168,8 +168,7 @@ options {\n\
max-clients-per-query 100;\n\
max-ncache-ttl 10800; /* 3 hours */\n\
max-recursion-depth 7;\n\
max-recursion-queries 50;\n\
max-query-count 200;\n\
max-recursion-queries 32;\n\
max-query-restarts 11;\n\
max-stale-ttl 86400; /* 1 day */\n\
message-compression yes;\n\
@@ -193,6 +192,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\
@@ -331,7 +331,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\
@@ -503,9 +503,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;
@@ -532,6 +532,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) {
@@ -580,12 +597,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;
@@ -668,6 +683,8 @@ newlist:
isc_sockaddr_any6(&src6);
}
result = ISC_R_NOMEMORY;
element = cfg_list_first(addrlist);
resume:
for (; element != NULL; element = cfg_list_next(element)) {
@@ -698,22 +715,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;
-2
View File
@@ -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)) {
+9 -6
View File
@@ -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;
}
@@ -842,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));
+1
View File
@@ -17,6 +17,7 @@
#include <inttypes.h>
#include <isc/lang.h>
#include <isc/types.h>
#include <dns/clientinfo.h>
+3 -2
View File
@@ -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,
-1
View File
@@ -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"
-12
View File
@@ -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);
+6 -1
View File
@@ -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
+5
View File
@@ -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
+6 -2
View File
@@ -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
+5
View File
@@ -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
+9 -2
View File
@@ -309,7 +309,7 @@ usage(void) {
" [-S sockets] [-t chrootdir] [-u "
"username] [-U listeners]\n"
" [-m "
"{usage|trace|record}]\n"
"{usage|trace|record|size|mctx}]\n"
" [-M fill|nofill]\n"
"usage: named [-v|-V|-C]\n");
}
@@ -1414,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",
+1 -1
View File
@@ -108,7 +108,7 @@ Options
.. option:: -m flag
This option turns on memory usage debugging flags. Possible flags are ``usage``,
``trace`` and ``record``. These correspond to the
``trace``, ``record``, ``size``, and ``mctx``. These correspond to the
``ISC_MEM_DEBUGXXXX`` flags described in ``<isc/mem.h>``.
.. option:: -n #cpus
+274 -319
View File
@@ -140,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
@@ -367,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.
*/
@@ -609,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,
@@ -929,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
@@ -966,11 +995,11 @@ process_key(const cfg_obj_t *key, dns_keytable_t *secroots,
}
/*
* Add the key to 'secroots'. Keys from a "trust-anchors" statement
* may be either static or initializing keys. If it's not initializing,
* we don't want to treat it as managed, so we use 'initializing'
* twice here, for both the 'managed' and 'initializing' arguments to
* dns_keytable_add().
* Add the key to 'secroots'. Keys from a "trust-anchors" or
* "managed-keys" statement may be either static or initializing
* keys. If it's not initializing, we don't want to treat it as
* managed, so we use 'initializing' twice here, for both the
* 'managed' and 'initializing' arguments to dns_keytable_add().
*/
result = dns_keytable_add(secroots, initializing, initializing, keyname,
&ds, sfd_add, view);
@@ -1010,6 +1039,9 @@ cleanup:
if (secroots != NULL) {
dns_keytable_detach(&secroots);
}
if (result == DST_R_NOCRYPTO) {
result = ISC_R_SUCCESS;
}
return result;
}
@@ -1050,7 +1082,11 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
const cfg_obj_t *config, const cfg_obj_t *bindkeys,
bool auto_root) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *view_keys = NULL;
const cfg_obj_t *global_keys = NULL;
const cfg_obj_t *view_managed_keys = NULL;
const cfg_obj_t *view_trust_anchors = NULL;
const cfg_obj_t *global_managed_keys = NULL;
const cfg_obj_t *global_trust_anchors = NULL;
const cfg_obj_t *maps[4];
const cfg_obj_t *voptions = NULL;
@@ -1069,15 +1105,26 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
if (vconfig != NULL) {
voptions = cfg_tuple_get(vconfig, "options");
if (voptions != NULL) {
(void)cfg_map_get(voptions, "trusted-keys", &view_keys);
/* managed-keys and trust-anchors are synonyms. */
(void)cfg_map_get(voptions, "managed-keys",
&view_managed_keys);
(void)cfg_map_get(voptions, "trust-anchors",
&view_trust_anchors);
maps[i++] = voptions;
}
}
if (config != NULL) {
(void)cfg_map_get(config, "trusted-keys", &global_keys);
/* managed-keys and trust-anchors are synonyms. */
(void)cfg_map_get(config, "managed-keys", &global_managed_keys);
(void)cfg_map_get(config, "trust-anchors",
&global_trust_anchors);
(void)cfg_map_get(config, "options", &options);
if (options != NULL) {
maps[i++] = options;
@@ -1142,8 +1189,13 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
}
if (view->rdclass == dns_rdataclass_in) {
CHECK(load_view_keys(view_keys, view, false, NULL));
CHECK(load_view_keys(view_trust_anchors, view, true, NULL));
CHECK(load_view_keys(view_managed_keys, view, true, NULL));
CHECK(load_view_keys(global_keys, view, false, NULL));
CHECK(load_view_keys(global_trust_anchors, view, true, NULL));
CHECK(load_view_keys(global_managed_keys, view, true, NULL));
}
/*
@@ -1181,6 +1233,36 @@ cleanup:
return result;
}
static isc_result_t
mustbesecure(const cfg_obj_t *mbs, dns_resolver_t *resolver) {
const cfg_listelt_t *element;
const cfg_obj_t *obj;
const char *str;
dns_fixedname_t fixed;
dns_name_t *name;
bool value;
isc_result_t result;
isc_buffer_t b;
name = dns_fixedname_initname(&fixed);
for (element = cfg_list_first(mbs); element != NULL;
element = cfg_list_next(element))
{
obj = cfg_listelt_value(element);
str = cfg_obj_asstring(cfg_tuple_get(obj, "name"));
isc_buffer_constinit(&b, str, strlen(str));
isc_buffer_add(&b, strlen(str));
CHECK(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
value = cfg_obj_asboolean(cfg_tuple_get(obj, "value"));
CHECK(dns_resolver_setmustbesecure(resolver, name, value));
}
result = ISC_R_SUCCESS;
cleanup:
return result;
}
/*%
* Get a dispatch appropriate for the resolver of a given view.
*/
@@ -1314,7 +1396,13 @@ configure_order(dns_order_t *order, const cfg_obj_t *ent) {
obj = cfg_tuple_get(ent, "ordering");
INSIST(cfg_obj_isstring(obj));
str = cfg_obj_asstring(obj);
if (!strcasecmp(str, "random")) {
if (!strcasecmp(str, "fixed")) {
#if DNS_RDATASET_FIXED
mode = DNS_RDATASETATTR_FIXEDORDER;
#else /* if DNS_RDATASET_FIXED */
mode = DNS_RDATASETATTR_CYCLIC;
#endif /* DNS_RDATASET_FIXED */
} else if (!strcasecmp(str, "random")) {
mode = DNS_RDATASETATTR_RANDOMIZE;
} else if (!strcasecmp(str, "cyclic")) {
mode = DNS_RDATASETATTR_CYCLIC;
@@ -1330,12 +1418,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
@@ -1694,7 +1785,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.
@@ -1736,7 +1827,9 @@ setquerystats(dns_zone_t *zone, isc_mem_t *mctx, dns_zonestat_level_t level) {
static named_cache_t *
cachelist_find(named_cachelist_t *cachelist, const char *cachename,
dns_rdataclass_t rdclass) {
for (named_cache_t *nsc = ISC_LIST_HEAD(*cachelist); nsc != NULL;
named_cache_t *nsc;
for (nsc = ISC_LIST_HEAD(*cachelist); nsc != NULL;
nsc = ISC_LIST_NEXT(nsc, link))
{
if (nsc->rdclass == rdclass &&
@@ -1754,13 +1847,12 @@ cache_reusable(dns_view_t *originview, dns_view_t *view,
bool new_zero_no_soattl) {
if (originview->rdclass != view->rdclass ||
originview->checknames != view->checknames ||
dns_resolver_getzeronosoattl(originview->resolver) !=
new_zero_no_soattl ||
originview->acceptexpired != view->acceptexpired ||
originview->enablevalidation != view->enablevalidation ||
originview->maxcachettl != view->maxcachettl ||
originview->maxncachettl != view->maxncachettl ||
originview->resolver == NULL ||
dns_resolver_getzeronosoattl(originview->resolver) !=
new_zero_no_soattl)
originview->maxncachettl != view->maxncachettl)
{
return false;
}
@@ -1863,7 +1955,7 @@ dns64_reverse(dns_view_t *view, isc_mem_t *mctx, isc_netaddr_t *na,
isc_buffer_add(&b, strlen(reverse));
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);
@@ -2789,8 +2881,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");
@@ -3233,7 +3325,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);
@@ -3340,7 +3432,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);
@@ -3715,9 +3807,9 @@ static const char *const response_synonyms[] = { "response", NULL };
static isc_result_t
configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
cfg_obj_t *vconfig, named_cachelist_t *cachelist,
named_cachelist_t *oldcachelist, dns_kasplist_t *kasplist,
dns_keystorelist_t *keystores, const cfg_obj_t *bindkeys,
isc_mem_t *mctx, cfg_aclconfctx_t *actx, bool need_hints) {
dns_kasplist_t *kasplist, dns_keystorelist_t *keystores,
const cfg_obj_t *bindkeys, isc_mem_t *mctx,
cfg_aclconfctx_t *actx, bool need_hints) {
const cfg_obj_t *maps[4];
const cfg_obj_t *cfgmaps[3];
const cfg_obj_t *optionmaps[3];
@@ -3769,7 +3861,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
isc_stats_t *resstats = NULL;
dns_stats_t *resquerystats = NULL;
bool auto_root = false;
named_cache_t *nsc = NULL;
named_cache_t *nsc;
bool zero_no_soattl;
dns_acl_t *clients = NULL, *mapped = NULL, *excluded = NULL;
unsigned int query_timeout;
@@ -3778,7 +3870,6 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
dns_ntatable_t *ntatable = NULL;
const char *qminmode = NULL;
dns_adb_t *adb = NULL;
bool oldcache = false;
REQUIRE(DNS_VIEW_VALID(view));
@@ -3923,6 +4014,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) {
@@ -4152,9 +4248,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,
@@ -4320,94 +4419,81 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
} else {
cachename = view->name;
}
cache = NULL;
nsc = cachelist_find(cachelist, cachename, view->rdclass);
if (result == ISC_R_SUCCESS && nsc == NULL) {
/*
* If we're using 'attach-cache' but didn't find the
* specified cache in the cache list already, check
* the old list.
*/
nsc = cachelist_find(oldcachelist, cachename, view->rdclass);
oldcache = true;
}
if (nsc != NULL) {
if (!cache_sharable(nsc->primaryview, view, zero_no_soattl,
max_cache_size, max_stale_ttl,
stale_refresh_time))
{
isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"view %s can't use existing cache %s due "
"to configuration parameter mismatch",
view->name,
dns_cache_getname(nsc->cache));
nsc = NULL;
} else {
if (oldcache) {
ISC_LIST_UNLINK(*oldcachelist, nsc, link);
ISC_LIST_APPEND(*cachelist, nsc, link);
nsc->primaryview = view;
}
dns_cache_attach(nsc->cache, &cache);
shared_cache = true;
}
} else if (strcmp(cachename, view->name) == 0) {
result = dns_viewlist_find(&named_g_server->viewlist, cachename,
view->rdclass, &pview);
if (result != ISC_R_NOTFOUND && result != ISC_R_SUCCESS) {
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"views %s and %s can't share the cache "
"due to configuration parameter mismatch",
nsc->primaryview->name, view->name);
result = ISC_R_FAILURE;
goto cleanup;
}
if (pview != NULL) {
if (!cache_reusable(pview, view, zero_no_soattl)) {
isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER,
ISC_LOG_DEBUG(1),
"cache cannot be reused "
"for view %s due to "
"configuration parameter "
"mismatch",
view->name);
} else {
INSIST(pview->cache != NULL);
isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER,
ISC_LOG_DEBUG(3),
"reusing existing cache");
dns_cache_attach(pview->cache, &cache);
dns_cache_attach(nsc->cache, &cache);
shared_cache = true;
} else {
if (strcmp(cachename, view->name) == 0) {
result = dns_viewlist_find(&named_g_server->viewlist,
cachename, view->rdclass,
&pview);
if (result != ISC_R_NOTFOUND && result != ISC_R_SUCCESS)
{
goto cleanup;
}
if (pview != NULL) {
if (!cache_reusable(pview, view,
zero_no_soattl))
{
isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER,
ISC_LOG_DEBUG(1),
"cache cannot be reused "
"for view %s due to "
"configuration parameter "
"mismatch",
view->name);
} else {
INSIST(pview->cache != NULL);
isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER,
ISC_LOG_DEBUG(3),
"reusing existing cache");
dns_cache_attach(pview->cache, &cache);
}
dns_resolver_getstats(pview->resolver,
&resstats);
dns_resolver_getquerystats(pview->resolver,
&resquerystats);
dns_view_detach(&pview);
}
dns_resolver_getstats(pview->resolver, &resstats);
dns_resolver_getquerystats(pview->resolver,
&resquerystats);
dns_view_detach(&pview);
}
}
if (nsc == NULL) {
/*
* Create a cache with the desired name. This normally
* equals the view name, but may also be a forward
* reference to a view that share the cache with this
* view but is not yet configured. If it is not the
* view name but not a forward reference either, then it
* is simply a named cache that is not shared.
*/
if (cache == NULL) {
/*
* Create a cache with the desired name. This normally
* equals the view name, but may also be a forward
* reference to a view that share the cache with this
* view but is not yet configured. If it is not the
* view name but not a forward reference either, then it
* is simply a named cache that is not shared.
*/
CHECK(dns_cache_create(named_g_loopmgr, view->rdclass,
cachename, mctx, &cache));
}
nsc = isc_mem_get(mctx, sizeof(*nsc));
*nsc = (named_cache_t){
.primaryview = view,
.rdclass = view->rdclass,
.link = ISC_LINK_INITIALIZER,
};
nsc->cache = NULL;
dns_cache_attach(cache, &nsc->cache);
nsc->primaryview = view;
nsc->needflush = false;
nsc->adbsizeadjusted = false;
nsc->rdclass = view->rdclass;
ISC_LINK_INIT(nsc, link);
ISC_LIST_APPEND(*cachelist, nsc, link);
}
dns_view_setcache(view, cache, shared_cache);
dns_cache_setcachesize(cache, max_cache_size);
@@ -4750,7 +4836,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))
{
@@ -4772,7 +4858,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))
{
@@ -5078,6 +5164,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
@@ -5200,11 +5292,6 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
INSIST(result == ISC_R_SUCCESS);
dns_view_setmaxrestarts(view, cfg_obj_asuint32(obj));
obj = NULL;
result = named_config_get(maps, "max-query-count", &obj);
INSIST(result == ISC_R_SUCCESS);
dns_view_setmaxqueries(view, cfg_obj_asuint32(obj));
obj = NULL;
result = named_config_get(maps, "max-validations-per-fetch", &obj);
if (result == ISC_R_SUCCESS) {
@@ -5276,6 +5363,12 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
CHECK(configure_view_dnsseckeys(view, vconfig, config, bindkeys,
auto_root));
obj = NULL;
result = named_config_get(maps, "dnssec-must-be-secure", &obj);
if (result == ISC_R_SUCCESS) {
CHECK(mustbesecure(obj, view->resolver));
}
obj = NULL;
result = named_config_get(maps, "nta-recheck", &obj);
INSIST(result == ISC_R_SUCCESS);
@@ -5318,9 +5411,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));
@@ -6162,8 +6255,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));
@@ -6367,7 +6464,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));
@@ -6470,7 +6567,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);
@@ -6528,7 +6625,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));
@@ -6629,14 +6726,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);
@@ -6796,8 +6893,7 @@ tat_done(void *arg) {
if (resp->db != NULL) {
dns_db_detach(&resp->db);
}
dns_resolver_freefresp(&resp);
isc_mem_putanddetach(&resp->mctx, resp, sizeof(*resp));
dns_resolver_destroyfetch(&tat->fetch);
if (dns_rdataset_isassociated(&tat->rdataset)) {
dns_rdataset_disassociate(&tat->rdataset);
@@ -6935,8 +7031,8 @@ tat_send(void *arg) {
if (result == ISC_R_SUCCESS) {
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,
domain, &nameservers, NULL, NULL, 0, 0, 0, NULL,
tat->loop, tat_done, tat, &tat->rdataset,
&tat->sigrdataset, &tat->fetch);
}
@@ -7842,7 +7938,8 @@ load_configuration(const char *filename, named_server_t *server,
dns_keystore_t *keystore = NULL;
dns_keystore_t *keystore_next = NULL;
dns_keystorelist_t tmpkeystorelist, keystorelist;
const cfg_obj_t *views = NULL;
const cfg_obj_t *views;
dns_view_t *view_next = NULL;
dns_viewlist_t tmpviewlist;
dns_viewlist_t viewlist, builtin_viewlist;
@@ -7860,7 +7957,7 @@ load_configuration(const char *filename, named_server_t *server,
uint32_t send_tcp_buffer_size;
uint32_t recv_udp_buffer_size;
uint32_t send_udp_buffer_size;
named_cache_t *nsc = NULL;
named_cache_t *nsc;
named_cachelist_t cachelist, tmpcachelist;
ns_altsecret_t *altsecret;
ns_altsecretlist_t altsecrets, tmpaltsecrets;
@@ -8249,8 +8346,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) {
@@ -8258,7 +8367,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);
@@ -8276,7 +8385,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)) {
@@ -8355,7 +8464,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;
}
}
@@ -8402,13 +8511,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,
@@ -8426,13 +8535,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,
@@ -8462,7 +8571,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;
}
}
@@ -8704,8 +8813,7 @@ load_configuration(const char *filename, named_server_t *server,
}
result = configure_view(view, &viewlist, config, vconfig,
&cachelist, &server->cachelist,
&server->kasplist,
&cachelist, &server->kasplist,
&server->keystorelist, bindkeys,
named_g_mctx, named_g_aclconfctx, true);
if (result != ISC_R_SUCCESS) {
@@ -8727,8 +8835,7 @@ load_configuration(const char *filename, named_server_t *server,
goto cleanup_cachelist;
}
result = configure_view(view, &viewlist, config, NULL,
&cachelist, &server->cachelist,
&server->kasplist,
&cachelist, &server->kasplist,
&server->keystorelist, bindkeys,
named_g_mctx, named_g_aclconfctx, true);
if (result != ISC_R_SUCCESS) {
@@ -8758,9 +8865,8 @@ load_configuration(const char *filename, named_server_t *server,
result = configure_view(
view, &viewlist, config, vconfig, &cachelist,
&server->cachelist, &server->kasplist,
&server->keystorelist, bindkeys, named_g_mctx,
named_g_aclconfctx, false);
&server->kasplist, &server->keystorelist, bindkeys,
named_g_mctx, named_g_aclconfctx, false);
if (result != ISC_R_SUCCESS) {
dns_view_detach(&view);
goto cleanup_cachelist;
@@ -9269,8 +9375,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:
@@ -10083,39 +10191,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,
@@ -11988,10 +12063,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),
@@ -14611,16 +14682,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
@@ -16202,113 +16267,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 */
+4 -1
View File
@@ -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);
+30 -18
View File
@@ -61,6 +61,13 @@ typedef enum {
allow_update_forwarding
} acl_type_t;
#define RETERR(x) \
do { \
isc_result_t _r = (x); \
if (_r != ISC_R_SUCCESS) \
return ((_r)); \
} while (0)
#define CHECK(x) \
do { \
result = (x); \
@@ -570,12 +577,9 @@ configure_staticstub(const cfg_obj_t *zconfig, dns_zone_t *zone,
isc_region_t region;
/* Create the DB beforehand */
result = dns_db_create(mctx, dbtype, dns_zone_getorigin(zone),
dns_dbtype_stub, dns_zone_getclass(zone), 0,
NULL, &db);
if (result != ISC_R_SUCCESS) {
return result;
}
RETERR(dns_db_create(mctx, dbtype, dns_zone_getorigin(zone),
dns_dbtype_stub, dns_zone_getclass(zone), 0, NULL,
&db));
dns_rdataset_init(&rdataset);
@@ -978,6 +982,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 +1113,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 +1277,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);
@@ -1620,7 +1631,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 +1683,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);
@@ -1845,7 +1857,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,8 +1865,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_setprimaries(mayberaw, ipkl.addrs,
ipkl.sources, ipkl.keys,
ipkl.tlss, ipkl.count);
+18 -17
View File
@@ -766,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);
@@ -2663,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) {
@@ -2768,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;
@@ -3007,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++;
}
@@ -3208,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:");
-4
View File
@@ -143,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\
+3 -15
View File
@@ -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
@@ -504,8 +491,9 @@ Currently supported commands are:
.. option:: secroots [-] [view ...]
This command dumps the security roots (i.e., trust anchors configured via
``trust-anchors`` statement, or ``dnssec-validation auto``) and negative
trust anchors for the specified views. If no view is specified, all views are
``trust-anchors``, or the ``managed-keys`` or ``trusted-keys`` statements
[both deprecated], or ``dnssec-validation auto``) and negative trust anchors
for the specified views. If no view is specified, all views are
dumped. Security roots indicate whether they are configured as trusted
keys, managed keys, or initializing managed keys (managed keys that have not
yet been updated by a successful key refresh query).
+5
View File
@@ -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
+10 -1
View File
@@ -25,6 +25,7 @@ if HAVE_PYTEST
noinst_PROGRAMS = \
feature-test \
makejournal \
pipelined/pipequeries \
rndc/gencheck
@@ -38,6 +39,14 @@ feature_test_LDADD = \
$(LIBDNS_LIBS) \
$(OPENSSL_LIBS)
makejournal_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(LIBDNS_CFLAGS)
makejournal_LDADD = \
$(LDADD) \
$(LIBDNS_LIBS)
pipelined_pipequeries_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(LIBDNS_CFLAGS)
@@ -62,7 +71,6 @@ TESTS = \
autosign \
builtin \
cacheclean \
camp \
case \
catz \
cds \
@@ -141,6 +149,7 @@ TESTS = \
sfcache \
shutdown \
smartsign \
sortlist \
spf \
staticstub \
statistics \
+1 -1
View File
@@ -34,6 +34,6 @@ zone "." {
file "redirect.db";
};
remote-servers "test" {
primaries "test" {
10.53.0.99;
};
+4
View File
@@ -52,6 +52,10 @@ ns.secure A 10.53.0.3
insecure NS ns.insecure
ns.insecure A 10.53.0.3
; A insecure subdomain
mustbesecure NS ns.mustbesecure
ns.mustbesecure A 10.53.0.3
z A 10.0.0.26
nsec3 NS ns.nsec3
@@ -52,6 +52,10 @@ ns.secure A 10.53.0.3
insecure NS ns.insecure
ns.insecure A 10.53.0.3
; A insecure subdomain
mustbesecure NS ns.mustbesecure
ns.mustbesecure A 10.53.0.3
z A 10.0.0.26
nsec3 NS ns.nsec3
@@ -23,6 +23,7 @@ options {
listen-on-v6 { none; };
recursion yes;
dnssec-validation yes;
dnssec-must-be-secure mustbesecure.example yes;
};
zone "." {
-51
View File
@@ -1,51 +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 300
. IN SOA gson.nominum.com. a.root.servers.nil. (
2000042100 ; serial
600 ; refresh
600 ; retry
1200 ; expire
600 ; minimum
)
. NS a.root-servers.nil.
a.root-servers.nil. A 10.53.0.1
tld0. NS ns.tld0.
ns.tld0. A 10.53.0.2
tld1. NS ns.tld1.
ns.tld1. A 10.53.0.2
tld2. NS ns.tld2.
ns.tld2. A 10.53.0.2
tld3. NS ns.tld3.
ns.tld3. A 10.53.0.2
tld4. NS ns.tld4.
ns.tld4. A 10.53.0.2
tld5. NS ns.tld5.
ns.tld5. A 10.53.0.2
tld6. NS ns.tld6.
ns.tld6. A 10.53.0.2
tld7. NS ns.tld7.
ns.tld7. A 10.53.0.2
tld8. NS ns.tld8.
ns.tld8. A 10.53.0.2
tld9. NS ns.tld9.
ns.tld9. A 10.53.0.2
-57
View File
@@ -1,57 +0,0 @@
#!/bin/sh -e
# 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.
# shellcheck source=conf.sh
. ../../conf.sh
echo_i "ns2/setup.sh"
cp template.db.in tld0.db
echo "final.tld0. IN NS ns.final.tld0." >>tld0.db
echo "ns.final.tld0. IN A 10.53.0.3" >>tld0.db
DEPTH=5
tld=1
while [ $tld -le $DEPTH ]; do
cat >>"named.conf" <<EOF
zone "tld${tld}" {
type primary;
file "tld${tld}.db";
};
EOF
cp template.db.in tld${tld}.db
label=0
while [ $label -le $DEPTH ]; do
echo "label${label}.tld${tld}. IN NS ns.label${label}.tld${tld}." >>tld${tld}.db
echo "ns.label${label}.tld${tld}. IN A 10.53.0.3" >>tld${tld}.db
echo "" >>tld${tld}.db
label=$((label + 1))
done
tld=$((tld + 1))
done
goto=1
tld=1
while [ $goto -le $DEPTH ]; do
echo "goto${goto}.tld${tld}. IN NS ns.goto${goto}.tld${tld}." >>tld${tld}.db
echo "ns.goto${goto}.tld${tld}. IN A 10.53.0.3" >>tld${tld}.db
echo "" >>tld${tld}.db
goto=$((goto + 1))
done
-42
View File
@@ -1,42 +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.
*/
// NS3
options {
query-source address 10.53.0.3;
notify-source 10.53.0.3;
transfer-source 10.53.0.3;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.3; };
listen-on-v6 { none; };
recursion yes;
dnssec-validation no;
max-query-count 150;
};
key rndc_key {
secret "1234abcd8765";
algorithm @DEFAULT_HMAC@;
};
controls {
inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
zone "final.tld0" {
type primary;
file "final.tld0.db";
};
-79
View File
@@ -1,79 +0,0 @@
#!/bin/sh -e
# 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.
# shellcheck source=conf.sh
. ../../conf.sh
echo_i "ns3/setup.sh"
cp template.db.in final.tld0.db
echo "q.final.tld0. IN A 1.2.3.4" >>final.tld0.db
DEPTH=5
tld=1
while [ $tld -le $DEPTH ]; do
nexttld=$((tld + 1))
label=1
while [ $label -le $DEPTH ]; do
nextlabel=$((label + 1))
cat >>"named.conf" <<EOF
zone "label${label}.tld${tld}" {
type primary;
file "label${label}.tld${tld}.db";
};
EOF
cp template.db.in label${label}.tld${tld}.db
if [ $label -eq $DEPTH ] && [ $tld -eq $DEPTH ]; then
echo "q.label${label}.tld${tld}. IN CNAME q.goto1.tld1." >>label${label}.tld${tld}.db
elif [ $tld -eq $DEPTH ]; then
nextlabel=$((label + 1))
echo "q.label${label}.tld${tld}. IN CNAME q.label${nextlabel}.tld1." >>label${label}.tld${tld}.db
else
echo "q.label${label}.tld${tld}. IN CNAME q.label${label}.tld${nexttld}." >>label${label}.tld${tld}.db
fi
label=$nextlabel
done
echo "" >>label${label}.tld${tld}.db
tld=$nexttld
done
goto=1
tld=1
while [ $goto -le $DEPTH ]; do
nextgoto=$((goto + 1))
cat >>"named.conf" <<EOF
zone "goto${goto}.tld${tld}" {
type primary;
file "goto${goto}.tld${tld}.db";
};
EOF
cp template.db.in goto${goto}.tld${tld}.db
if [ $goto -eq $DEPTH ]; then
echo "q.goto${goto}.tld${tld}. IN CNAME q.final.tld0." >>goto${goto}.tld${tld}.db
else
echo "q.goto${goto}.tld${tld}. IN CNAME q.goto${nextgoto}.tld${tld}." >>goto${goto}.tld${tld}.db
fi
echo "" >>label${label}.tld${tld}.db
goto=$nextgoto
done
-26
View File
@@ -1,26 +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 300
@ IN SOA mname1. . (
1 ; serial
20 ; refresh (20 seconds)
20 ; retry (20 seconds)
1814400 ; expire (3 weeks)
3600 ; minimum (1 hour)
)
NS ns
NS ns3
ns A 10.53.0.3
ns3 A 10.53.0.3
; camp attack
-13
View File
@@ -1,13 +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.
. 60 IN NS a.root-servers.nil.
a.root-servers.nil. A 10.53.0.1
-41
View File
@@ -1,41 +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.
*/
// NS9
options {
query-source address 10.53.0.9;
notify-source 10.53.0.9;
transfer-source 10.53.0.9;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.9; };
listen-on-v6 { none; };
recursion yes;
dnssec-validation no;
max-recursion-queries 50;
max-query-restarts 50;
max-query-count 100;
};
key rndc_key {
secret "1234abcd8765";
algorithm @DEFAULT_HMAC@;
};
controls {
inet 10.53.0.9 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
zone "." { type hint; file "hints.db"; };
-36
View File
@@ -1,36 +0,0 @@
#!/bin/sh
# 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.
set -e
# shellcheck source=../conf.sh
. ../conf.sh
dig_with_opts() {
"${DIG}" -p "${PORT}" "${@}"
}
status=0
n=0
n=$((n + 1))
echo_i "checking max-query-count is in effect ($n)"
ret=0
dig_with_opts q.label1.tld1. @10.53.0.9 a >dig.out.ns9.test${n} || ret=1
grep "status: SERVFAIL" dig.out.ns9.test${n} >/dev/null || ret=1
grep "exceeded global max queries resolving" ns9/named.run >/dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 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; };
@@ -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; };
@@ -25,12 +25,12 @@ trust-anchors {
NQyrszHhWUU=";
};
trust-anchors {
. static-key 257 3 8 "AwEAAawvFp8GlBx8Qt6yaIqXkDe+nMkSk2HkTAG7qlVBo++AQwZ1j3Xl
25IN4jsw0VTMbKUbafw9DYsVzztIwx1sNkKRLo6qP9SSkBL8RicQaafG
tURtsYI3oqte5qqLve1CUpRD8J06Pg1xkOxsDlz9sQAyiQrOyvMbykJY
kYrFYGLzYAgl/JtMyVVYlBl9pqxQuAPKYPOuO1axaad/wLN3+wTy/hcJ
fpvJpqzXlDF9bI5RmpoX/7geZ06vpcYJEoT0xkkmPlEl0ZjEDrm/WIaS
WG0/CEDpHcOXFz4OEczMVpY+lnuFfKybwF1WHFn2BwVEOS6cMM6ukIjI
NQyrszHhWUU=";
trusted-keys {
. 257 3 8 "AwEAAZtP9+RAA+W33A97e+HnnH8WTXzCWiEICyWj1B6rvZ9hd50ysbod
y0NLx7b3vZ1bzMLxLSRAr/n3Wi0TDZ1fvCKZhennfW8Wlc7ulCvHntSQ
YfKHUP0YWEo84sQAqIi850N1aiddj6CidwFo9JNW/HQ+8yarfrnGMFhX
2STtkE0hNJ/R6JYKmD2EH7k1nyqJd08ibrEt55DuV4BiUjyyERdVbsuw
E60jVqAwCKyVBYXb2sI+zv1yPNDBIANd6KTgnq6YWzx5ZodQP3W4K7Z/
Bk3EKmVCvrTKZK/ADLAKaL0/6DD07+1jXA4BiNyoZTLTapkudkGad+Rn
6zqCkwuMmrU=";
};
@@ -11,5 +11,6 @@
* information regarding copyright ownership.
*/
remote-servers a { 1.2.3.4; };
remote-servers b { 1.2.3.4; };
options {
dnssec-validation yes;
};
@@ -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;
};
@@ -25,7 +25,7 @@ trust-anchors {
QxA+Uk1ihz0=";
};
trust-anchors {
managed-keys {
# This key (20326) was published in the root zone in 2017.
# Servers which were already using the old key (19036) should
# roll seamlessly to this new one via RFC 5011 rollover. Servers
@@ -0,0 +1,29 @@
/*
* 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.
*/
trusted-keys {
# This key (20326) was published in the root zone in 2017.
# Servers which were already using the old key (19036) should
# roll seamlessly to this new one via RFC 5011 rollover. Servers
# being set up for the first time can use the contents of this
# file as initializing keys; thereafter, the keys in the
# managed key database will be trusted and maintained
# automatically.
. 257 3 8 "AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3
+/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQlNVz8Og8kv
ArMtNROxVQuCaSnIDdD5LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF
0jLHwVN8efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7pr+e
oZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLYA4/ilBmSVIzuDWfd
RUfhHdY6+cn8HFRm+2hM8AnXGXws9555KrUB5qihylGa8subX2Nn6UwN
R1AkUTV74bU=";
};
+20 -1
View File
@@ -14,9 +14,28 @@
options {
dnssec-validation yes;
max-zone-ttl 600;
dnssec-must-be-secure mustbesecure.example yes;
sortlist { };
rrset-order {
name "fixed.example" order fixed;
};
};
trust-anchors {
trusted-keys {
fake.trusted. 257 3 8
"AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjF
FVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoX
bfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaD
X6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpz
W5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relS
Qageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulq
QxA+Uk1ihz0=";
};
managed-keys {
fake.managed. initial-key 257 3 8
"AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3
+/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQlNVz8Og8kv
@@ -0,0 +1,33 @@
/*
* 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.
*/
options {
dnssec-validation yes;
};
trusted-keys {
example. 257 3 8 "AwEAAawvFp8GlBx8Qt6yaIqXkDe+nMkSk2HkTAG7qlVBo++AQwZ1j3Xl
25IN4jsw0VTMbKUbafw9DYsVzztIwx1sNkKRLo6qP9SSkBL8RicQaafG
tURtsYI3oqte5qqLve1CUpRD8J06Pg1xkOxsDlz9sQAyiQrOyvMbykJY
kYrFYGLzYAgl/JtMyVVYlBl9pqxQuAPKYPOuO1axaad/wLN3+wTy/hcJ
fpvJpqzXlDF9bI5RmpoX/7geZ06vpcYJEoT0xkkmPlEl0ZjEDrm/WIaS
WG0/CEDpHcOXFz4OEczMVpY+lnuFfKybwF1WHFn2BwVEOS6cMM6ukIjI
NQyrszHhWUU=";
example. 257 3 8 "AwEAAZtP9+RAA+W33A97e+HnnH8WTXzCWiEICyWj1B6rvZ9hd50ysbod
y0NLx7b3vZ1bzMLxLSRAr/n3Wi0TDZ1fvCKZhennfW8Wlc7ulCvHntSQ
YfKHUP0YWEo84sQAqIi850N1aiddj6CidwFo9JNW/HQ+8yarfrnGMFhX
2STtkE0hNJ/R6JYKmD2EH7k1nyqJd08ibrEt55DuV4BiUjyyERdVbsuw
E60jVqAwCKyVBYXb2sI+zv1yPNDBIANd6KTgnq6YWzx5ZodQP3W4K7Z/
Bk3EKmVCvrTKZK/ADLAKaL0/6DD07+1jXA4BiNyoZTLTapkudkGad+Rn
6zqCkwuMmrU=";
};
@@ -11,18 +11,8 @@
* information regarding copyright ownership.
*/
remote-servers "one" {
1.2.3.4;
options {
dnssec-validation yes;
};
parental-agents "two" {
1.2.3.5;
};
primaries "three" {
1.2.3.6;
};
masters "four" {
1.2.3.7;
};
trusted-keys {};
@@ -0,0 +1,15 @@
/*
* 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.
*/
masters a { 1.2.3.4; };
primaries b { 1.2.3.4; };
@@ -11,21 +11,16 @@
* information regarding copyright ownership.
*/
// NS2
options {
query-source address 10.53.0.2;
notify-source 10.53.0.2;
transfer-source 10.53.0.2;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
recursion no;
notify yes;
dnssec-validation yes;
};
zone "tld0" {
type primary;
file "tld0.db";
trusted-keys {
example. 257 3 8 "AwEAAawvFp8GlBx8Qt6yaIqXkDe+nMkSk2HkTAG7qlVBo++AQwZ1j3Xl
25IN4jsw0VTMbKUbafw9DYsVzztIwx1sNkKRLo6qP9SSkBL8RicQaafG
tURtsYI3oqte5qqLve1CUpRD8J06Pg1xkOxsDlz9sQAyiQrOyvMbykJY
kYrFYGLzYAgl/JtMyVVYlBl9pqxQuAPKYPOuO1axaad/wLN3+wTy/hcJ
fpvJpqzXlDF9bI5RmpoX/7geZ06vpcYJEoT0xkkmPlEl0ZjEDrm/WIaS
WG0/CEDpHcOXFz4OEczMVpY+lnuFfKybwF1WHFn2BwVEOS6cMM6ukIjI
NQyrszHhWUU=";
};
+1 -2
View File
@@ -74,7 +74,6 @@ options {
check-names primary warn;
check-names secondary ignore;
max-cache-size 20000000000000;
max-query-count 100;
max-query-restarts 10;
nta-lifetime 604800;
nta-recheck 604800;
@@ -86,7 +85,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;
};
+2 -2
View File
@@ -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";
+2 -2
View File
@@ -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";
+2 -2
View File
@@ -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";
+37
View File
@@ -179,11 +179,26 @@ warnings=$(grep "'notify' is disabled" <checkconf.out$n | wc -l)
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
if grep "^#define DNS_RDATASET_FIXED" "$TOP_BUILDDIR/config.h" >/dev/null 2>&1; then
test_fixed=true
else
test_fixed=false
fi
n=$((n + 1))
echo_i "checking named-checkconf deprecate warnings ($n)"
ret=0
$CHECKCONF deprecated.conf >checkconf.out$n.1 2>&1 || ret=1
grep "option 'managed-keys' is deprecated" <checkconf.out$n.1 >/dev/null || ret=1
grep "option 'trusted-keys' is deprecated" <checkconf.out$n.1 >/dev/null || ret=1
grep "option 'max-zone-ttl' is deprecated" <checkconf.out$n.1 >/dev/null || ret=1
grep "option 'dnssec-must-be-secure' is deprecated" <checkconf.out$n.1 >/dev/null || ret=1
grep "option 'sortlist' is deprecated" <checkconf.out$n.1 >/dev/null || ret=1
if $test_fixed; then
grep "rrset-order: order 'fixed' is deprecated" <checkconf.out$n.1 >/dev/null || ret=1
else
grep "rrset-order: order 'fixed' was disabled at compilation time" <checkconf.out$n.1 >/dev/null || ret=1
fi
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
# set -i to ignore deprecate warnings
@@ -590,6 +605,28 @@ if [ $ret -ne 0 ]; then
fi
status=$((status + ret))
n=$((n + 1))
echo_i "check that a trusted-keys entry for root generates a warning ($n)"
ret=0
$CHECKCONF check-root-trusted-key.conf >checkconf.out$n 2>/dev/null || ret=1
grep "trusted-keys entry for the root zone WILL FAIL" checkconf.out$n >/dev/null || ret=1
if [ $ret -ne 0 ]; then
echo_i "failed"
ret=1
fi
status=$((status + ret))
n=$((n + 1))
echo_i "check that using trust-anchors and managed-keys generates an error ($n)"
ret=0
$CHECKCONF check-mixed-keys.conf >checkconf.out$n 2>/dev/null && ret=1
grep "use of managed-keys is not allowed" checkconf.out$n >/dev/null || ret=1
if [ $ret -ne 0 ]; then
echo_i "failed"
ret=1
fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking named-checkconf kasp errors ($n)"
ret=0
+1 -1
View File
@@ -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;
};
-40
View File
@@ -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=$?
;;
@@ -222,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 @
@@ -1,19 +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 DLV 30795 1 1 (
310D27F4D82C1FC2400704EA9939FE6E1CEA
A3B9 )
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 DNAME @
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 DOA 0 1 2 "" aHR0cHM6Ly93d3cuaXNjLm9yZy8=
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 EID 12 89 AB
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 EUI48 01-23-45-67-89-ab
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 EUI64 01-23-45-67-89-ab-cd-ef
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 GPOS -22.6882 116.8652 250.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 HINFO . .
bad CNAME @
@@ -1,19 +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 HIP ( 2 200100107B1A74DF365639CC39F1D578
AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D
rvs.example.com. )
bad CNAME @

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