Compare commits

...
952 Commits
Author SHA1 Message Date
Witold Kręcicki 5b11668ad8 xxx tmp 2020-02-10 11:35:42 +01:00
Witold Kręcicki f689db69db Revert "Test: initial LOWAC capacity at 100k"
This reverts commit 0e52562e4eea06a4c1764ece09bc1bffcae51d32.
2018-11-24 22:38:09 +00:00
Witold Kręcicki 7b276d4062 Test: initial LOWAC capacity at 100k 2018-11-24 22:38:09 +00:00
Witold Kręcicki c5949ff9d1 Reset affinity of LOWAC worker 2018-11-24 22:38:09 +00:00
Witold Kręcicki 57ab5d3a14 Check if we have a view before LOWAC-caching 2018-11-24 22:38:09 +00:00
Witold Kręcicki 496923f71f Use memcpy instead of byte-by-byte in dns_name_fromwire 2018-11-24 22:38:09 +00:00
Witold Kręcicki 32472059d3 Minor fixes 2018-11-24 22:38:09 +00:00
Witold Kręcicki 0dcdbdfbdd Don't overuse isc_time_now(), use local time 2018-11-24 22:38:09 +00:00
Witold Kręcicki 3b6985b783 Fix atomic_ macros 2018-11-24 22:38:09 +00:00
Witold Kręcicki 96ba0486f3 Make stats inc/dec inlined macros 2018-11-24 22:38:09 +00:00
Witold Kręcicki 7132ffffad Revert "Use memory_order_acq_rel"
This reverts commit 673792d111965cf93c79a39005024b55ad4d8ba8.
2018-11-24 22:38:09 +00:00
Witold Kręcicki 48853a75ff WiP 2018-11-24 22:38:09 +00:00
Witold Kręcicki df0c5bc4cf Allocate memory for blob: 2018-11-24 22:38:09 +00:00
Witold Kręcicki cd6f768a16 Longer cache time 2018-11-24 22:38:09 +00:00
Witold Kręcicki 7a6b2ffddd Always enqueue removal after replacement 2018-11-24 22:38:09 +00:00
Witold Kręcicki 758045a2fd Fixes 2018-11-24 22:38:09 +00:00
Witold Kręcicki 0e037f8873 Mark unused memory 2018-11-24 22:38:09 +00:00
Witold Kręcicki 7c68a70bf9 Use memory_order_acq_rel 2018-11-24 22:38:09 +00:00
Witold Kręcicki f9d4a96021 Add some magic checks 2018-11-24 22:38:09 +00:00
Witold Kręcicki 9b5bdf4e89 Fixes 2018-11-24 22:38:09 +00:00
Witold Kręcicki 8c9ae61062 Revert "Use common isc_time"
This reverts commit 1c5ba6ba8af5fb7e65456ef8b846afdc874b77a2.
2018-11-24 22:38:09 +00:00
Witold Kręcicki f7390b39f8 Iterator fix 2018-11-24 22:38:09 +00:00
Witold Kręcicki 14ec374173 Use common isc_time 2018-11-24 22:38:09 +00:00
Witold Kręcicki 1fec6d70e6 Cleanup better 2018-11-24 22:38:09 +00:00
Witold Kręcicki 96b76abece More fiddling 2018-11-24 22:38:09 +00:00
Witold Kręcicki 0a73f7bb27 Some fiddling 2018-11-24 22:38:09 +00:00
Witold Kręcicki aaaa727cb3 Cleaning up 2018-11-24 22:38:09 +00:00
Witold Kręcicki 55a435f091 Cleaning up 2018-11-24 22:38:09 +00:00
Witold Kręcicki 609e505bc1 Test: ck_fifo 2018-11-24 22:38:09 +00:00
Witold Kręcicki 8ffd188a26 PoC LOWAC 2018-11-24 22:38:09 +00:00
Witold Kręcicki 965ef669bc Get rid of tasks-ready and tasks-running 2018-11-24 22:32:51 +00:00
Witold Kręcicki c42f920449 Set quantum in dispatch 2018-11-24 22:32:40 +00:00
Witold Kręcicki 95037b96a3 Add tasks_waiting field in taskqueue 2018-11-24 22:32:36 +00:00
Witold Kręcicki 09d0f57296 Remove configurable default taskmgr quantum, it was always default anyway 2018-11-24 22:32:31 +00:00
Witold Kręcicki 5098bd7776 pseudosend 2018-11-24 09:39:42 +00:00
Witold Krecicki ad0b4e9d41 Merge branch 'wpk-fix-recursive-performance' into 'master'
Bound tasks for resolver; Task quantum tweaks.

See merge request isc-projects/bind9!1117
2018-11-23 04:59:23 -05:00
Witold Kręcicki d5793ecca2 - isc_task_create_bound - create a task bound to specific task queue
If we know that we'll have a task pool doing specific thing it's better
  to use this knowledge and bind tasks to task queues, this behaves better
  than randomly choosing the task queue.

- use bound resolver tasks - we have a pool of tasks doing resolutions,
  we can spread the load evenly using isc_task_create_bound

- quantum set universally to 25
2018-11-23 04:34:02 -05:00
Ondřej Surý 54b4e4e61c Merge branch 'ondrej-shorten-job-names' into 'master'
Change the job names, so they are more useful in pipeline overview

See merge request isc-projects/bind9!1127
2018-11-23 04:08:08 -05:00
Ondřej Surý 6363652d51 Change the job names, so they are more useful in pipeline overview 2018-11-23 08:45:50 +01:00
Mark Andrews 4f075d869c Merge branch '729-init_hasreuseport-will-not-work-on-systems-w-o-ipv4' into 'master'
Resolve "init_hasreuseport will not work on systems w/o IPv4"

Closes #729

See merge request isc-projects/bind9!1126
2018-11-22 23:31:34 -05:00
Mark Andrews 509dad8737 handle systems without IPv4 2018-11-23 12:05:53 +11:00
Mark Andrews 1634592c99 Merge branch '705-negative-value-passed-to-close-on-socket-c-and-resource-leak' into 'master'
Resolve "negative value passed to close on socket.c and resource leak"

Closes #705

See merge request isc-projects/bind9!1095
2018-11-22 20:00:30 -05:00
Mark Andrews 6696a40ea9 address resource leak; don't call close() on socket error; 2018-11-23 10:34:59 +11:00
Mark Andrews 2eabc74547 Merge branch '715-side-effect-in-assertion-in-name_test-c' into 'master'
Resolve "side effect in assertion in name_test.c"

Closes #715

See merge request isc-projects/bind9!1102
2018-11-22 18:19:01 -05:00
Mark Andrews 2156a5b610 address coverity side effect in assert warning 2018-11-22 17:57:54 -05:00
Mark Andrews e9d999f6b0 Merge branch '717-bin-named-server-c-load_zones-can-leak-memory' into 'master'
Resolve "bin/named/server.c:load_zones can leak memory"

Closes #717

See merge request isc-projects/bind9!1104
2018-11-22 17:57:18 -05:00
Mark Andrews 33132406a3 decrement zl->refs on error 2018-11-22 17:22:42 -05:00
Mark Andrews 9cf529fa50 Merge branch '716-remove-logically-dead-code-try-2' into 'master'
Resolve "remove logically dead code try #2"

Closes #716

See merge request isc-projects/bind9!1103
2018-11-22 17:17:43 -05:00
Mark Andrews 29fb4faf76 remove dead code 2018-11-22 17:04:00 -05:00
Ondřej Surý d0f0298f38 Merge branch '706-remove-isc_mem_set_get_quota' into 'master'
Resolve "Unchecked isc_mem_get's in dnssec-signzone.c and socket.c"

Closes #706

See merge request isc-projects/bind9!1093
2018-11-22 11:03:37 -05:00
Ondřej Surý d1a8a3faed Memory allocations must be fatal even when default_memalloc is not used 2018-11-22 16:46:57 +01:00
Ondřej Surý 2fa857d502 Cleanup lib/isc/mem.c after failed allocations made fatal 2018-11-22 16:46:56 +01:00
Ondřej Surý 3987a146be Remove isc_mem_{set,get}quota unused functions 2018-11-22 16:46:56 +01:00
Ondřej Surý 0667fa935a Merge branch '726-fix-NetBSD-build' into 'master'
Fix the build on NetBSD due to the differences in pthread implementation.

Closes #726

See merge request isc-projects/bind9!1123
2018-11-22 09:43:56 -05:00
Håvard EidnesandOndřej Surý f6c4ed94e4 Fix the build on NetBSD due to the differences in pthread implementation.
Signed-off-by: Ondřej Surý <ondrej@sury.org>
2018-11-22 09:43:43 -05:00
Ondřej Surý 259a4947e6 Merge branch '670-add-coccinelle-unreachable-spatch' into 'master'
Add first coccinelle based precheck test to the GitLab CI

See merge request isc-projects/bind9!1042
2018-11-22 09:28:15 -05:00
Ondřej SurýandOndřej Surý 2271e77d99 Add couple more ISC_UNREACHABLE(); found thanks to coccinelle 2018-11-22 09:28:00 -05:00
Ondřej SurýandOndřej Surý 21db43da8e Add unreachable.spatch coccinelle recipe and run it in precheck CI phase 2018-11-22 09:28:00 -05:00
Witold Krecicki e3c8a23276 Merge branch 'wpk-crash-on-mutex-init-failure' into 'master'
isc_mutex_init and isc_condition_init failures are now fatal

See merge request isc-projects/bind9!1049
2018-11-22 07:13:54 -05:00
Witold Kręcicki 929ea7c2c4 - Make isc_mutex_destroy return void
- Make isc_mutexblock_init/destroy return void
- Minor cleanups
2018-11-22 11:52:08 +00:00
Ondřej SurýandWitold Kręcicki d940e95206 isc_quota_init now returns 'void' 2018-11-22 11:52:08 +00:00
Ondřej SurýandWitold Kręcicki b7a15a5da0 Add CHANGES entry for GL #674 2018-11-22 11:52:08 +00:00
Ondřej SurýandWitold Kręcicki 2f3eee5a4f isc_mutex_init returns 'void' 2018-11-22 11:51:49 +00:00
Ondřej SurýandWitold Kręcicki 73a8999d1c isc_condition_init returns 'void' 2018-11-22 11:51:49 +00:00
Witold Kręcicki 0bed9bfc28 isc_mutex_init and isc_condition_init failures are now fatal 2018-11-22 11:51:49 +00:00
Tinderbox User ac4f8a51cc Merge branch 'prep-release' 2018-11-22 00:20:34 +00:00
Tinderbox User db1cd0d970 prep 9.13.4 2018-11-22 00:20:22 +00:00
Ondřej Surý 976881f4be Merge branch 'na-release-checklist-mods' into 'master'
release checklist mods

See merge request isc-projects/bind9!1107
2018-11-21 18:07:18 -05:00
Stephen MorrisandOndřej Surý 5c9c53e9e7 Updates to BIND release checklist. 2018-11-21 17:57:02 -05:00
Curtis Blackburn 9145bec00d Merge branch '305-fix-typo' into 'master'
Fix typo ISC_SHA256_DIGESTLENGHT -> ISC_SHA256_DIGESTLENGTH

See merge request isc-projects/bind9!1119
2018-11-21 17:54:31 -05:00
Ondřej Surý 6b65a4f86e Fix typo ISC_SHA256_DIGESTLENGHT -> ISC_SHA256_DIGESTLENGTH 2018-11-21 23:34:44 +01:00
Mark Andrews 9c4c1320e2 Merge branch '720-model-_assert_true-for-coverity' into 'master'
Resolve "model _assert_true() for coverity"

Closes #720

See merge request isc-projects/bind9!1108
2018-11-20 21:37:09 -05:00
Mark Andrews 9a4aa2aa5a model _assert_true 2018-11-21 12:56:27 +11:00
Ondřej Surý 380ab3b39f Merge branch '710-fix-socket-test' into 'master'
Use proper casting in socket unit test

Closes #710

See merge request isc-projects/bind9!1099
2018-11-19 12:02:41 -05:00
Witold KręcickiandOndřej Surý 5f81aa10bc Use proper casting in socket unit test 2018-11-19 17:40:34 +01:00
Ondřej Surý 4f7177c794 Disable internal malloc for AddressSanitizer build 2018-11-19 17:40:34 +01:00
Ondřej Surý a8649cc299 Add AddressSanitizer enabled build to GitLab CI 2018-11-19 17:40:34 +01:00
Ondřej Surý 5bc8feab45 Merge branch '712-memleak-in-delv' into 'master'
Fix a small memleak in delv

Closes #712

See merge request isc-projects/bind9!1101
2018-11-19 11:38:56 -05:00
Witold Kręcicki d00b3f47ba Fix a small memleak in delv 2018-11-19 13:31:36 +00:00
Witold Krecicki 0e555d7e01 Merge branch 'ondrej/use-strlcpy-in-wks_11.c' into 'master'
Use strlcpy in place where strncpy(s, ...) + s[sizeof(s)-1] = \0; was used

See merge request isc-projects/bind9!1097
2018-11-19 04:45:47 -05:00
Ondřej Surý 175f06949f Use strlcpy in place where strncpy(s, ...) + s[sizeof(s)-1] = \0; was used 2018-11-19 07:58:48 +01:00
Ondřej Surý aa4ac49bb8 Merge branch '711-fix-memory-leak-in-lex_test' into 'master'
Fix memory leak in lex_test.c

Closes #711

See merge request isc-projects/bind9!1098
2018-11-19 01:57:34 -05:00
Ondřej Surý 7a3eb391fa Fix memory leak in lex_test.c 2018-11-19 07:47:05 +01:00
Evan Hunt 6f09738cef Merge branch '702-unchecked-returns-in-server-c' into 'master'
Resolve "unchecked returns in server.c"

Closes #702

See merge request isc-projects/bind9!1076
2018-11-16 19:53:31 -05:00
Mark Andrews ccfd577715 address unchecked return values 2018-11-17 10:20:23 +11:00
Evan Hunt 867180e462 Merge branch '703-resource-leak-in-dlz_filesystem_driver-c' into 'master'
Resolve "resource leak in dlz_filesystem_driver.c"

Closes #703

See merge request isc-projects/bind9!1074
2018-11-16 18:16:10 -05:00
Mark AndrewsandEvan Hunt 4979d5f31f cleanup allocated memory on error 2018-11-16 18:00:36 -05:00
Evan Hunt 39ebebaaf7 Merge branch '701-opts-is-incorrectly-declared-inside-the-loop' into 'master'
Resolve "opts is incorrectly declared inside the loop"

Closes #701

See merge request isc-projects/bind9!1075
2018-11-16 17:49:11 -05:00
Mark AndrewsandEvan Hunt e75e206a3d delare opts outside of loop; cleanup; rename variable 2018-11-16 13:34:44 -08:00
Evan Hunt 4e5ac64aca Merge branch 'cmocka-silence' into 'master'
remove (or hide behind a 'verbose' flag) extra output from unit tests

See merge request isc-projects/bind9!1077
2018-11-16 15:55:41 -05:00
Evan Hunt 8f15219f36 remove (or hide behind a 'verbose' flag) extra output from system tests 2018-11-16 20:46:14 +00:00
Evan Hunt d4bad35bb0 Merge branch 'fix-debug-output' into 'master'
echo debug output (D:text) the same as informational (I:text)

See merge request isc-projects/bind9!1081
2018-11-16 14:40:25 -05:00
Evan Hunt dfa1589975 echo debug output (D:text) the same as informational (I:text) 2018-11-16 19:30:30 +00:00
Ondřej Surý 827d7f0e49 Merge branch '648-fix-Windows-build-after-OpenSSL-changes' into 'master'
Add OpenSSL 1.1.0+ defines for Windows build

Closes #648

See merge request isc-projects/bind9!1078
2018-11-16 08:56:57 -05:00
Ondřej Surý 14fa99e3b4 Add OpenSSL 1.1.0+ defines for Windows build 2018-11-16 14:41:05 +01:00
Ondřej Surý 1276cf4cd1 Merge branch '4-warn-not-fail' into 'master'
warn, rather than failing, if kyua is not present

See merge request isc-projects/bind9!1067
2018-11-16 08:40:14 -05:00
Evan HuntandOndřej Surý 6cfb2249e1 warn, rather than failing, if kyua is not present 2018-11-16 14:31:36 +01:00
Ondřej Surý 7346199a92 Merge branch '700-windows-builds-failing' into 'master'
Resolve "Windows builds failing"

Closes #700

See merge request isc-projects/bind9!1073
2018-11-16 08:13:26 -05:00
Mark Andrews bad342adab check for missing #include <isc/strerr.h> 2018-11-16 12:24:21 +11:00
Mark Andrews 1ca5920113 2018-11-16 12:24:18 +11:00
Mark Andrews 474fbe88bf add missing tasks argument 2018-11-16 11:51:05 +11:00
Evan Hunt f5d8bd0853 Merge branch 'silence-compiler-warning' into 'master'
silence "unused return value" warning

See merge request isc-projects/bind9!1066
2018-11-15 15:54:50 -05:00
Evan Hunt c2a274cc5d silence "unused return value" warning 2018-11-15 12:54:11 -08:00
Ondřej Surý de0290821a Merge branch '674-abort-when-memory-allocation-fails' into 'master'
Resolve "abort when memory allocation fails"

Closes #674

See merge request isc-projects/bind9!1025
2018-11-15 11:37:46 -05:00
Ondřej Surý 37ff7f635b Add CHANGES entry for GL #674 2018-11-15 17:24:08 +01:00
Ondřej Surý 65c084e4eb Remove the memory allocation check that made us resize 0-sized allocations to 1 [RT #2398] 2018-11-15 17:24:08 +01:00
Ondřej Surý 8de2451756 Abort on memory allocation failure 2018-11-15 17:24:08 +01:00
Ondřej Surý 436b6fb354 Merge branch '4-remove-embedded-atf' into 'master'
Remove embedded ATF and required ATF >= 0.20 + Kyua to run unittests

See merge request isc-projects/bind9!875
2018-11-15 10:40:28 -05:00
Ondřej Surý 9b0501635b Add CHANGES entry for GL !875 2018-11-15 16:29:54 +01:00
Ondřej Surý fa33b4ee23 Remove the traces of ATF from documentation 2018-11-15 16:29:51 +01:00
Ondřej Surý ed4a49122b Remove the atf_tc coverity model 2018-11-15 16:29:48 +01:00
Ondřej Surý de219b8555 Remove embedded atf-src and enforce atf >= 0.20 + kyua as execution engine 2018-11-15 16:28:20 +01:00
Ondřej Surý e31e5732fd Merge branch '623-fix-typo-in-CHANGES' into 'master'
Update CHANGES

See merge request isc-projects/bind9!1065
2018-11-15 10:03:39 -05:00
Ondřej Surý 18781c5a3d Update CHANGES 2018-11-15 09:55:33 -05:00
Witold Krecicki 9f35a59f71 Merge branch 'NG-unix-socket-mergable' into 'master'
Rewrite of unix/socket.c code

Closes #666

See merge request isc-projects/bind9!987
2018-11-15 06:35:47 -05:00
Witold Kręcicki 79afbe2966 Some comments 2018-11-15 08:21:40 +00:00
Witold Kręcicki 16d329d55b Work with assumption that isc_mem_get always succeds; Crash if isc_thread_create, isc_mutex_init or isc_condition_init fails 2018-11-15 08:21:40 +00:00
Witold Kręcicki 6be7b631ab Create named_g_cpus network threads 2018-11-15 08:21:40 +00:00
Evan HuntandWitold Kręcicki 1f0cd6606e style: one-line statement braces, line length, etc 2018-11-15 08:21:40 +00:00
Witold Kręcicki 59ac0e87f8 CHANGES and release notes 2018-11-15 08:21:39 +00:00
Witold Krecicki e55bbec66e FreeBSD fixes - proper affinity setting, don't use SO_REUSEPORT 2018-11-15 08:21:17 +00:00
Witold Krecicki 3f7d79e574 Don't doublelock fdlock on Solaris 2018-11-15 08:21:17 +00:00
Witold Kręcicki ca7b5ceee5 Synchronize Windows socket code with API changes. 2018-11-15 08:21:17 +00:00
Witold Kręcicki d960210114 Fix fetchlimit test to allow softquota to be overruled; Remove 'verifying that named checks for conflicting listeners' test from runtime 2018-11-15 08:21:17 +00:00
Witold Kręcicki c1a4f0e66a Use multiple worker queues (using isc_task_sendto()) in unix socket code 2018-11-15 08:21:17 +00:00
Witold Kręcicki 559ce1e330 use REUSEPORT only for NOLISTEN dispatchers 2018-11-15 08:21:17 +00:00
Witold Kręcicki b2b210d6d9 Make watching/unwatching sockets saner. 2018-11-15 08:21:17 +00:00
Witold Kręcicki d652551e86 Use the newly accepted FD in TCP code. 2018-11-15 08:21:17 +00:00
Witold Kręcicki 88edf8fe4d Use isc_refcount_t in socket reference counting. 2018-11-15 08:21:17 +00:00
Witold Krecicki 7223790380 Multiple network event loop threads support for Solarises /dev/poll. 2018-11-15 08:21:17 +00:00
Witold Kręcicki 9c926a5d9b Mangle fdlocks a bit.
Mutexes are slower if they're in the same cache line. Since
fd's come in herds, and usually our listen sockets will have nearby
fd numbers, we mangle fdlocks so that the locks are further away.
2018-11-15 08:21:17 +00:00
Witold Kręcicki 58d75d9d8d Fix a race between socket closing and incoming event. 2018-11-15 08:21:17 +00:00
Witold Kręcicki f94f4bc1f4 Set network threads CPU affintity. 2018-11-15 08:21:17 +00:00
Witold Kręcicki bd024eee57 Add runtime detection of SO_REUSEPORT, use it instead of dup() if available. 2018-11-15 08:21:17 +00:00
Witold Kręcicki 89b1817211 Use the same number of UDP dispatchers as CPUs. 2018-11-15 08:21:17 +00:00
Witold Krecicki 6feb688f69 Use multiple network event loop threads with separate data structures. 2018-11-15 08:21:17 +00:00
Witold Kręcicki cbc1b12311 Do IO after event directly in the network thread, don't queue an event in a separate task. 2018-11-15 08:21:17 +00:00
Witold Kręcicki 778ab8158a Remove fdwatch sockets, those are not used anywhere. 2018-11-15 08:21:17 +00:00
Evan Hunt 59171fe359 Merge branch '620-cmocka-conversions' into 'master'
Resolve "CMOCKA conversions"

Closes #620

See merge request isc-projects/bind9!886
2018-11-15 00:18:59 -05:00
Evan Hunt 32503f3b52 CHANGES 2018-11-14 20:17:18 -08:00
Evan Hunt a2013231a3 remove --with-atf from gitlab CI 2018-11-14 20:17:04 -08:00
Evan Hunt 8c4d50c6bc remove ATF source code and Atffiles 2018-11-14 20:17:04 -08:00
Evan Hunt efe3c038b1 remove ATF from configure 2018-11-14 20:17:04 -08:00
Evan Hunt d534ae5c12 remove atf-run from unittest.sh.in 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt 336d5a5374 convert update_test; remove ATF from lib/dns/tests 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt 92a3762cb6 convert tsig_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt 2c7e6947fa convert time_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt eda6281f98 convert sigs_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt b915cdbf0b convert rsa_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt 2837a821e8 convert resolver_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt dfd90dbb82 convert rbt_serialize_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt 1b48e710d5 convert name_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt 4ba08bb119 convert master_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt e38901154d convert keytable_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt 9a464ef869 convert private_test 2018-11-14 20:17:04 -08:00
Evan Hunt 98d5abb73c convert dbversion_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt ad923f82b1 convert dst_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt 005e19ad3f convert db_test 2018-11-14 20:17:04 -08:00
Evan Hunt 8d347788b0 convert dispatch_test 2018-11-14 20:17:04 -08:00
Evan Hunt 01a193ff6c convert zonemgr_test 2018-11-14 20:17:04 -08:00
Evan Hunt 0a4f6122de convert zt_test 2018-11-14 20:17:04 -08:00
Evan Hunt bb5ed5a4ac convert rdata_test
- also added code to dnstest.c to optionally suppress printing of errors
  from dns_rdata_fromtxt()
2018-11-14 20:17:04 -08:00
Evan Hunt 55465517c7 convert rbt_test 2018-11-14 20:17:04 -08:00
Evan Hunt 9f83d31e42 convert dnstap_test 2018-11-14 20:17:04 -08:00
Evan Hunt 06b4ff5fe2 convert geoip_test 2018-11-14 20:17:04 -08:00
Evan Hunt 015fda0bb4 convert nsec3_test 2018-11-14 20:17:04 -08:00
Evan Hunt 28121c248e convert rdatasetstats_test 2018-11-14 20:17:04 -08:00
Evan Hunt 79cd093cd7 convert dbiterator_test 2018-11-14 20:17:04 -08:00
Evan Hunt 6dfc868fba convert dbdiff_test 2018-11-14 20:17:04 -08:00
Evan Hunt db5eece106 convert peer_test 2018-11-14 20:17:04 -08:00
Evan Hunt cca16eccd7 convert rdataset_test 2018-11-14 20:17:04 -08:00
Evan Hunt a33bca5d55 convert acl_test 2018-11-14 20:17:04 -08:00
Evan Hunt dcf65c82ad convert dh_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt 9eea00cd3c convert socket_test; remove ATF from lib/isc/tests 2018-11-14 20:17:04 -08:00
Evan Hunt bd009b34a6 convert regex_test 2018-11-14 20:17:04 -08:00
Evan Hunt 6ad7acd787 convert random_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt 683094e308 convert mem_test 2018-11-14 20:17:04 -08:00
Evan Hunt 20cef35ece convert timer_test 2018-11-14 20:17:04 -08:00
Evan Hunt 3e52987229 convert task_test 2018-11-14 20:17:04 -08:00
JoeyandEvan Hunt 72f60bdd84 convert hash_test 2018-11-14 20:17:04 -08:00
Evan Hunt c701f036ea convert ht_test 2018-11-14 20:17:04 -08:00
Evan Hunt 3bf9a1e567 convert time_test 2018-11-14 20:17:04 -08:00
Evan Hunt c9ff174dce convert taskpool_test 2018-11-14 20:17:04 -08:00
Evan Hunt 4f84acb788 convert pool_test 2018-11-14 20:17:04 -08:00
Evan Hunt 231436039d convert sockaddr_test 2018-11-14 20:17:04 -08:00
Evan Hunt 7ab8c5b583 convert netaddr_test 2018-11-14 20:17:04 -08:00
Evan Hunt 5f377136be convert symtab_test 2018-11-14 20:17:04 -08:00
Evan Hunt b3db0266cb convert queue_test 2018-11-14 20:17:04 -08:00
Evan Hunt 8161be27db convert file_test 2018-11-14 20:17:04 -08:00
Evan Hunt 4133fd86f1 convert lex_test 2018-11-14 20:17:04 -08:00
Evan Hunt 049a3a7c0e convert errno_test 2018-11-14 20:17:04 -08:00
Evan Hunt c1c8d8846f convert safe_test 2018-11-14 20:17:04 -08:00
Evan Hunt 718ca3166c convert radix_test 2018-11-14 20:17:04 -08:00
Evan Hunt cc6ab2416b convert heap_test 2018-11-14 20:17:04 -08:00
Evan Hunt a7c308df9c convert parse_test 2018-11-14 20:17:04 -08:00
Evan Hunt 52b86f0abe convert counter_test 2018-11-14 20:17:04 -08:00
Evan Hunt 02a5db7631 convert buffer_test 2018-11-14 20:17:04 -08:00
Evan Hunt dc88db015b convert aes_test 2018-11-14 20:17:04 -08:00
Evan Hunt 79ac715763 convert listenlist_test; remove ATF from lib/ns/tests 2018-11-14 20:17:04 -08:00
Evan Hunt 48dc2831d7 convert notify_test 2018-11-14 20:17:04 -08:00
Evan Hunt 318b340f5e convert query_test
- also fixed a bug in openssldh_link.c that turned up in the process
2018-11-14 20:17:04 -08:00
Evan Hunt cec8c52cbe convert resconf_test; remove ATF from lib/irs/tests 2018-11-14 20:17:04 -08:00
Evan Hunt 7ec945bd41 convert parser_test; remove ATF from lib/isccfg/tests 2018-11-14 20:17:04 -08:00
Evan Hunt d8766293ab assert if {isc,dns,ns}_test_begin() is called when a prior test is running 2018-11-14 20:17:04 -08:00
Evan Hunt b434b0a4b6 remove .NOTPARALLEL so unit tests can build faster 2018-11-14 20:17:04 -08:00
Evan Hunt 2afd18a2ce add cmocka support to remaining unit test makefiles
- also cleaned up some existing test code
2018-11-14 20:17:04 -08:00
Evan Hunt f456e64736 set HAVE_CMOCKA correctly when using --with-cmocka=yes
(note: this is still broken if using --with-cmocka=path)
2018-11-14 20:17:04 -08:00
Ondřej SurýandEvan Hunt c38b145b89 Remove OPENSSL_cleanup() call as we cannot recover from that, it will be called via atexit mechanism automatically 2018-11-14 20:17:04 -08:00
Mark Andrews 1473ddcc65 Merge branch 'u/fanf2/optionally-disable-digrc' into 'master'
dig: a -r option to disable .digrc

See merge request isc-projects/bind9!970
2018-11-14 20:53:40 -05:00
Mark Andrews a5524b5fe2 add CHANGES 2018-11-15 11:09:04 +11:00
Tony FinchandMark Andrews fdb74fed9e dig: a -r option to disable .digrc 2018-11-15 11:09:04 +11:00
Mark Andrews 995bafbd72 Merge branch 'ondrej/use-static-assert' into 'master'
Use static assertions on non-Windows platforms (requires C11 or gcc-4.6+)

See merge request isc-projects/bind9!1045
2018-11-14 18:39:52 -05:00
Ondřej SurýandMark Andrews de6f43d071 Use static assertion to check for correct alignment size 2018-11-14 18:18:27 -05:00
Ondřej SurýandMark Andrews 5e44a1008f Define STATIC_ASSERT(cond, msg) to be _Static_assert(cond, msg) everywhere but on Windows where it stays to be INSIST(cond) 2018-11-14 18:18:27 -05:00
Evan Hunt 82b23ecc5e Merge branch '347-various-bind-9-bugs-in-cleanup-after-fail-scenarios' into 'master'
Resolve "Various BIND 9 bugs in cleanup-after-fail scenarios"

Closes #347

See merge request isc-projects/bind9!1007
2018-11-14 16:53:18 -05:00
Mark Andrews 4eadebe2b2 uninitalize memory read on error path 2018-11-14 15:26:27 -05:00
Mark Andrews 93776c4c81 errors initalizing badcaches were not caught or cleaned up on error paths 2018-11-14 15:26:27 -05:00
Witold Krecicki 652ce14e7f Merge branch '671-late-qmin-relaxed-warning' into 'master'
qname minimization: issue a warning only if the server is really broken

Closes #671

See merge request isc-projects/bind9!994
2018-11-14 15:14:40 -05:00
Witold Kręcicki 2639030d66 CHANGES note 2018-11-14 19:56:29 +00:00
Witold Kręcicki 9c8fead6d8 qname minimization: issue a warning only if the server is really broken 2018-11-14 19:55:10 +00:00
Evan Hunt 13e53ef38a Merge branch '558-nsupdate-leaks-memory-when-using-gss-tsig-and-receiving-sigterm-at-a-right-time' into 'master'
Resolve "nsupdate leaks memory when using GSS-TSIG and receiving SIGTERM at a "right" time"

Closes #558

See merge request isc-projects/bind9!1048
2018-11-14 14:39:09 -05:00
Mark AndrewsandEvan Hunt 50714a9b35 free tmpzonename and restart_master 2018-11-14 11:23:21 -08:00
Evan Hunt a91bf68d66 Merge branch '675-don-t-use-typename' into 'master'
Resolve "Don't use 'typename'"

Closes #675

See merge request isc-projects/bind9!1034
2018-11-14 14:03:10 -05:00
Mark AndrewsandEvan Hunt 333f718dd3 don't use 'typename' as it is reserved in C++ 2018-11-14 13:45:20 -05:00
Ondřej Surý c59f332db2 Merge branch '613-add-option-for-min-cache' into 'master'
Add min-cache-ttl and min-ncache-ttl keywords

Closes #613

See merge request isc-projects/bind9!889
2018-11-14 12:51:34 -05:00
Ondřej Surý 261230343a Add CHANGES entry for GL#613 2018-11-14 18:25:11 +01:00
Ondřej Surý 11db6dd8ff Add release notes for min-{cache,ncache}-ttl and now enforced max-ncache-ttl limit 2018-11-14 18:24:53 +01:00
Ondřej Surý 3f95f4ffbb Add documentation for min-{ncache,cache}-ttl 2018-11-14 18:24:53 +01:00
Ondřej Surý cf9c2ef305 Fix the max-ncache-ttl tests 2018-11-14 18:24:53 +01:00
Ondřej Surý f6ca532df4 Add system tests for {min,max}-{cache,ncache}-ttl 2018-11-14 18:24:53 +01:00
Ondřej Surý 02b828e63f Use @abs_top_builddir@ to define BIND 9 top build directory in conf.sh 2018-11-14 18:24:53 +01:00
Ondřej Surý 54fdd6e834 Add min-{n,}cache-ttl tests for checkconf 2018-11-14 18:24:53 +01:00
Ondřej Surý e9a939841d Add min-cache-ttl and min-ncache-ttl keywords
Sometimes it is useful to set a 'floor' on the TTL for records
to be cached.  Some sites like to use ridiculously low TTLs for
some reason, and that often is not compatible with slow links.

Signed-off-by: Michael Milligan <milli@acmeps.com>
Signed-off-by: LaMont Jones <lamont@debian.org>
2018-11-14 18:24:53 +01:00
Mark Andrews ac2ea36fa5 Merge branch '688-prefer-kyua-over-aft-run' into 'master'
Resolve "prefer kyua over aft-run"

Closes #688

See merge request isc-projects/bind9!1030
2018-11-14 06:12:04 -05:00
Mark Andrews 590d391bbb prefer kyua over atf 2018-11-14 03:43:01 -05:00
Mark Andrews aa2c4bfdc0 Merge branch '584-dig-treats-4-6-m-after-q-argument-as-an-option-but-not-a-domain-name' into 'master'
Resolve "dig treats -4/-6/-m after -q argument as an option but not a domain name"

Closes #584

See merge request isc-projects/bind9!979
2018-11-13 19:51:06 -05:00
Evan Hunt e356d93175 style 2018-11-13 16:41:54 -08:00
Mark Andrews 77128c867c check that delv -q -m works 2018-11-14 11:38:08 +11:00
Mark Andrews f6f07fb41e check that dig -q -m works 2018-11-14 11:14:49 +11:00
Mark Andrews ba5d28dcfe add -q to dash_opts 2018-11-14 10:50:34 +11:00
Mark Andrews 75fa84b67b dig and mdig failed to properly preparse dash value pairs when value was a seperate argument and started with a dash. 2018-11-14 08:39:05 +11:00
Evan Hunt 1003ef4d67 Merge branch '587-statistics-channels-xml-v2-is-removed-but-still-documented' into 'master'
Resolve "statistics-channels /xml/v2 is removed but still documented"

Closes #587

See merge request isc-projects/bind9!1035
2018-11-13 14:07:17 -05:00
Mark AndrewsandEvan Hunt 9e1af0cef1 remove reference to obsolete xml/v2 schema 2018-11-13 11:06:23 -08:00
Michał Kępień 129e5306d0 Merge branch '433-restore-localhost-fallback-in-bin-dig-dighost.c' into 'master'
Restore localhost fallback in bin/dig/dighost.c

Closes #433

See merge request isc-projects/bind9!910
2018-11-13 08:52:43 -05:00
Michał Kępień 867bc3399b Add CHANGES entry
5089.	[bug]		Restore localhost fallback in dig and host which is
			used when no nameserver addresses present in
			/etc/resolv.conf are usable due to the requested
			address family restrictions. [GL #433]
2018-11-13 14:31:18 +01:00
Michał Kępień 18758392da Restore localhost fallback in bin/dig/dighost.c
In BIND 9.11 and earlier, dig and similar tools used liblwres for
parsing /etc/resolv.conf.  After getting a list of servers from
liblwres, a tool would check the address family of each server found and
reject those unusable.  When the resulting list of usable servers was
empty, localhost addresses were queried as a fallback.

When liblwres was removed in BIND 9.12, dig and similar tools were
updated to parse /etc/resolv.conf using libirs instead.  As part of that
process, the localhost fallback was removed from bin/dig/dighost.c since
the localhost fallback built into libirs was deemed to be sufficient.
However, libirs only falls back to localhost if it does not find any
name servers at all; if it does find any valid nameserver entry in
/etc/resolv.conf, it just returns it to the caller because it is
oblivious to whether the caller supports IPv4 and/or IPv6 or not.  The
code in bin/dig/dighost.c subsequently filters the returned list of
servers in get_server_list() according to the requested address family
restrictions.  This may result in none of the addresses returned by
libirs being usable, in which case a tool will attempt to work with an
empty server list, causing a hang and subsequently a crash upon user
interruption.

Restore the localhost fallback in bin/dig/dighost.c to prevent the
aforementioned hangs and crashes and ensure recent BIND versions behave
identically to the older ones in the circumstances described above.
2018-11-13 14:31:18 +01:00
Michał Kępień 0507658884 Merge branch '599-fix-a-shutdown-race-in-diagnostic-tools' into 'master'
Fix a shutdown race in bin/dig/dighost.c

Closes #599

See merge request isc-projects/bind9!855
2018-11-13 08:25:11 -05:00
Michał Kępień ae40e8039b Add CHANGES entry
5088.	[bug]		dig/host/nslookup could crash when interrupted close to
			a query timeout. [GL #599]
2018-11-13 13:50:47 +01:00
Michał Kępień 4621756596 Fix a shutdown race in bin/dig/dighost.c
If a tool using the routines defined in bin/dig/dighost.c is sent an
interruption signal around the time a connection timeout is scheduled to
fire, connect_timeout() may be executed after destroy_libs() detaches
from the global task (setting 'global_task' to NULL), which results in a
crash upon a UDP retry due to bringup_timer() attempting to create a
timer with 'task' set to NULL.  Fix by preventing connect_timeout() from
attempting a retry when shutdown is in progress.
2018-11-13 13:50:47 +01:00
Evan Hunt 75cc4156e9 Merge branch 'fix-rules-typo' into 'master'
fix rules.in typo

See merge request isc-projects/bind9!1036
2018-11-13 03:23:43 -05:00
Evan Hunt 9671909289 fix typo 2018-11-13 00:23:08 -08:00
Mark Andrews 582e261290 Merge branch 'autoheader' into 'master'
autoheader

See merge request isc-projects/bind9!1033
2018-11-12 19:03:14 -05:00
Mark Andrews cd0d61e0c8 autoheader 2018-11-13 10:31:50 +11:00
Mark Andrews b2dbe37538 Merge branch 'fix-test-linkages' into 'master'
Fix test linkages

See merge request isc-projects/bind9!1027
2018-11-12 15:45:04 -05:00
Mark Andrews 9024cf0c15 remove lib/isc/tests/result_test as it is now cmocka 2018-11-13 07:26:29 +11:00
Mark Andrews ba0e5ffc09 fixup 2018-11-13 07:26:29 +11:00
Mark Andrews 9a59352b4c link in lib/isccc/tests/Kyuafile 2018-11-13 07:23:36 +11:00
Ondřej Surý cc60f3a3be Merge branch '687-reduce-the-overall-files-we-consider-copyrightable' into 'master'
Resolve "Reduce the overall files we consider copyrightable"

Closes #687

See merge request isc-projects/bind9!1026
2018-11-12 10:14:33 -05:00
Ondřej Surý a1de63a2d2 Remove support for adding copyright to zone data 2018-11-12 16:11:57 +01:00
Ondřej Surý d99788042d Exclude configuration files from the copyright mumbo-jumbo 2018-11-12 16:01:37 +01:00
Mark Andrews 62a92b7784 Merge branch 'remove-duplicate-block' into 'master'
remove duplicate block

See merge request isc-projects/bind9!1022
2018-11-12 02:12:04 -05:00
Mark Andrews 5e3f20a71b remove duplicate block 2018-11-12 17:57:31 +11:00
Mark Andrews 7a7cf952ad Merge branch '676-isc_result_toid-tables-not-complete' into 'master'
Resolve "isc_result_toid tables not complete"

Closes #676

See merge request isc-projects/bind9!1010
2018-11-11 18:51:03 -05:00
Evan Hunt 471110933a convert result tests to use CMocka instead of ATF 2018-11-10 12:29:40 -08:00
Mark Andrews 4f04a79250 check result tables are complete 2018-11-10 10:30:43 +11:00
Mark Andrews 3f0aaf7a60 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1008
2018-11-09 00:34:27 -05:00
Mark Andrews baa46c3d4b placeholder 2018-11-09 16:33:29 +11:00
Mark Andrews 65ffafdc6a Merge branch '186-bind-9-12-x-potential-bug-with-dig-when-tools-installed-on-windows' into 'master'
Resolve "Bind 9.12.x: Potential bug with Dig when Tools installed on Windows"

Closes #186

See merge request isc-projects/bind9!1004
2018-11-09 00:18:15 -05:00
Mark Andrews 4f7deb348b add CHANGES note 2018-11-09 16:09:42 +11:00
Mark Andrews 6ead8c7be8 look in windows registry for nameservers, domainname and search list 2018-11-09 16:06:49 +11:00
Mark Andrews 6bac3508ec Merge branch '623-rpz-logging-to-include-qclass-and-qtype' into 'master'
Resolve "RPZ logging to include QCLASS and QTYPE"

Closes #623

See merge request isc-projects/bind9!966
2018-11-08 23:04:30 -05:00
Mark Andrews 505a1ceda4 add CHANGES note 2018-11-09 14:55:52 +11:00
Mark Andrews 28442f11f0 log RPZ type and class 2018-11-08 22:48:28 -05:00
Mark Andrews a13a0a2beb Merge branch '673-fix-windows-build-resource-discover' into 'master'
Resolve "fix windows build resource discover"

Closes #673

See merge request isc-projects/bind9!1005
2018-11-08 20:38:45 -05:00
Mark Andrews 896fb585b3 isc_resource_getlimit under windows only supports isc_resource_openfiles 2018-11-09 12:29:36 +11:00
Ondřej Surý 02be459f37 Merge branch '449-isc_stdtime_t-post-stdint-cleanup' into 'master'
Resolve "Follow-up from "Redefine ISC's int and boolean types to use <stdint.h> and <stdbool.h> types""

Closes #449

See merge request isc-projects/bind9!998
2018-11-08 14:55:55 -05:00
Ondřej Surý 6f5fe11f5a isc_stdtime_t is always 32-bit now, so remove the always true macro STDTIME_ON_32BITS 2018-11-09 02:27:06 +07:00
Ondřej Surý c355e1f38f Print isc_stdtime_t with PRIu32 2018-11-09 02:27:06 +07:00
Ondřej Surý 2a652aefe9 Merge branch '224-remove-isc-hmax-fixup-exe-bnff-from-win32utils-configure' into 'master'
Remove isc-hmac-fixup.exe remains from win32util/Configure

Closes #224

See merge request isc-projects/bind9!1000
2018-11-08 14:02:25 -05:00
Ondřej Surý f95e4593ed Remove isc-hmac-fixup.exe remains from win32util/Configure 2018-11-09 01:48:52 +07:00
Ondřej Surý c303cf5cc9 Merge branch '305-misc-fixes' into 'master'
Miscellaneous style fixes - implicit casts to bool and uninitialized variables fixes

Closes #305

See merge request isc-projects/bind9!851
2018-11-08 02:03:07 -05:00
Ondřej Surý 68ca987792 Remove dummy ISLOCKED macro 2018-11-08 12:22:26 +07:00
Ondřej Surý 23fff6c569 Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached 2018-11-08 12:22:17 +07:00
Ondřej Surý b992b5b811 Modify the dbversion_test.c to detect disabled assertions 2018-11-08 12:22:17 +07:00
Ondřej Surý 29c45200e7 Add extra return failure after INSIST(0) in default branch 2018-11-08 12:22:17 +07:00
Ondřej Surý 4eaf927571 Use larger buffers on snprintf buffer overflow false positives 2018-11-08 12:21:53 +07:00
Ondřej Surý e2e138a801 Don't assert on failed getrlimit call to allow called to handle this gracefully as it already does, just abort where we need to know the numbers 2018-11-08 12:21:53 +07:00
Ondřej Surý a831e0f72d When ISC assertions are disabled, still execute the condition to prevent unused variable warnings/errors from the compiler 2018-11-08 12:21:53 +07:00
Ondřej Surý 461ffead1f Add a GitLab CI job that runs with all assertions disabled 2018-11-08 12:21:53 +07:00
Ondřej Surý b2b43fd235 Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool 2018-11-08 12:21:53 +07:00
Ondřej Surý fbd2e47f51 Add small tweaks to the code to fix compilation when ISC assertions are disabled
While implementing the new unit testing framework cmocka, it was found that the
BIND 9 code doesn't compile when assertions are disabled or replaced with any
function (such as mock_assert() from cmocka unit testing framework) that's not
directly recognized as assertion by the compiler.

This made the compiler to complain about blocks of code that was recognized as
unreachable before, but now it isn't.

The changes in this commit include:

* assigns default values to couple of local variables,
* moves some return statements around INSIST assertions,
* adds __builtin_unreachable(); annotations after some INSIST assertions,
* fixes one broken assertion (= instead of ==)
2018-11-08 12:21:53 +07:00
Mark Andrews 8e292b3262 Merge branch 'wpk-get-rid-of-bashism-in-CDS-test' into 'master'
Small system tests fixes for Solaris

See merge request isc-projects/bind9!988
2018-11-07 19:41:30 -05:00
Witold Krecicki 82dfb77328 Remove unnecessary sed from autosign test 2018-11-08 00:07:00 +01:00
Witold Krecicki 0949b1fe2c Use 'local' variable in echo functions in tests 2018-11-07 23:15:06 +01:00
Witold Kręcicki dbf2e7928e Get rid of bashism in CDS test 2018-11-07 23:13:47 +01:00
Ondřej Surý 3317d3d2bb Merge branch '4-add-ac_posix_shell-m4-macro' into 'master'
Add AX_POSIX_SHELL autoconf macro to have POSIX-compatible shell in $SHELL

See merge request isc-projects/bind9!986
2018-11-07 15:03:44 -05:00
Ondřej Surý 601abfab30 Add CHANGES entry for AX_POSIX_SHELL 2018-11-08 02:52:19 +07:00
Ondřej Surý b1e1dd2c25 Remove m4/ files from copyright check 2018-11-08 02:52:19 +07:00
Ondřej Surý 54ff27a6bc Add and use AX_POSIX_SHELL autoconf macro, so we can rely on POSIX shell features 2018-11-08 02:52:19 +07:00
Ondřej Surý cd6c016896 Merge branch 'wpk-fix-typo-thread-c' into 'master'
Fix a typo in lib/isc/unix/thread.c

See merge request isc-projects/bind9!990
2018-11-07 14:40:08 -05:00
Witold Kręcicki ce478b4fc9 Fix a typo in lib/isc/unix/thread.c 2018-11-07 19:31:06 +00:00
Witold Krecicki 7a2248acf9 Merge branch '650-fix-race-in-dig' into 'master'
Add some DBC checks in dighost; fix race between clear_query and send_done in dighost

Closes #650

See merge request isc-projects/bind9!965
2018-11-07 13:04:13 -05:00
Witold Krecicki e9bf8e4798 Add some DBC checks in dighost; fix race between clear_query and send_done in dighost 2018-11-07 13:04:13 -05:00
Witold Krecicki 319c166a50 Merge branch 'wpk-multiple-task-queues' into 'master'
Multiple task queues

See merge request isc-projects/bind9!878
2018-11-06 04:44:34 -05:00
Witold Kręcicki b673f509d2 CHANGES note 2018-11-06 08:24:22 +00:00
Witold Kręcicki 9a903789ed Use larger quantum for network tasks 2018-11-06 08:19:50 +00:00
Witold Kręcicki 460c8038c1 Use a single wake_all_queues() function to wake all queues 2018-11-06 08:19:50 +00:00
Witold Kręcicki b3827319e0 Switch from privileged to un-privileged mode under lock 2018-11-06 08:19:50 +00:00
Witold Kręcicki f166cabcae Document isc_task_sendto properly, make sure that cpu we're sending to is always sane 2018-11-06 08:19:50 +00:00
Witold Kręcicki 025c74adee Use proper memory ordering for tasks_running/tasks_ready 2018-11-06 08:19:50 +00:00
Witold Kręcicki 8fb5bc783f Comment about taskmgr exclusive mode, fix a REQUIRE. 2018-11-06 08:19:50 +00:00
Witold Kręcicki 152c437bb8 Allow slight over-quota in'checking lame server clients are dropped at the soft limit' test 2018-11-06 08:19:50 +00:00
Witold Kręcicki 913856911a Saner exclusive task handling in taskmgr 2018-11-06 08:19:50 +00:00
Witold Kręcicki 17d46fd48b Formatting 2018-11-06 08:19:50 +00:00
Witold Kręcicki c80e25e482 Get rid of isc_taskmgr_setmode, we only use it to set privileged mode 2018-11-06 08:19:50 +00:00
Witold Kręcicki 64020dd7bc Make sure all priority tasks are done before entering normal execution 2018-11-06 08:19:50 +00:00
Witold Kręcicki 669a694d3b Post shutting down tasks always to manager 0 2018-11-06 08:19:50 +00:00
Witold Kręcicki c416389d32 Separate structure for each thread/queue; 2-phase-locking for exclusive tasks 2018-11-06 08:19:50 +00:00
Witold Kręcicki 818d63a3a1 Always restart dispatchers on empty readyq 2018-11-06 08:19:50 +00:00
Witold Kręcicki d7be8afea5 Taskmgr shutdown fixes 2018-11-06 08:19:50 +00:00
Witold Kręcicki 81a85070c5 Multiple worker queues 2018-11-06 08:19:50 +00:00
Witold Krecicki 7b6721b27f isc_thread_setaffinity() 2018-11-06 08:19:50 +00:00
Evan Hunt 151b64aa3e Merge branch 'rndc-nta-preen' into 'master'
Fixes for `rndc nta` user interface

See merge request isc-projects/bind9!845
2018-11-06 01:18:32 -05:00
Evan Hunt 6298061e24 CHANGES, release note 2018-11-05 22:10:10 -08:00
Tony FinchandEvan Hunt 1b1d63acd8 Fixes for rndc nta user interface
Tell the user explicitly about their mistakes:

* Unknown options, e.g. -list instead of -dump
  or -delete instead of -remove.

* Unknown view names.

* Excess arguments.

Include the view name in `rndc nta -dump` output, for consistency with
the NTA add and remove actions.

When removing an NTA from all views, do not abort with an error if the
NTA was not found in one of the views.
2018-11-05 22:01:28 -08:00
Mark Andrews 95e84464b7 Merge branch '653-idnout-only-on-tty' into 'master'
Enable idnout output only on tty, disable it when the stdout is not a tty

Closes #653

See merge request isc-projects/bind9!973
2018-11-06 00:58:22 -05:00
Ondřej Surý 9c0c44405c Add CHANGES entry for GL #653 2018-11-06 12:48:44 +07:00
Ondřej Surý 2a11a7dd29 Add release notes for IDN processing update 2018-11-06 12:48:08 +07:00
Ondřej Surý b659765869 Update the IDN documentation for nslookup 2018-11-06 12:48:08 +07:00
Ondřej Surý 7697923eab Change the dig documentation 2018-11-06 12:48:08 +07:00
Ondřej Surý e8c57a78aa Update the idna tests for the new non-tty defaults 2018-11-06 12:48:08 +07:00
Ondřej Surý 0e1bf7d017 Enable IDN processing (both idnin and idnout) only on tty, disable it when the stdout is not a tty 2018-11-06 12:48:08 +07:00
Mark Andrews 46dbf96bd9 Merge branch '601-build-option-with-python-should-default-to-yes' into 'master'
Resolve "Build option --with-python should default to yes"

Closes #601

See merge request isc-projects/bind9!980
2018-11-06 00:38:06 -05:00
Mark Andrews bf8746126c require python to be explicitly disabled 2018-11-06 16:10:09 +11:00
Mark Andrews 2bef7291be Merge branch 'u/fanf2/deprecate-ip6-int' into 'master'
Abolish ip6.int support in `dig` and `mdig`

See merge request isc-projects/bind9!969
2018-11-05 19:29:23 -05:00
Mark Andrews 00f377da93 add CHANGES note 2018-11-06 11:19:03 +11:00
Tony FinchandMark Andrews 3064d3d0ef Abolish ip6.int support in dig and mdig 2018-11-05 19:07:31 -05:00
Mark Andrews ae0160c33b Merge branch '617-if-rrl-is-configured-the-require-server-cookie-yes-is-ignored' into 'master'
Resolve "If RRL is configured the "require-server-cookie yes;" is ignored."

Closes #617

See merge request isc-projects/bind9!974
2018-11-05 18:18:37 -05:00
Mark Andrews a868f335d2 add CHANGES note 2018-11-06 10:10:04 +11:00
Mark Andrews 164370102a test require-server-cookie with rate-limit 2018-11-06 10:10:04 +11:00
Mark Andrews d6f6eeda9d check requireservercookie even if rrl is configured 2018-11-06 10:10:04 +11:00
Mark Andrews 56603265ee Merge branch '634-unchecked-returns-in-resolver-c' into 'master'
Resolve "Unchecked returns in resolver.c"

Closes #634

See merge request isc-projects/bind9!929
2018-11-05 18:03:05 -05:00
Mark AndrewsandEvan Hunt 99b25eb379 two dns_name_dup calls were not checked 2018-11-05 14:46:08 -08:00
Ondřej Surý ce5ac790bb Merge branch '645-fix-missing-buffer-init' into 'master'
dighost.c: after invalidating buffer we need to reinit it

Closes #645

See merge request isc-projects/bind9!976
2018-11-05 15:05:48 -05:00
Witold Kręcicki b2f8f37b80 dighost.c: after invalidating buffer we need to reinit it 2018-11-05 18:59:44 +00:00
Witold Krecicki ae5c86ba9a Merge branch '16-cleanup-finds-before-sending-final-query' into 'master'
Cleanup fctx->finds before sending 'final' query after qname minimization.

Closes #16

See merge request isc-projects/bind9!962
2018-11-05 05:06:32 -05:00
Witold Kręcicki 2d0a33208c Cleanup fctx->finds before sending 'final' query after qname minimization.
At the beginning of qname minimization we get fctx->finds filled with what's
in the cache at this point, in worst case root servers. After doing full
run querying for NSes at different levels we need to clean it and refill
it with proper values from cache.
2018-11-05 09:57:11 +00:00
Evan Hunt d88efa7e40 Merge branch 'fix-dnstap-test' into 'master'
disable QNAME minimization in the dnstap test so packet counts will be correct

See merge request isc-projects/bind9!971
2018-11-02 14:35:54 -04:00
Evan Hunt fc99651d7d disable QNAME minimization in the dnstap test so packet counts will be correct 2018-11-02 11:34:27 -07:00
Evan Hunt 9e61693210 Merge branch 'wpk-qmin-intermittent-fixes' into 'master'
Avoid a race in qmin test

See merge request isc-projects/bind9!954
2018-11-02 14:00:12 -04:00
Witold KręcickiandEvan Hunt 9163e93b9e Avoid a race in qmin test 2018-11-02 13:51:31 -04:00
Mark Andrews b4baa3e751 Merge branch 'u/fanf2/configure-backtrace' into 'master'
Correctly report backtrace support when `configure` finishes

See merge request isc-projects/bind9!967
2018-11-01 22:26:46 -04:00
Mark Andrews c94bd140e3 regen 2018-11-02 13:09:04 +11:00
Tony Finch f09c3a1189 Correctly report backtrace support when configure finishes 2018-11-01 13:45:34 +00:00
Michał Kępień 97bb9b2be9 Merge branch '611-extend-serve-stale-tests' into 'master'
Extend serve-stale tests

Closes #611

See merge request isc-projects/bind9!963
2018-10-31 09:26:42 -04:00
Michał Kępień 27cfe83a38 Check serve-stale behavior with a cold cache
Ensure that serve-stale works as expected when returning stale answers
is enabled, the authoritative server does not respond, and there is no
cached answer available.
2018-10-31 14:08:09 +01:00
Michał Kępień 893ab37ce7 Check TTL of stale answers
Make sure that stale answers returned when the serve-stale feature is
enabled have a TTL matching the value of the stale-answer-ttl setting.
2018-10-31 14:08:09 +01:00
Witold Krecicki 3290daa939 Merge branch 'wpk-get-rid-of-socket-v-functions' into 'master'
Get rid of socket *v functions

See merge request isc-projects/bind9!932
2018-10-31 08:57:08 -04:00
Michał Kępień 0e979358ee [squash] Rework code preparing a HTTP response for sending in lib/isc/httpd.c 2018-10-31 13:46:52 +01:00
Witold KręcickiandMichał Kępień 0e356d6a4a CHANGES entry 2018-10-31 12:12:53 +01:00
Witold KręcickiandMichał Kępień 54b9690a4e Remove vector socket functions from Unix socket code and library headers
Remove the following functions in order to simplify socket code:

  - isc_socket_recvv()
  - isc_socket_sendtov()
  - isc_socket_sendtov2()
  - isc_socket_sendv()
2018-10-31 12:12:53 +01:00
Witold KręcickiandMichał Kępień 76ec6861e5 Remove vector socket functions from Windows socket code
Remove the following functions in order to simplify socket code:

  - isc_socket_recvv()
  - isc_socket_sendtov()
  - isc_socket_sendtov2()
  - isc_socket_sendv()
2018-10-31 12:12:53 +01:00
Witold KręcickiandMichał Kępień 428daba5ce Do not use vector socket functions in diagnostic tools
Refactor diagnostic tools code to no longer use:

  - isc_socket_recvv()
  - isc_socket_sendtov2()
  - isc_socket_sendv()

as these functions will be removed shortly.
2018-10-31 12:12:53 +01:00
Witold KręcickiandMichał Kępień 07eebc42e4 Do not use vector socket functions in HTTP server code
Refactor code in lib/isc/httpd.c to no longer use isc_socket_sendv() as
this function will be removed shortly.
2018-10-31 12:12:50 +01:00
Mark Andrews 3b6f9db3fb Merge branch '649-resolver-test-failing' into 'master'
Resolve "resolver test failing"

Closes #649

See merge request isc-projects/bind9!959
2018-10-31 01:28:46 -04:00
Mark Andrews 280d0ca507 use new packet for response; rename variable to request and response 2018-10-31 16:14:43 +11:00
Witold Krecicki 5794c78159 Merge branch 'wpk-fix-catz-test-race' into 'master'
catz test: wait for dom8.example to be transferred before checking its availability

See merge request isc-projects/bind9!946
2018-10-30 15:17:02 -04:00
Witold Kręcicki 67f824434f Fix style in catz test 2018-10-30 19:08:11 +00:00
Witold Kręcicki ce47ca8c6b catz test: wait for dom8.example to be transferred before checking its availability 2018-10-30 19:08:11 +00:00
Evan Hunt 05bf7e4e3e Merge branch '647-config-h' into 'master'
remove config.h references

Closes #647

See merge request isc-projects/bind9!958
2018-10-30 13:51:13 -04:00
Evan Hunt b27630a130 remove config.h references 2018-10-30 10:42:41 -07:00
Evan Hunt 1ac7058a0f Merge branch 'silence-warning' into 'master'
silence warning from missing print.h

See merge request isc-projects/bind9!955
2018-10-30 11:07:53 -04:00
Evan Hunt a0de6707c0 silence warning from missing print.h 2018-10-30 08:06:34 -07:00
Ondřej Surý 29e7501bef Merge branch '84-destroy-task-first-when-destroying-rpzs' into 'master'
Destroy updater task first when destroying rpzs.

Closes #84

See merge request isc-projects/bind9!944
2018-10-30 09:02:02 -04:00
Witold KręcickiandOndřej Surý 19c4fe93c4 CHANGES entry 2018-10-30 14:01:24 +01:00
Ondřej Surý c1d111cd2e Destroy task first when destroying catzs.
When freeing catzs structures we need to kill the updater task first.
    Otherwise we might race with the updater and there might be a crash
    on shutdown.
2018-10-30 14:01:01 +01:00
Witold KręcickiandOndřej Surý 541872bf3b Destroy task first when destroying rpzs.
When freeing rpzs structures we need to kill the updater task first.
Otherwise we might race with the updater and there might be a crash
on shutdown.
2018-10-30 14:01:01 +01:00
Michał Kępień faa52a704f Merge branch '644-fix-isc_buffer_copyregion-for-auto-reallocated-buffers' into 'master'
Fix isc_buffer_copyregion() for auto-reallocated buffers

Closes #644

See merge request isc-projects/bind9!949
2018-10-30 08:52:25 -04:00
Michał Kępień 07050fb49a Add CHANGES entry
5072.	[bug]		Add unit tests for isc_buffer_copyregion() and fix its
			behavior for auto-reallocated buffers. [GL #644]
2018-10-30 13:33:25 +01:00
Michał Kępień e1f0aed034 Fix isc_buffer_copyregion() for auto-reallocated buffers
While isc_buffer_copyregion() calls isc_buffer_reserve() to ensure the
target buffer will have enough available space to append the contents of
the source region to it, the variables used for subsequently checking
available space are not updated accordingly after that call.  This
prevents isc_buffer_copyregion() from working as expected for
auto-reallocated buffers: ISC_R_NOSPACE will be returned if enough space
is not already available in the target buffer before it is reallocated.
Fix by calling isc_buffer_used() and isc_buffer_availablelength()
directly instead of assigning their return values to local variables.
2018-10-30 13:33:25 +01:00
Michał Kępień 15440d8027 Add unit tests for isc_buffer_copyregion()
Add some basic checks for isc_buffer_copyregion() to ensure it behaves
as expected for both fixed-size buffers and buffers which can be
automatically reallocated.  Adjust the list of headers included by
lib/isc/tests/buffer_test.c so that it matches what that test program
really uses.
2018-10-30 13:33:25 +01:00
Ondřej Surý 0c23a3b0c0 Merge branch 'ondrej/cleanup-leftover-fatal' into 'master'
Remove double result check leftover

See merge request isc-projects/bind9!945
2018-10-30 07:56:51 -04:00
Ondřej Surý 065ff16e40 Remove double result check leftover 2018-10-30 10:30:40 +00:00
Mark Andrews 503e9b70cf Merge branch '631-dns_rdata_compare-for-nxt-performs-case-sensitive-name-comparison' into 'master'
Resolve "dns_rdata_compare() for NXT performs case sensitive name comparison"

Closes #631

See merge request isc-projects/bind9!917
2018-10-29 23:59:52 -04:00
Mark Andrews 921bc89f59 add CHANGES note 2018-10-30 14:51:39 +11:00
Mark Andrews cf83016682 compare_nxt compared records with identical next fields case insensitively 2018-10-30 14:51:39 +11:00
Mark Andrews f2368ce181 Merge branch '638-record-types-with-empty-rdata-fields-were-not-being-handled-correctly' into 'master'
Resolve "Record types with empty rdata fields were not being handled correctly."

Closes #638

See merge request isc-projects/bind9!919
2018-10-29 20:11:22 -04:00
Mark Andrews 97a680e5ce document eol 2018-10-30 11:03:02 +11:00
Mark Andrews 2ff57d8a39 Record types which support a empty rdata field were not handling the empty rdata field case. 2018-10-30 11:03:02 +11:00
Witold Krecicki 9ff13b23f7 Merge branch 'wpk-fix-race-in-rpz-with-min-update-interval-0' into 'master'
Fix a race in RPZ with min-update-interval set to 0

Closes #643

See merge request isc-projects/bind9!907
2018-10-29 18:12:09 -04:00
Witold Kręcicki 8283cbabdc <stdlib.h> include in rpz.c for strtoul 2018-10-29 23:04:01 +01:00
Michał KępieńandWitold Kręcicki 139bc2c6ab Release all resources when shutting down an RPZ zone during an update
If an RPZ zone is to be freed during an update, canceling the
update_quantum() event is not enough because the resources released when
an update completes also need to be accounted for.  Failure to do this
results in a hang upon shutdown.  Fix by copying cleanup code from the
end of update_quantum() to rpz_detach().
2018-10-29 23:04:00 +01:00
Witold Kręcicki faf2c7711a Fix a race in RPZ with min-update-interval set to 0
If another RPZ update is pending when processing the previous one nears
completion and min-update-interval is set to 0, isc_timer_reset() gets
called with 'interval' set to 0, which triggers an assertion failure.
To prevent such a scenario from causing a crash, queue the update event
directly instead of asking the timer thread to do it.
2018-10-29 23:04:00 +01:00
Witold Krecicki c3b6eaf3d2 Merge branch '361-forwarding-qname-minimization' into 'master'
Resolve "Issue With MR 253 QNAME Minimization"

Closes #361 and #583

See merge request isc-projects/bind9!933
2018-10-29 15:31:00 -04:00
Witold Kręcicki 55a12a4136 Changes 2018-10-29 19:22:31 +00:00
Witold Kręcicki 37df3ca8b6 Style nits 2018-10-29 19:22:10 +00:00
Witold Kręcicki 08460c8cb2 Don't do qname minimization when forwarding; Avoid some intermittent errors in qmin tests caused by timing 2018-10-29 19:22:10 +00:00
Witold Kręcicki b4ca282589 Test for #361 - forwarding breaks with qname minimization 2018-10-29 19:22:10 +00:00
Evan Hunt 68f1e8e940 Merge branch '642-missing-include' into 'master'
added stdatomic.h and md.h

Closes #642

See merge request isc-projects/bind9!936
2018-10-29 14:35:23 -04:00
Evan Hunt dfe5d3330c added stdatomic.h and md.h 2018-10-29 11:26:38 -07:00
Evan Hunt ea9a5e3da4 Merge branch '641-unquoted-rpz' into 'master'
allow unquoted response-policy zone names

Closes #641

See merge request isc-projects/bind9!926
2018-10-29 12:41:35 -04:00
Evan Hunt 507230aa88 allow unquoted response-policy zone names 2018-10-29 12:25:35 -04:00
Mark Andrews c6efbe5d26 Merge branch '635-unchecked-return-in-query-c' into 'master'
Resolve "unchecked return in query.c"

Closes #635

See merge request isc-projects/bind9!925
2018-10-29 03:21:26 -04:00
Mark Andrews e11cfafff2 always call RUNTIME_CHECK(result == ISC_R_SUCCESS); for dns_rdata_tostruct 2018-10-29 03:13:12 -04:00
Mark Andrews 276858d88f Merge branch '553-socket-c-2171-unexpected-error' into 'master'
Resolve "socket.c:2171: unexpected error"

Closes #553

See merge request isc-projects/bind9!924
2018-10-29 02:25:37 -04:00
Mark Andrews 561b780ba0 Only set IPV6_USE_MIN_MTU on IPv6. 2018-10-29 16:49:33 +11:00
Mark Andrews 1454665d70 Merge branch '624-lib-dns-dnstap_test-totext-does-not-work-well-with-softhsm-pkcs11' into 'master'
Resolve "lib/dns/dnstap_test:totext does not work well with SoftHSM PKCS11"

Closes #624

See merge request isc-projects/bind9!921
2018-10-29 01:25:05 -04:00
Mark Andrews 1cf1254051 Initalize TZ environment variable before calling dns_test_begin in dnstap_test. 2018-10-29 16:15:52 +11:00
Ondřej Surý 87b042a48d Merge branch '639-fix-freebsd-build' into 'master'
avoid makefile conditional

Closes #639

See merge request isc-projects/bind9!920
2018-10-28 10:18:47 -04:00
Evan Hunt ff747365db avoid makefile conditional 2018-10-26 23:34:34 -07:00
Ondřej Surý 241594299b Merge branch '22-remove-last-traces-of-already-removed-algorithms' into 'master'
Remove various leftovers for algorithms that have been already removed from BIND

See merge request isc-projects/bind9!901
2018-10-26 06:01:54 -04:00
Ondřej Surý 58cfb2a18a Convert the bin/tests/optional/sig0_test.c to use RSASHA1 instead of DSA 2018-10-26 11:50:11 +02:00
Ondřej Surý 8a6c37faa2 Remove last traces of ECCGOST algorithm 2018-10-26 11:50:11 +02:00
Ondřej Surý d6c50674bb Remove last traces of DSA and NSEC3DSA algorithm, but restore the algnumber -> name mapping 2018-10-26 11:50:11 +02:00
Ondřej Surý 83dbe04bf3 Update dst_test.c to use ECDSA256 and RSASHA256 as test algorithms 2018-10-26 11:50:11 +02:00
Ondřej Surý fbb08b30b8 Remove traces of DST_ALG_ECC which is now just Reserved in IANA registry 2018-10-26 11:50:11 +02:00
Ondřej Surý 8efd394c80 Remove last bits of PKCS#11 DH support that has been already removed 2018-10-26 11:50:11 +02:00
Witold Krecicki cc8c79bb69 Merge branch 'wpk-statschannel-test-timing' into 'master'
statschannel test fix

See merge request isc-projects/bind9!909
2018-10-26 05:12:34 -04:00
Witold Kręcicki b338e6dd21 CHANGES 2018-10-26 08:38:00 +00:00
Witold Kręcicki 5979471dc7 statschannel test: try 5 times to check if compressed and regular output of statschannel is the same - some counters can change, minimize risk of bad timing 2018-10-26 08:36:48 +00:00
Witold Krecicki 7ef2467e6a Merge branch 'wpk-non-crypto-secure-cookies' into 'master'
Cookies with non-crypto-secure random

See merge request isc-projects/bind9!887
2018-10-26 04:03:55 -04:00
Witold Kręcicki 6cd89d5e9f Use non-cryptographically-secure PRNG to generate a nonce for cookies.
Rationale: the nonce here is only used to make sure there is a low
probability of duplication, according to section B.2 of RFC7873.
It is only 32-bit, and even if an attacker knows the algorithm used
to generate nonces it won't, in any way, give him any platform to
attack the server as long as server secret used to sign the
(nonce, time) pair with HMAC-SHA1 is secure.

On the other hand, currently, each packet sent requires (unnecessarily)
a CS pseudo-random number which is ineffective.
2018-10-26 07:54:58 +00:00
Mark Andrews 9ecb0a9168 Merge branch '633-resource-leak-in-hmac_fromdns' into 'master'
Resolve "resource leak in hmac_fromdns"

Closes #633

See merge request isc-projects/bind9!918
2018-10-26 03:04:15 -04:00
Mark Andrews 3219a873a9 free hkey on error 2018-10-26 17:46:15 +11:00
Ondřej Surý bd3163578b Merge branch '632-check-for-individual-openssl-functions' into 'master'
Check for individual OpenSSL functions instead of relying on version number

Closes #632

See merge request isc-projects/bind9!916
2018-10-26 01:05:34 -04:00
Ondřej Surý eb603cb021 Check for individual OpenSSL functions instead of relying on version number 2018-10-26 06:15:51 +02:00
Mark Andrews 7e2026a50b Merge branch '632-evp_cipher_ctx_free-and-evp_cipher_ctx_new-exist-in-openssl-1-0-1' into 'master'
Resolve "EVP_CIPHER_CTX_free and EVP_CIPHER_CTX_new exist in OpenSSL 1.0.1"

Closes #632

See merge request isc-projects/bind9!915
2018-10-25 20:30:52 -04:00
Mark Andrews 632a0ae10b EVP_CIPHER_CTX_new and EVP_CIPHER_CTX_free exist in OpenSSL 1.0.1 2018-10-26 10:01:14 +11:00
Evan Hunt 826c3ddc5b Merge branch '626-implement-eid-and-nimloc' into 'master'
Resolve "Implement EID and NIMLOC"

Closes #626

See merge request isc-projects/bind9!895
2018-10-25 18:29:29 -04:00
Mark AndrewsandEvan Hunt fbab100426 Add support for EID and NIMLOC 2018-10-25 15:20:33 -07:00
Evan Hunt 343333f5c4 Merge branch '627-check-that-gid-uid-and-uinfo-can-be-loaded-using-unknown-record-format' into 'master'
Resolve "Check that GID, UID and UINFO can be loaded using unknown record format."

Closes #627

See merge request isc-projects/bind9!896
2018-10-25 16:34:09 -04:00
Mark AndrewsandEvan Hunt eb7ca65b78 GID, UID and UINFO could not be loaded using unknown record format. 2018-10-25 13:00:32 -07:00
Ondřej Surý 89b186b604 Merge branch '629-fix-isc_md-on-windows' into 'master'
Resolve "Windows Build Errors After !355 (Refactor Message Digest and HMAC API)"

Closes #629

See merge request isc-projects/bind9!908
2018-10-25 15:20:48 -04:00
Ondřej Surý c3846425f3 Don't include inet/arpa.h on Windows 2018-10-25 20:59:48 +02:00
Ondřej Surý 68b49d87b2 Add md.h and md.c to Windows build files 2018-10-25 20:59:48 +02:00
Ondřej Surý 99d919c90f Merge branch '630-dont-enable-fips-mode-on-windows' into 'master'
Disable FIPS mode on Windows

Closes #630

See merge request isc-projects/bind9!905
2018-10-25 14:58:26 -04:00
Ondřej SurýandOndřej Surý 6aae193ded Disable FIPS mode on Windows 2018-10-25 14:47:44 -04:00
Ondřej Surý 25805beb29 Merge branch 'fix-openssl-mctx' into 'master'
correctly attach and detach memory context

See merge request isc-projects/bind9!906
2018-10-25 14:47:20 -04:00
Evan Hunt c852810fbc correctly attach and detach memory context 2018-10-25 11:27:28 -07:00
Ondřej Surý cbdb69f4cc Merge branch 'update-release-checklist-merge-prep-commit' into 'master'
Update release checklist: merge prep commit

See merge request isc-projects/bind9!902
2018-10-25 08:36:44 -04:00
Michał Kępień 88f346a952 Update release checklist: merge prep commit 2018-10-25 14:00:21 +02:00
Michał Kępień 313d2b836f Merge branch '427-list-zones-in-the-web-interface' into 'master'
Display a per-view list of zones in the web interface

Closes #427

See merge request isc-projects/bind9!547
2018-10-25 04:39:26 -04:00
Michał Kępień d9c4068cc3 Add CHANGES entry
5059.	[bug]		Display a per-view list of zones in the web interface.
			[GL #427]
2018-10-25 10:03:03 +02:00
Michał Kępień aeda3f389e Display a per-view list of zones in the web interface
The XSL stylesheet used by the web interface does not currently include
any element which would cause a list of zones configured in each view to
be displayed, making the "Zones" section of the web interface empty
unless some zone has been configured with "zone-statistics full;" and
queried.  Since this can be confusing, modify the XSL stylesheet so that
a list of zones configured in each view is displayed in the web
interface.
2018-10-25 10:03:03 +02:00
Ondřej Surý 530f3dcf07 Merge branch '305-refactor-message-digest-functions' into 'master'
Refactor Message Digest and HMAC API

Closes #305

See merge request isc-projects/bind9!355
2018-10-25 02:33:31 -04:00
Ondřej Surý 189f3ae097 Add CHANGES entry for GL #305.
XXXX.   [func]          Replace old message digest and hmac APIs with more
                        generic isc_md and isc_hmac APIs, and convert their
			respective tests to cmocka. [GL #305]
2018-10-25 08:16:46 +02:00
Ondřej Surý 13888c93a4 Split isc_crc64 API test into separate unit test and convert it to cmocka 2018-10-25 08:16:24 +02:00
Ondřej Surý 7fc78e7cad Remove internal dst memory context that was used just for OpenSSL and was passthrough for malloc and free 2018-10-25 08:16:24 +02:00
Ondřej Surý af69bf5491 Add tkey_test.c with mocked isc_mem object 2018-10-25 08:16:24 +02:00
Ondřej Surý b98ac2593c Add generic hashed message authentication code API (isc_hmac) to replace specific HMAC functions hmacmd5/hmacsha1/hmacsha2... 2018-10-25 08:15:42 +02:00
Ondřej Surý 7fd3dc63de Add generic message digest API (isc_md) to replace specific MD functions md5/sha1/sha256 2018-10-25 08:15:42 +02:00
Ondřej Surý 4b636bf74e Add kyua.log to .gitignore 2018-10-25 08:08:51 +02:00
Mark Andrews 0484c3a0ba Merge branch '619-implement-atma' into 'master'
Resolve "Implement ATMA"

Closes #619

See merge request isc-projects/bind9!885
2018-10-24 22:32:46 -04:00
Mark Andrews f9ceddd8ca Add support for ATMA 2018-10-25 13:21:49 +11:00
Mark Andrews a4b97b69f3 Merge branch '609-address-memory-leak-on-error' into 'master'
Resolve "Address memory leak on error"

Closes #609

See merge request isc-projects/bind9!860
2018-10-24 22:13:27 -04:00
Mark Andrews afde30fe9b expand the pool then copy over the old entries so we that failures do not break the old pool; also don't leak the new pool on error 2018-10-24 22:00:08 -04:00
Evan Hunt 3171f0dab9 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!890
2018-10-24 19:08:59 -04:00
Evan Hunt 5888c2866d placeholder 2018-10-24 16:08:16 -07:00
Ondřej Surý 7b2eaca5fe Merge branch '564-mirror-zone-configuration-tweaks-and-cleanups' into 'master'
Mirror zone configuration tweaks and cleanups

Closes #564, #375, and #342

See merge request isc-projects/bind9!815
2018-10-24 14:51:37 -04:00
Michał KępieńandOndřej Surý 5b699aaa42 Add CHANGES entry
XXXX.	[func]		A default list of primary servers for the root zone is
			now built into named, allowing the "masters" statement
			to be omitted when configuring an IANA root zone
			mirror. [GL #564]

XXXX.	[func]		Attempts to use mirror zones with recursion disabled
			are now considered a configuration error. [GL #564]

XXXX.	[func]		The only valid zone-level NOTIFY settings for mirror
			zones are now "notify no;" and "notify explicit;".
			[GL #564]

XXXX.	[func]		Mirror zones are now configured using "type mirror;"
			rather than "mirror yes;". [GL #564]
2018-10-24 20:33:41 +02:00
Michał KępieńandOndřej Surý 7bb3d000a5 Update documentation 2018-10-24 20:32:56 +02:00
Michał KępieńandOndřej Surý adbe2caf28 Test whether mirror zones can be added and removed dynamically
Extend the "mirror" zone system test to make sure mirror zones can be
added and removed dynamically using rndc.
2018-10-24 20:32:56 +02:00
Michał KępieńandOndřej Surý 2c69734bcf Define a default master server list for the root zone
To minimize the effort required to set up IANA root zone mirroring,
define a default master server list for the root zone and use it when
that zone is to be mirrored and no master server list was explicitly
specified.  Contents of that list are taken from RFC 7706 and are
subject to change in future releases.

Since the static get_masters_def() function in bin/named/config.c does
exactly what named_zone_configure() in bin/named/zoneconf.c needs to do,
make the former non-static and use it in the latter to prevent code
duplication.
2018-10-24 20:32:55 +02:00
Michał KępieńandOndřej Surý 34dc674fed Prevent mirror zones from being used when recursion is disabled
Since mirror zone data is treated as cache data for access control
purposes, configuring a mirror zone and disabling recursion at the same
time would effectively prevent mirror zone data from being used since
disabling recursion also disables cache access to all clients by
default.  Even though this behavior can be inhibited by configuration,
mirror zones are a recursive resolver feature and thus recursion is now
required to use them.

Ignore the fact that certain configurations might still trick named into
assuming recursion is enabled when it effectively is not since this
change is not meant to put a hard policy in place but rather just to
prevent accidental mirror zone misuse.
2018-10-24 20:32:55 +02:00
Michał KępieńandOndřej Surý 1d49b01cc6 Clean up handling of NOTIFY settings for mirror zones
Previous way of handling NOTIFY settings for mirror zones was a bit
tricky: any value of the "notify" option was accepted, but it was
subsequently overridden with dns_notifytype_explicit.  Given the way
zone configuration is performed, this resulted in the following
behavior:

  - if "notify yes;" was set explicitly at any configuration level or
    inherited from default configuration, it was silently changed and so
    only hosts specified in "also-notify", if any, were notified,

  - if "notify no;" was set at any configuration level, it was
    effectively honored since even though zone->notifytype was silently
    set to dns_notifytype_explicit, the "also-notify" option was never
    processed due to "notify no;" being set.

Effectively, this only allowed the hosts specified in "also-notify" to
be notified, when either "notify yes;" or "notify explicit;" was
explicitly set or inherited from default configuration.

Clean up handling of NOTIFY settings for mirror zones by:

  - reporting a configuration error when anything else than "notify no;"
    or "notify explicit;" is set for a mirror zone at the zone level,

  - overriding inherited "notify yes;" setting with "notify explicit;"
    for mirror zones,

  - informing the user when the "notify" setting is overridden, unless
    the setting in question was inherited from default configuration.
2018-10-24 20:32:55 +02:00
Michał KępieńandOndřej Surý 2cb9e8a020 Replace the "mirror" zone option with "type mirror;"
Use a zone's 'type' field instead of the value of its DNS_ZONEOPT_MIRROR
option for checking whether it is a mirror zone.  This makes said zone
option and its associated helper function, dns_zone_mirror(), redundant,
so remove them.  Remove a check specific to mirror zones from
named_zone_reusable() since another check in that function ensures that
changing a zone's type prevents it from being reused during
reconfiguration.
2018-10-24 20:32:55 +02:00
Michał KępieńandOndřej Surý e1bb8de6f0 Define a separate dns_zonetype_t for mirror zones
Rather than overloading dns_zone_slave and discerning between a slave
zone and a mirror zone using a zone option, define a separate enum
value, dns_zone_mirror, to be used exclusively by mirror zones.  Update
code handling slave zones to ensure it also handles mirror zones where
applicable.
2018-10-24 20:32:55 +02:00
Michał KępieńandOndřej Surý 4a83ccf071 Handle "type mirror;" when parsing zone configuration
Add a new zone type, CFG_ZONE_MIRROR, to libisccfg, in order to limit
the list of options which are considered valid for mirror zones.  Update
the relevant configuration checks.
2018-10-24 20:32:55 +02:00
Ondřej Surý 1ab27e3d53 Merge branch '582-fix-server-addresses-configuration-type' into 'master'
Fix the configuration type used by the "server-addresses" option

Closes #582

See merge request isc-projects/bind9!856
2018-10-24 09:39:01 -04:00
Michał KępieńandOndřej Surý 6b1c0a8e6f Add CHANGES entry
5048.	[doc]		Documentation incorrectly stated that the
			"server-addresses" static-stub zone option accepts
			custom port numbers. [GL #582]
2018-10-24 15:13:31 +02:00
Michał KępieńandOndřej Surý b324576858 Fix the configuration type used by the "server-addresses" option
Contrary to what the documentation states, the "server-addresses"
static-stub zone option does not accept custom port numbers.  Fix the
configuration type used by the "server-addresses" option to ensure
documentation matches source code.  Remove a check_zoneconf() test which
is unnecessary with this fix in place.
2018-10-24 15:13:31 +02:00
Evan Hunt ed35755a24 Merge branch 'wpk-temporarily-disable-qmin-for-rpz' into 'master'
Disable qname minimization in RPZ test for now

See merge request isc-projects/bind9!882
2018-10-23 22:49:29 -04:00
Witold KręcickiandEvan Hunt af5f10fcf6 Disable qname minimization in RPZ test for now 2018-10-23 22:41:29 -04:00
Mark Andrews fa3d8f7d70 Merge branch '610-address-memory-leak-on-error' into 'master'
Resolve "Address memory leak on error"

Closes #610

See merge request isc-projects/bind9!859
2018-10-23 20:51:58 -04:00
Mark Andrews 607c2d7441 free key on error 2018-10-23 20:19:07 -04:00
Evan Hunt d5e69f0598 Merge branch 'cleanup-changes' into 'master'
minor CHANGES edits

See merge request isc-projects/bind9!880
2018-10-23 16:29:51 -04:00
Evan Hunt 57bb2f56f4 minor edits 2018-10-23 13:28:57 -07:00
Michał Kępień 01c174e02e Merge branch '187-libirs-handle-scoped-ipv6-addresses-in-etc-resolv.conf' into 'master'
libirs: handle scoped IPv6 addresses in /etc/resolv.conf

Closes #187

See merge request isc-projects/bind9!854
2018-10-23 09:13:14 -04:00
Michał Kępień b7564cc898 Add CHANGES entry
5050.	[bug]		The libirs version of getaddrinfo() was unable to parse
			scoped IPv6 addresses present in /etc/resolv.conf.
			[GL #187]
2018-10-23 14:50:00 +02:00
Michał Kępień 76d49c05be libirs: handle scoped IPv6 addresses in /etc/resolv.conf
Commonly used network configuration tools write scoped IPv6 nameserver
addresses to /etc/resolv.conf.  libirs only handles these when it is
compiled with -DIRS_HAVE_SIN6_SCOPE_ID, which is not the default, and
only handles numeric scopes, which is not what network configuration
tools typically use.  This causes dig to be practically unable to handle
scoped IPv6 nameserver addresses in /etc/resolv.conf.

Fix the problem by:

  - not requiring a custom compile-time flag to be set in order for
    scoped IPv6 addresses to be processed by getaddrinfo(),

  - parsing non-numeric scope identifiers using if_nametoindex(),

  - setting the sin6_scope_id field in struct sockaddr_in6 structures
    returned by getaddrinfo() even if the AI_CANONNAME flag is not set.
2018-10-23 14:50:00 +02:00
Witold Krecicki 2791bf9285 Merge branch '16-qname-minimization-newfctx' into 'master'
QNAME minimization remake

See merge request isc-projects/bind9!548
2018-10-23 08:33:12 -04:00
Mark AndrewsandWitold Kręcicki b6e2d7bca9 use ns_client_log 2018-10-23 12:15:25 +00:00
Mark AndrewsandWitold Kręcicki ffb9f721f0 log pre rrl check state 2018-10-23 12:15:25 +00:00
Witold Kręcicki 5c422ce803 changes 2018-10-23 12:15:25 +00:00
Mark AndrewsandWitold Kręcicki 15c3bf9e82 stop.pl: report test being stopped 2018-10-23 12:15:04 +00:00
Mark AndrewsandWitold Kręcicki ba85bb1a85 whitespace 2018-10-23 12:15:04 +00:00
Mark AndrewsandWitold Kręcicki 2b3b626cc1 set fctx->client to NULL 2018-10-23 12:15:04 +00:00
Mark AndrewsandWitold Kręcicki 23766ff690 checkpoint 2018-10-23 12:15:04 +00:00
Witold Kręcicki 86246c7431 Initialize adbname->client properly; check for loops 2018-10-23 12:15:04 +00:00
Mark AndrewsandWitold Kręcicki 2f36a62d16 use RUNTIME_CHECK 2018-10-23 12:15:04 +00:00
Mark AndrewsandWitold Kręcicki 1a2a19c693 address fctx reference count leaks; style 2018-10-23 12:15:04 +00:00
Witold Kręcicki f2af336dc4 Fix looping issues 2018-10-23 12:15:04 +00:00
Witold Kręcicki 0246ea14c4 Make resolver tests more civilized 2018-10-23 12:15:04 +00:00
Mark AndrewsandWitold Kręcicki 98ab65dbe9 qmin: fixup expected queries for query for .ugly succeds when qname-minimization is in relaxed mode 2018-10-23 12:15:04 +00:00
Mark AndrewsandWitold Kręcicki 4754f53979 qmin: fix 'query for .ugly fails when qname-minimization is in strict mode'; remove debugging echos 2018-10-23 12:15:04 +00:00
Witold Kręcicki 70a1ba20ec QNAME miminimization should create a separate fetch context for each fetch -
this makes the cache more efficient and eliminates duplicates queries.
2018-10-23 12:15:04 +00:00
Michał Kępień 36e431d632 Merge branch 'wpk-servfail-on-upstream-formerr' into 'master'
Set result to SERVFAIL if upstream responded with FORMERR

See merge request isc-projects/bind9!876
2018-10-23 08:09:11 -04:00
Witold KręcickiandMichał Kępień b5c9a8caad Set result to SERVFAIL if upstream responded with FORMERR
Commit ba91243542 causes the resolver to
respond to a client query with FORMERR when all upstream queries sent to
the servers authoritative for QNAME elicit FORMERR responses.  This
happens because resolver code returns DNS_R_FORMERR in such a case and
dns_result_torcode() acts as a pass-through for all arguments which are
already a valid RCODE.

The correct RCODE to set in the response returned to the client in the
case described above is SERVFAIL.  Make sure this happens by overriding
the RCODE in query_gotanswer(), on the grounds that any format errors in
the client query itself should be caught long before execution reaches
that point.  This change should not reduce query error logging accuracy
as the resolver code itself reports the exact reason for returning a
DNS_R_FORMERR result using log_formerr().
2018-10-23 13:50:27 +02:00
Ondřej Surý 9fd3c8a939 Merge branch '4-rename-configure.in-to-configure.ac' into 'master'
Rename configure.in to configure.ac

See merge request isc-projects/bind9!872
2018-10-23 04:11:31 -04:00
Ondřej Surý 866991c2cb Rename configure.in to proper name configure.ac 2018-10-23 09:55:26 +02:00
Ondřej Surý cb6b555f07 Merge branch '612-problems-compiling-on-arm-processor' into 'master'
Resolve "Problems compiling on arm processor"

Closes #612

See merge request isc-projects/bind9!869
2018-10-23 03:46:33 -04:00
Ondřej Surý 032e6963fe Check for yield support on ARM and print helpfull error message about -march 2018-10-23 09:35:00 +02:00
Ondřej Surý 4b47958163 Fix typo in isc_rwlock_pause() on sparc 2018-10-23 09:29:03 +02:00
Ondřej Surý b6368ffdad Add information compilation instructions for support on ARM 2018-10-23 09:29:03 +02:00
Ondřej Surý 8ae6280165 Merge branch '506-print-fips-mode' into 'master'
Add configure option to enable FIPS mode if OpenSSL provides the option

Closes #506

See merge request isc-projects/bind9!853
2018-10-22 15:18:45 -04:00
Ondřej Surý 9d29f73b79 Add CHANGES note.
XXXX.	[feature]	Add configure option to enabled and enforce FIPS mode
			in BIND 9. [GL #506]
2018-10-22 20:55:35 +02:00
Ondřej Surý 60862c5769 Add release notes for the FIPS mode feature 2018-10-22 20:55:35 +02:00
Ondřej Surý c4cee27f9b Add support for enabling and enforcing FIPS mode in OpenSSL:
* Add configure option --enable-fips-mode that detects and enables FIPS mode
* Add a function to enable FIPS mode and call it on crypto init
* Log an OpenSSL error when FIPS_mode_set() fails and exit
* Report FIPS mode status in a separate log message from named
2018-10-22 20:55:35 +02:00
Michał Kępień 0f62a5ce04 Merge branch '565-automatically-trigger-gitlab-pages-pipelines' into 'master'
Automatically trigger GitLab Pages pipelines

Closes #565

See merge request isc-projects/bind9!866
2018-10-20 18:01:52 -04:00
Michał Kępień 31bde118db Automatically trigger GitLab Pages pipelines
Whenever master or one for the v9_* branches gets updated, the current
ARM should be published on GitLab Pages.  Add a pipeline stage which
takes care of triggering GitLab Pages pipelines.  Extend the lifetime of
artifact archives containing the ARM to prevent GitLab Pages pipelines
from failing due to artifacts being unavailable.
2018-10-20 23:29:20 +02:00
Michał Kępień a562043fac Merge branch '565-generate-the-arm-during-ci' into 'master'
Generate the ARM during CI

See merge request isc-projects/bind9!863
2018-10-20 06:17:11 -04:00
Michał Kępień 3f443468e0 Generate the ARM during CI
Add a CI job which generates the HTML version of the ARM and makes it
available for download.  Since this is expected to be a quick process,
the new job is enabled for all pipelines.
2018-10-19 22:42:44 +02:00
Evan Hunt 423d42fd7e Merge branch '607-win32-fixes' into 'master'
Resolve "windows builds are failing for master"

Closes #607

See merge request isc-projects/bind9!858
2018-10-19 04:04:37 -04:00
Evan Hunt e839972ee2 address unresolved externals 2018-10-19 00:49:53 -07:00
Evan Hunt 3f35ab8567 remove references to methods and app_api.c 2018-10-19 00:28:53 -07:00
Evan Hunt e8194526f4 Merge branch 'fix-windows' into 'master'
fix windows build error

Closes #607

See merge request isc-projects/bind9!857
2018-10-18 23:44:24 -04:00
Evan Hunt c609a67ac7 change to bool constants; also fixed style error 2018-10-18 20:42:25 -07:00
Witold Krecicki aaa66d2560 Merge branch '479-remove-isc_bind9' into 'master'
Remove isc_bind9 from (almost) everywhere

Closes #479

See merge request isc-projects/bind9!656
2018-10-18 06:39:42 -04:00
Evan HuntandWitold Kręcicki 09f58ab63f retain a minimal "methods" struct in the mctx
- this enables memory to be allocated and freed in dyndb modules
  when named is linked statically. when we standardize on libtool,
  this should become unnecessary.
- also, simplified the isc_mem_create/createx API by removing
  extra compatibility functions
2018-10-18 09:19:12 +00:00
Evan HuntandWitold Kręcicki 6f7c9623c5 remove isc_bind9 usage from view.c 2018-10-18 09:19:12 +00:00
Evan HuntandWitold Kręcicki 0e86fa16e8 complete removal of a few unneeded functions
- removed register functions from isc_app, isc_timer, isc_task
- added a task_p.h header for use by unit tests
2018-10-18 09:19:12 +00:00
Witold Kręcicki 38a127c35b Remove layering from isc_task, isc_app, isc_socket, isc_timer, isc_mem 2018-10-18 09:19:12 +00:00
Witold Kręcicki cdbac34cba Get rid of isc_bind9 conditional 2018-10-18 09:19:12 +00:00
Stephen Morris 60f22ff410 Merge branch 'stephen-update-releaase-template' into 'master'
Update release checklist as per discussion in Amsterdam BIND meeting.

See merge request isc-projects/bind9!852
2018-10-12 08:06:43 -04:00
Stephen Morris 4914f28858 Update release checklist as per discussion in Amsterdam BIND meeting. 2018-10-12 13:57:11 +02:00
Michał Kępień a9e1517a61 Merge branch '572-improve-accuracy-of-query-error-logging' into 'master'
Improve accuracy of query error logging

Closes #572

See merge request isc-projects/bind9!837
2018-10-08 07:01:43 -04:00
Michał Kępień dc531dc340 Add CHANGES entry
5047.	[bug]		Messages logged for certain query processing failures
			now include a more specific error description if it is
			available. [GL #572]
2018-10-08 12:47:28 +02:00
Michał Kępień ba91243542 Do not set qctx->result to DNS_R_SERVFAIL unless necessary
In some cases, setting qctx->result to DNS_R_SERVFAIL causes the value
of a 'result' variable containing a more specific failure reason to be
effectively discarded.  This may cause certain query error log messages
to lack specificity despite a more accurate problem cause being
determined during query processing.

In other cases, qctx->result is set to DNS_R_SERVFAIL even though a more
specific error (e.g. ISC_R_NOMEMORY) could be explicitly indicated.

Since the response message's RCODE is derived from qctx->result using
dns_result_torcode(), which handles a number of possible isc_result_t
values and returns SERVFAIL for anything not explicitly listed, it is
fine to set qctx->result to something more specific than DNS_R_SERVFAIL
(in fact, this is already being done in a few cases).  Modify most
QUERY_ERROR() calls so that qctx->result is set to a more specific error
code when possible.  Adjust query_error() so that statistics are still
calculated properly.  Remove the RECURSE_ERROR() macro which was
introduced exactly because qctx->result could be set to DNS_R_SERVFAIL
instead of DNS_R_DUPLICATE or DNS_R_DROP, which need special handling.
Modify dns_sdlz_putrr() so that it returns DNS_R_SERVFAIL when a DLZ
driver returns invalid RDATA, in order to prevent setting RCODE to
FORMERR (which is what dns_result_torcode() translates e.g. DNS_R_SYNTAX
to) while responding authoritatively.
2018-10-08 12:47:28 +02:00
Michał Kępień b3cd868c4b Remove the 'want_stale' field from struct query_ctx
As the previous commit makes the 'want_stale' field of struct query_ctx
redundant, remove it.
2018-10-08 12:47:28 +02:00
Michał Kępień cb48d410d8 Set up stale response lookup before query_done() is called
When something goes wrong while recursing for an answer to a query,
query_gotanswer() sets a flag (qctx->want_stale) in the query context.
query_done() is subsequently called and it can either set up a stale
response lookup (if serve-stale is enabled) or conclude that a SERVFAIL
response should be sent.  This may cause confusion when looking at query
error logs since the QUERY_ERROR() line responsible for setting the
response's RCODE to SERVFAIL is not in a catch-all branch of a switch
statement inside query_gotanswer() (like it is for authoritative
responses) but rather in a code branch which appears to have something
to do with serve-stale, even when the latter is not enabled.

Extract the part of query_done() responsible for checking serve-stale
configuration and optionally setting up a stale response lookup into a
separate function, query_usestale(), shifting the responsibility for
setting the response's RCODE to SERVFAIL to the same QUERY_ERROR() line
in query_gotanswer() which is evaluated for authoritative responses.
2018-10-08 12:47:28 +02:00
Evan Hunt e8f66bcfa3 Merge branch 'move-declaration' into 'master'
style correction

See merge request isc-projects/bind9!849
2018-10-05 14:25:00 -04:00
Evan Hunt c642f9970a move declaration to the top of the block 2018-10-05 11:13:54 -07:00
Evan Hunt 9bf25f7f1e Merge branch 'rpz-shutdown-crash' into 'master'
Fix crash at shutdown during an RPZ reload. [RT #46210]

See merge request isc-projects/bind9!71
2018-10-05 13:59:26 -04:00
Tony FinchandEvan Hunt 7a2b0ac92a Fix crash at shutdown during an RPZ reload. [RT #46210] 2018-10-05 13:58:47 -04:00
Evan Hunt 754dad21f5 Merge branch 'fix-windows' into 'master'
remove references to deleted files

See merge request isc-projects/bind9!847
2018-10-05 12:19:02 -04:00
Evan Hunt f14445f13d remove references to deleted files 2018-10-05 09:10:40 -07:00
Ondřej Surý a5bdc18ce6 Merge branch 'fix-openssl_shim' into 'master'
Remove HAVE_OPENSSL guard from openssl_shim.{c,h} and uncrustify it

See merge request isc-projects/bind9!846
2018-10-05 07:21:58 -04:00
Ondřej Surý 5ccbb274d2 Remove HAVE_OPENSSL guard from openssl_shim.{c,h} and uncrustify it 2018-10-05 13:12:48 +02:00
Ondřej Surý 0fffb82f81 Merge branch 'host-idn-disable' into 'master'
Disable IDN from environment as documented

See merge request isc-projects/bind9!800
2018-10-05 06:14:28 -04:00
Petr MenšíkandOndřej Surý ec1d9b80f5 Disable IDN from environment as documented
Manual page of host contained instructions to disable IDN processing
when it was built with libidn2. When refactoring IDN support however,
support for disabling IDN in host and nslookup was lost. Use also
environment variable and document it for nslookup, host and dig.
2018-10-05 05:58:33 -04:00
Ondřej Surý 0e74384991 Merge branch 'uncrustify' into 'master'
Add configuration for uncrustify

See merge request isc-projects/bind9!681
2018-10-05 05:56:09 -04:00
Evan HuntandOndřej Surý e6fc3d8f17 tweaks to the style
- tried to improve struct variable alignment
- ignore braces on function definitions so we can keep the existing
  BIND style; braces can be on a new line or not
2018-10-05 05:47:48 -04:00
Evan HuntandOndřej Surý d15b08a57c Update config file with documentation
- this can be regenerated automatically using
  uncrustify -c .uncrustify.cfg --update-config-with-doc
2018-10-05 05:47:48 -04:00
Evan HuntandOndřej Surý c2e2163165 Add an uncrustify config file as $TOP/.uncrustify.cfg
to update file, run: uncrustify --replace -c $TOP/.uncrustify.cfg <filename>

- note that if this is in the user's $HOME dir, it's the default
  uncrustify config path name. this can be overridden with
  'uncrustify -c filenaeme' or the UNCRUSTIFY_CONFIG environment
  variable
2018-10-05 05:47:48 -04:00
Ondřej Surý 4ec0f300a4 Merge branch '22-remove-DSA-algorithm' into 'master'
Remove support for obsoleted and insecure DSA and DSA-NSEC3-SHA1 algorithms

See merge request isc-projects/bind9!348
2018-10-05 05:44:11 -04:00
Ondřej Surý b8195a0251 Add CHANGES entry.
XXXX.	[cleanup]	Remove support for DNSSEC algorithms 3 (DSA)
			and 6 (DSA-NSEC3-SHA1). [GL #22]
2018-10-05 11:16:13 +02:00
Ondřej Surý 31b8b37e8f Add note about removing DSA and DSA-NSEC3-SHA1 to release notes 2018-10-05 11:16:13 +02:00
Ondřej Surý f207e0b52e Restore the algorithm names mapping in bin/python/isc/dnskey.py.in for DSA, NSEC3DSA, and ECCGOST 2018-10-05 11:16:13 +02:00
Ondřej Surý 09fd5c442b Convert the system tests that were using DSA to use a default algorithm defined in conf.sh 2018-10-05 11:16:13 +02:00
Ondřej Surý 3994b1f9c2 Remove support for obsoleted and insecure DSA and DSA-NSEC3-SHA1 algorithms 2018-10-05 09:21:43 +02:00
Evan Hunt 6aadf7c8ab Merge branch '388-clarify-dnssec-enable' into 'master'
Clarify the relationship between "dnssec-enable" and "dnssec-validation" 

Closes #388

See merge request isc-projects/bind9!483
2018-10-05 02:41:54 -04:00
Evan Hunt c9eb1518d6 CHANGES, copyrights 2018-10-04 23:33:18 -07:00
Evan Hunt 2f0897caff add a test case 2018-10-04 23:33:18 -07:00
Evan Hunt ff49dd3c21 clarify relationship between dnssec-enable and dnssec-validation
- if dnssec-enable is no, then dnssec-validation now also defaults to
  no. if dnssec-enable is yes, dnssec-validation defaults to auto or yes
  depending on --disable-auto-validation.
- correct the doc
2018-10-04 23:33:18 -07:00
Ondřej Surý 871bc20112 Merge branch 'add-bind-version-used-to-the-bug-report-template' into 'master'
Add a "BIND version used" section to the GitLab bug report template

See merge request isc-projects/bind9!793
2018-10-04 07:35:03 -04:00
Michał Kępień 0396fbebfe Add a "BIND version used" section to the GitLab bug report template 2018-10-04 12:54:52 +02:00
Michał Kępień 739b74759d Merge branch 'fix-eddsa-signatures-creation-and-validation' into 'master'
Fix EdDSA signatures creation and validation

Closes #579

See merge request isc-projects/bind9!844
2018-10-04 06:54:03 -04:00
Witold KręcickiandMichał Kępień 87b07bf08a Fix creating and validating EdDSA signatures
Revert parts of commit c3b8130fe8 which
inadvertently broke creating and validating EdDSA signatures:

 1. EVP_DigestSignInit() returns 1 on success.

 2. EdDSA does not support streaming (EVP_Digest*Update() followed by
    EVP_Digest*Final()), only one shot operations.
2018-10-04 12:38:46 +02:00
Mark Andrews dc7b556c31 Merge branch '578-make-the-chained-delegations-in-reclimit-behave-like-they-would-in-a-regular-name-server' into 'master'
Resolve "Make the chained delegations in reclimit behave like they would in a regular name server."

Closes #578

See merge request isc-projects/bind9!840
2018-10-03 23:18:59 -04:00
Mark Andrews f1308ef186 add CHANGES 2018-10-04 13:18:09 +10:00
Mark Andrews ae77468e63 add bin/tests/system/reclimit/ans4/ans.pl 2018-10-04 12:59:38 +10:00
Mark Andrews a216135a15 reclimit: delegate to ans4 so that ans2 can behave like a real name server 2018-10-04 12:59:38 +10:00
Mark Andrews 7b08db35af Merge branch '568-the-chain-system-test-is-missing-a-delegation' into 'master'
Resolve "the chain system test is missing a delegation."

Closes #568

See merge request isc-projects/bind9!824
2018-10-03 22:27:51 -04:00
Mark Andrews e97199b0d0 add CHANGES note 2018-10-04 12:27:03 +10:00
Mark Andrews 848e42227e chain: change nameserver name so that the delegation matches 2018-10-04 12:26:28 +10:00
Mark Andrews 524c1317f7 chain: add 'start test' messages to named.run 2018-10-04 12:26:28 +10:00
Mark Andrews d5709c5f52 Merge branch '566-mem-c-fprintf-compiler-warning' into 'master'
Resolve "mem.c - fprintf Compiler Warning"

Closes #566

See merge request isc-projects/bind9!821
2018-10-03 17:08:18 -04:00
Mark Andrews f723a1247f Undo implict promotion to 64 bits in our Windows implementation of atomic_load_explicit() by casting to uint_fast32_t. 2018-10-04 06:59:28 +10:00
Evan Hunt b7ac47c47d Merge branch '570-extend-dnstap-update' into 'master'
Resolve "Extend dnstap option to support update messages"

Closes #570

See merge request isc-projects/bind9!829
2018-10-03 12:32:37 -04:00
Evan Hunt 1c8b908c21 CHANGES, copyrights 2018-10-03 09:24:06 -07:00
Evan Hunt ae8026171b update system test to add a check for UPDATE messages 2018-10-03 01:03:56 -07:00
Evan Hunt 6c31ba5c53 rebuild option grammar documentation 2018-10-03 01:03:56 -07:00
Evan Hunt 51c6f4b682 extend DNSTAP to record UPDATE requests and responses as a separate type 2018-10-03 01:03:56 -07:00
Mark Andrews 8be7d6ac3c Merge branch 'update-log-fix' into 'master'
make update_log() work if zone is not set

See merge request isc-projects/bind9!831
2018-10-03 02:18:10 -04:00
Evan HuntandMark Andrews 395f6a1474 make update_log() work if zone is not set
- update_log() is called to log update errors, but if those errors
  occur before the zone is set (for example, when returning NOTAUTH)
  it returns without logging anything.
2018-10-03 02:09:26 -04:00
Mark Andrews 33229e7fc5 Merge branch '569-zero-system-test-failed-to-set-ret-0-and-send-output-to-dev-null' into 'master'
Resolve "zero system test failed to set ret=0 and send output to /dev/null"

Closes #569

See merge request isc-projects/bind9!825
2018-10-03 01:36:56 -04:00
Mark Andrews a6507af9e3 zero: send grep output to /dev/null; set ret=0 at start of 'check repeated recursive lookups of non recurring TTL=0 responses get new values' test so the failed subtest count is correct 2018-10-03 01:28:27 -04:00
Ondřej Surý 1c0fee613f Merge branch '571-use-priufast32-instead-of-pridfast32' into 'master'
Resolve "Use PRIuFAST32 instead of PRIdFAST32"

Closes #571

See merge request isc-projects/bind9!830
2018-10-03 00:37:24 -04:00
Mark Andrews d4cc0b98de use PRIuFAST32 instead of PRIdFAST32 2018-10-03 07:59:18 +10:00
Mark Andrews 3e44011370 Merge branch '420-reading-from-master-files-could-sometime-fail-to-preserve-the-case-of-the-owner-name' into 'master'
Resolve "reading from master files could sometime fail to preserve the case of the owner name."

Closes #420

See merge request isc-projects/bind9!536
2018-10-02 01:18:58 -04:00
Mark Andrews 4fcdad292d Add CHANGES note. 2018-10-02 15:10:26 +10:00
Mark Andrews 0fc1b1bffa improve case presevation 2018-10-02 15:09:32 +10:00
Evan Hunt c93acb9949 Merge branch 'example-domain' into 'master'
use an example domain

See merge request isc-projects/bind9!819
2018-09-28 12:58:55 -04:00
Evan Hunt b026663c62 use an example domain 2018-09-28 09:58:07 -07:00
Evan Hunt eb6d02fbe5 Merge branch '562-chaos-addresses' into 'master'
fix chaosnet address comparison

Closes #562

See merge request isc-projects/bind9!813
2018-09-28 03:50:21 -04:00
Evan Hunt b4dca44ad2 fix chaosnet address comparison 2018-09-28 00:42:03 -07:00
Evan Hunt b5cfc5d032 Merge branch '319-fix-recursion-on' into 'master'
Resolve "allow-recursion-on and allow-query-cache-on should default to each other if only one is set"

Closes #319

See merge request isc-projects/bind9!556
2018-09-28 01:04:51 -04:00
Evan Hunt be8713a1e8 CHANGES, release note, copyrights 2018-09-27 21:56:11 -07:00
Evan Hunt cea9ff573c clarify documentation 2018-09-27 21:48:44 -07:00
Evan Hunt 72b49ce869 tests for allow-recursion-on and allow-query-cache-on, default and inherited 2018-09-27 21:48:44 -07:00
Evan Hunt 2b61b83199 check both allow-query-cache and allow-query-cache-on 2018-09-27 21:48:44 -07:00
Evan Hunt 5752645e60 allow-recursion-on and allow-query-cache-on should inherit from each other 2018-09-27 21:48:43 -07:00
Evan Hunt 0494f86a7b Merge branch 'fix-rpz-logging' into 'master'
fix a formatting error in logged RPZ error messages

See merge request isc-projects/bind9!805
2018-09-27 20:33:57 -04:00
Evan Hunt e47ef88810 CHANGES note 2018-09-27 17:24:37 -07:00
Evan HuntandMark Andrews 6a3afe2778 fix a formatting error in logged RPZ error messages 2018-09-27 19:59:21 -04:00
Evan Hunt e116beb68e Merge branch 'rpz-synth-dnssec' into 'master'
RPZ now treats covering NSEC records the same as negative answers

See merge request isc-projects/bind9!811
2018-09-27 18:02:53 -04:00
Tony FinchandEvan Hunt 9407d9e266 RPZ now treats covering NSEC records the same as negative answers 2018-09-27 14:53:34 -07:00
Evan Hunt 9a5c21b475 Merge branch '540-tsig-has-two-consecutive-spaces-when-maclen-is-0' into 'master'
Resolve "TSIG has two consecutive spaces when MACLEN is 0"

Closes #540

See merge request isc-projects/bind9!786
2018-09-27 16:43:23 -04:00
Mark AndrewsandEvan Hunt ac1c3aaa27 only emit a single space between mac length and the orginal id if the mac length is zero 2018-09-27 16:34:49 -04:00
Evan Hunt 26699ac57e Merge branch '503-fix-rpz-test' into 'master'
Resolve "dnsrps test no longer runs"

Closes #503

See merge request isc-projects/bind9!713
2018-09-27 16:23:24 -04:00
Evan Hunt b04c7bbd60 CHANGES note 2018-09-27 13:11:44 -07:00
Evan Hunt 6d05ec7dc1 fix problems running dnsrps tests in rpz and rpzrecurse
- set up server correctly when running the second test pass
- reset stats counters before the second pass
- clean up test output
2018-09-27 13:11:44 -07:00
Evan Hunt 261b7560b0 Merge branch '556-race-condition-in-timer-creation' into 'master'
Fix crash caused by race condition in timer creation

Closes #556

See merge request isc-projects/bind9!801
2018-09-27 15:59:30 -04:00
Zhaolong ZhangandMichał Kępień 21966423cd Fix crash caused by race condition in timer creation
The race condition is the timer elapses before isc__timer_create()
returns the pointer to the caller.  Assigning the return pointer before
enabling the timer will fix it.
2018-09-27 15:17:52 +02:00
Evan Hunt 37e834defc Merge branch '542-prevent-a-race-after-zone-load' into 'master'
Prevent a race after zone load

Closes #542

See merge request isc-projects/bind9!795
2018-09-26 22:45:11 -04:00
Michał KępieńandEvan Hunt feb2a41b7c Add CHANGES entry
5034.	[bug]		A race between threads could prevent zone maintenance
			scheduled immediately after zone load from being
			performed. [GL #542]
2018-09-26 19:35:51 -07:00
Michał KępieńandEvan Hunt 56003e9f9f Prevent a race after zone load
Zone loading happens in a different task (zone->loadtask) than other
zone actions (zone->task).  Thus, when zone_postload() is called in the
context of zone->loadtask, it may cause zone maintenance to be queued in
zone->task and another thread can then execute zone_maintenance() before
zone_postload() gets a chance to finish its work in the first thread.
This would not be a problem if zone_maintenance() accounted for this
possibility by locking the zone before checking the state of its
DNS_ZONEFLG_LOADPENDING flag.  However, the zone is currently not locked
before the state of that flag is checked, which may prevent zone
maintenance from happening despite zone_postload() scheduling it.  Fix
by locking the zone in zone_maintenance() before checking the state of
the zone's DNS_ZONEFLG_LOADPENDING flag.
2018-09-26 19:35:51 -07:00
Ondřej Surý f6bd695a98 Merge branch '543-couple-more-windows-build-fixes' into 'master'
Couple additional Windows build fixes in VCX files

Closes #543

See merge request isc-projects/bind9!802
2018-09-26 03:44:03 -04:00
Thomas JachandOndřej Surý f2d6b1b859 Couple additional Windows build fixes in VCX files 2018-09-26 09:34:34 +02:00
Evan Hunt e673237509 Merge branch 'fix-typo' into 'master'
fix a typo in usage output

See merge request isc-projects/bind9!796
2018-09-24 18:30:04 -04:00
Evan Hunt e7c99e42f3 fix a typo in usage output 2018-09-24 15:21:47 -07:00
Mark Andrews eb74f2ee68 Merge branch '546-mtype-should-be-dns_ssumatchtype_t' into 'master'
Resolve "mtype should be dns_ssumatchtype_t"

Closes #546

See merge request isc-projects/bind9!792
2018-09-20 02:13:53 -04:00
Mark Andrews 7effcffba2 mtype should be dns_ssumatchtype_t 2018-09-20 16:03:24 +10:00
Mark Andrews ae2bc454e5 Merge branch '545-add-strlcat-and-strlcpy-libisc-def-in' into 'master'
Resolve "add strlcat and strlcpy libisc.def.in"

Closes #545

See merge request isc-projects/bind9!791
2018-09-20 00:54:19 -04:00
Mark Andrews a1d8306e3a add strlcat and strlcpy 2018-09-20 14:53:26 +10:00
Mark Andrews 090a564de5 Merge branch '543-windows-builds-failing-for-master' into 'master'
Resolve "Windows builds failing for master"

Closes #543

See merge request isc-projects/bind9!790
2018-09-20 00:14:32 -04:00
Mark Andrews be333e93ec remove isc_string_strlcat and isc_string_strlcpy 2018-09-20 14:00:28 +10:00
Mark Andrews 0eda75fec0 don't typedef socklen_t for _MSC_VER >= 1914 2018-09-20 13:51:50 +10:00
Evan Hunt 5cf8fc4bba Merge branch '539-shell-style-fixes' into 'master'
Resolve "rrsetorder test not portable"

Closes #539

See merge request isc-projects/bind9!784
2018-09-11 15:56:29 -04:00
Evan Hunt bf9c60078a don't use $() in system tests 2018-09-11 14:02:25 -04:00
Evan Hunt 874a4baf62 Merge branch '535-linux-perms-broken' into 'master'
Resolve "named is broken on linux due to user permissions"

Closes #535

See merge request isc-projects/bind9!783
2018-09-10 23:46:55 -04:00
Evan Hunt 38cf56ac38 call named_os_changeuser() when setting minimal privileges on linux 2018-09-10 20:17:41 -07:00
Evan Hunt 29f699d669 Merge branch '105-nta-all' into 'master'
Resolve "[RT#44623] RNDC NTA option to add NTA to all views"

Closes #105

See merge request isc-projects/bind9!658
2018-09-10 15:15:34 -04:00
Evan Hunt 2f6ba87ab9 CHANGES, release notes 2018-09-10 12:07:06 -07:00
Evan Hunt cc0abf62a1 add -class option to rndc nta 2018-09-10 12:04:04 -07:00
Evan Hunt 83dc5a704a report when NTAs added to multiple views
- the text returned by "rndc nta" when adding NTAs to multiple views
  was incorrectly terminated after the first line, so users only saw
  on NTA added unless they checked the logs.
2018-09-10 12:02:49 -07:00
Evan Hunt 07f29a083b Merge branch 'report-compiler-version' into 'master'
report "$CC --version" output as part of the configure summary

See merge request isc-projects/bind9!770
2018-09-10 12:55:44 -04:00
Evan Hunt a6f43574a0 report "$CC --version" output as part of the configure summary 2018-09-10 12:47:03 -04:00
Mark Andrews d98de244c3 Merge branch '511-add-ms-selfsub-and-krb5-selfsub' into 'master'
Resolve "add ms-selfsub and krb5-selfsub"

Closes #511

See merge request isc-projects/bind9!732
2018-09-09 20:21:25 -04:00
Mark Andrews f924c89f97 add CHANGES and release notes documentation 2018-09-10 09:55:24 +10:00
Mark Andrews 77a0fadfce fixup 2018-09-10 09:55:24 +10:00
Mark Andrews 4aa6a118de update util/copyrights 2018-09-10 09:55:24 +10:00
Mark Andrews d1f8e116db add more missing name in update rule checks 2018-09-10 09:55:24 +10:00
Mark Andrews 54c4db569b add krb5-* tests to nsupdate system test. 2018-09-10 09:32:32 +10:00
Mark Andrews fbeefd4990 add krb5-selfsub and ms-selfsub 2018-09-10 09:32:31 +10:00
Mark Andrews 5fb75a3d75 check that name field is not a valid type 2018-09-10 09:32:31 +10:00
Mark Andrews 156d86e673 fix dns_ssumatchtype_subdomainms dns_ssumatchtype_subdomainkrb5 as they don't require the name field to be '.' 2018-09-10 09:32:31 +10:00
Mark Andrews d6f14f06de Merge branch '532-master-doesn-t-build-on-macos-due-to-class-of-align-macros' into 'master'
Resolve "master doesn't build on MacOS due to class of ALIGN macros"

Closes #532

See merge request isc-projects/bind9!774
2018-09-09 19:27:45 -04:00
Mark Andrews 81b133d963 avoid macro name collision with system defined macro 2018-09-10 09:18:17 +10:00
Evan Hunt e860375d4f Merge branch 'patch-2' into 'master'
Replace isc-logo.pdf. The one in here is obsolete. If we need a different size…

See merge request isc-projects/bind9!765
2018-09-07 19:00:56 -04:00
Evan Hunt ad9bf4c662 update isc-logo.pdf to current logo version, remove isc-logo.eps 2018-09-07 15:59:32 -07:00
Evan Hunt 5824023082 Merge branch 'silence-string-h-warning' into 'master'
<isc/string.h> instead of "isc/string.h"

See merge request isc-projects/bind9!771
2018-09-07 18:40:04 -04:00
Evan Hunt 2c3b827e5d <isc/string.h> instead of "isc/string.h" 2018-09-07 15:26:50 -07:00
Witold Krecicki ac430136fb Merge branch '525-cleanup-platform-h-for-stuff-not-exposed-to-the-headers' into 'master'
Resolve "Cleanup platform.h for stuff not exposed to the headers"

Closes #525

See merge request isc-projects/bind9!756
2018-09-07 09:05:02 -04:00
Ondřej Surý 68e017792f Add CHANGES note for GL #525.
5031.   [cleanup]       Various defines in platform.h has been either dropped
                        if always or never triggered on supported platforms
                        or replaced with config.h equivalents if the defines
                        didn't have any impact on public headers.  Workarounds
                        for LinuxThreads have been removed because NPTL is
                        available since Linux kernel 2.6.0.
2018-09-07 13:03:31 +02:00
Ondřej Surý 8ffd9a9b71 Remove PR_SET_DUMPABLE check as it is available since Linux 2.3.20 2018-09-07 12:48:49 +02:00
Ondřej Surý 8e4cc152f7 Remove HAVE_SYS_PRCTL_H check as the prctl() system call was introduced in Linux 2.1.57. 2018-09-07 12:43:43 +02:00
Ondřej Surý 2ed5eb3b9e Remove now empty acconfig.h 2018-09-07 12:17:41 +02:00
Ondřej Surý 341fd22bb0 Remove custom HAVE_UNAME define with proper AC_DEFINE call 2018-09-07 12:17:40 +02:00
Ondřej Surý 161b5dccae Remove NEED_PTHREAD_SCOPE_SYSTEM define that was needed on older FreeBSDs 2018-09-07 12:17:40 +02:00
Ondřej Surý 2750799132 Assume socklen_t is always available on all supported platforms (except on Windows where it is typedefed to int32_t) 2018-09-07 12:17:40 +02:00
Ondřej Surý 7e25330b3d Remove now dummy HAVE_STRERROR 2018-09-07 12:17:40 +02:00
Ondřej Surý 5a0f618d22 Replace custom HAVE_PTHREAD_ATTR_GETSTACKSIZE and HAVE_PTHREAD_ATTR_SETSTACKSIZE with proper AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý 7716bdd400 Remove dummy PATH_RANDOMDEV and CHECK_DSA defines 2018-09-07 12:17:40 +02:00
Ondřej Surý 43c468926b Remove HAVE_FLOCKFILE and HAVE_GETCUNLOCKED custom defines in favour of AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý 5d8f9bf935 Always enable CALL_PTHREAD_SETCONCURRENCY as it is part of POSIX Threads 2018-09-07 12:17:40 +02:00
Ondřej Surý fa048a9b2c Replace custom HAVE_TZSET define with AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý c83d9b9b50 Remove now dummy HAVE_IFLIST_SYSCTL define 2018-09-07 12:17:40 +02:00
Ondřej Surý 51bcdb78af Remove now dummy HAVE_GETIFADDRS define 2018-09-07 12:17:40 +02:00
Ondřej Surý 7384a9f23a Replace custom HAVE_CATGETS define with AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý 78bb5761a0 Replace custom HAVE_SYSCTLBYNAME define with AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý 4a5ecad038 Replace custom HAVE_SIGWAIT define with AC_CHECK_FUNCS 2018-09-07 12:17:40 +02:00
Ondřej Surý 19ae4438ab Replace custom HAVE_SYSCONF with proper AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý 927b65aa7f Remove now dummy HAVE_UNIXWARE_SIGWAIT define 2018-09-07 12:17:40 +02:00
Ondřej Surý c7b1e7fd08 Linux (glibc) has NPTL since LinuxThreads are no-more, so remove HAVE_LINUXTHREADS 2018-09-07 12:17:40 +02:00
Ondřej Surý 2f02552a93 Remove now dummy NEED_PTHREAD_INIT 2018-09-07 12:17:30 +02:00
Ondřej Surý 4d46f0f95d Drop ISC_PLATFORM_USEDECLSPEC and IRS_PLATFORM_USEDECLSPEC as they are platform dependent and only unix vs win32 platform.h header difference is enough 2018-09-07 12:17:30 +02:00
Ondřej Surý 51b0d5d55e Replace platform ISC_PLATFORM_HAVESTATNSEC with config ENABLE_STAT_NSEC 2018-09-07 12:17:30 +02:00
Ondřej Surý f1d3055d7b Replace platform ISC_PLATFORM_HAVETFO with config ENABLE_TCP_FASTOPEN 2018-09-07 12:17:30 +02:00
Ondřej Surý 092edb5b44 Replace platform ISC_PLATFORM_HAVEDEVPOLL with check for devpoll.h headers 2018-09-07 12:17:30 +02:00
Ondřej Surý 5d65392d18 Replace platform ISC_PLATFORM_HAVEEPOLL with config HAVE_EPOLL_CREATE1 2018-09-07 12:17:30 +02:00
Ondřej Surý 68f473a25e Replace platform ISC_PLATFORM_HAVEKQUEUE with config HAVE_KQUEUE 2018-09-07 12:17:30 +02:00
Ondřej Surý d00ef56dfa Remove dummy ISC_PLATFORM_HAVESTRINGSH platform define 2018-09-07 12:17:30 +02:00
Ondřej Surý 47f18c7d50 Replace platform ISC_PLATFORM_NEEDSTRLCPY and ISC_PLATFORM_NEEDSTRLCAT with AC_CHECK_FUNCS call 2018-09-07 12:17:30 +02:00
Ondřej Surý 4014bc42dd According to POSIX.1-2001, POSIX.1-2008 #include <sys/select.h> is correct way to get fd_set 2018-09-07 12:17:30 +02:00
Ondřej Surý 1333d4a71a Remove dummy ISC_PLATFORM_HAVELIFCONF platform define 2018-09-07 12:17:30 +02:00
Ondřej Surý 0bea5c2baf Replace platform.h ISC_PLATFORM_HAVEIFNAMETOINDEX with config HAVE_IF_NAMETOINDEX 2018-09-07 12:17:30 +02:00
Ondřej Surý 53d87175df Remove dummy ISC_PLATFORM_HAVEIF_LADDRREQ platform define 2018-09-07 12:17:30 +02:00
Ondřej Surý c798db0fcd Remove dummy ISC_PLATFORM_HAVEIF_LADDRCONF define 2018-09-07 12:17:30 +02:00
Ondřej Surý f8635fd719 Remove dummy ISC_PLATFORM_NEEDSTRCASESTR define from platform.h 2018-09-07 12:17:30 +02:00
Ondřej Surý 22e5231f99 Remove ISC_PLATFORM_BUSYWAITNOP in favour of direct isc_rwlock_pause() define 2018-09-07 12:17:29 +02:00
Ondřej Surý 376bea8b40 Cleanup the custom atomic defines from Windows and remove empty atomic_test.c 2018-09-07 12:17:29 +02:00
Ondřej Surý 510bb376e1 Define platform.h ISC_PLATFORM_USEBACKTRACE with config.h USE_BACKTRACE 2018-09-07 12:17:29 +02:00
Ondřej Surý 3949450fbd Merge branch '521-align-cmsg-buffers' into 'master'
Resolve "BIND 9.11.4 terminates with SIGBUS error when compiled with Oracle Developer Studio 12.6"

Closes #521

See merge request isc-projects/bind9!758
2018-09-07 04:26:10 -04:00
Witold Kręcicki 17212cf996 Align CMSG buffers to a void* boundary, fixes crash on architectures with strict alignment
CHANGES entry
2018-09-07 09:34:32 +02:00
Evan Hunt a985badd34 Merge branch 'missing-test' into 'master'
the allow-query test was in conf.sh.win32 as allow_query, so was skipped

See merge request isc-projects/bind9!767
2018-09-05 21:04:02 -04:00
Evan Hunt 881a868dc0 the allow-query test was in conf.sh.win32 as allow_query, so was skipped 2018-09-05 18:02:40 -07:00
Evan Hunt 3561018919 Merge branch 'fix-windows' into 'master'
add ws2_32.lib where missing

See merge request isc-projects/bind9!766
2018-09-05 20:15:26 -04:00
Evan Hunt 1aa3ba2bb1 add ws2_32.lib where missing 2018-09-05 16:54:47 -07:00
Mark Andrews 633eeabb2e Merge branch 'cplusplusize_dns_fixedname_h-master' into 'master'
Add C++ declarations to dns/fixedname.h

See merge request isc-projects/bind9!764
2018-09-05 18:27:30 -04:00
Ondřej SurýandMark Andrews ac21bbb13a Add C++ declarations to dns/fixedname.h
(cherry picked from commit 94a1c85366)
2018-09-06 08:11:30 +10:00
Evan Hunt ca6dda7328 Merge branch 'fix-windows' into 'master'
move ws2_32.lib to the end of AdditionalDependencies

See merge request isc-projects/bind9!761
2018-09-05 17:26:27 -04:00
Evan Hunt f8d9bd6178 move ws2_32.lib to the end of AdditionalDependencies 2018-09-05 14:25:38 -07:00
Evan Hunt f6c08a28e8 Merge branch '528-use-default-memory-ordering-on-win32' into 'master'
Resolve "32bit build on windows is currently broken"

Closes #528

See merge request isc-projects/bind9!760
2018-09-05 16:39:00 -04:00
Ondřej Surý 0dc714c40d On 32-bit Windows use only default memory ordering 2018-09-05 22:20:58 +02:00
Evan Hunt 8360df5a4c Merge branch '527-spurious-thread-report' into 'master'
Resolve "Master branch incorrectly reports missing thread support"

Closes #527

See merge request isc-projects/bind9!757
2018-09-04 15:06:34 -04:00
Evan Hunt 02041b94d9 remove startup log message indicating thread status 2018-09-04 11:58:26 -07:00
Tinderbox User 215e3fde22 Merge branch 'prep-release' 2018-09-04 06:12:49 +00:00
Tinderbox User 19ed6f8f5a prep 9.13.3 2018-09-04 06:11:38 +00:00
Evan Hunt 7157596743 Merge branch '192-release-notes' into 'master'
Add release notes about support for legacy platform being removed

Closes #523

See merge request isc-projects/bind9!750
2018-09-03 21:51:37 -04:00
Ondřej SurýandEvan Hunt 0868e5700f Update release notes to mention removal of legacy system workarounds 2018-09-03 18:50:58 -07:00
Ondřej Surý 3023f14c40 Merge branch 'fail-on-failed-install' into 'master'
Fail on failed install inside for loops

See merge request isc-projects/bind9!751
2018-09-03 06:18:53 -04:00
Ondřej Surý 142cb0ab8f Remove already removed headers from the Makefiles 2018-09-03 12:09:52 +02:00
Ondřej Surý 25248eb097 Bail-out early in the for install loops instead of continuing because for masks the error in the middle 2018-09-03 12:05:45 +02:00
Evan Hunt 73b2648480 Merge branch 'solaris-fixes' into 'master'
Silence some warnings and errors

See merge request isc-projects/bind9!746
2018-08-31 16:57:12 -04:00
Witold KrecickiandEvan Hunt d932ec871c Silence some warnings and errors 2018-08-31 13:48:26 -07:00
Evan Hunt 0716902f6f Merge branch 'restore-readmes' into 'master'
restore accidentally erased README and related files

See merge request isc-projects/bind9!747
2018-08-31 15:56:13 -04:00
Evan Hunt 8a167a4b30 restore accidentally erased README and related files 2018-08-31 12:55:36 -07:00
Ondřej Surý 47066d3d01 Merge branch '10-clean-lib-isc-arch-Makefiles' into 'master'
Cleanup lib/isc/$arch/ Makefile.in(s) from configure.in

See merge request isc-projects/bind9!745
2018-08-31 08:27:27 -04:00
Ondřej SurýandOndřej Surý 75c2996df8 Cleanup lib/isc/$\arch/ Makefile.in(s) from configure.in 2018-08-31 08:19:15 -04:00
Ondřej Surý 5c00162f54 Merge branch '9.13.3-dev-build-doc' into 'master'
Update documentation (ARM, READMEs and man pages)

See merge request isc-projects/bind9!744
2018-08-31 06:22:24 -04:00
Ondřej SurýandOndřej Surý eb9849daff Update documentation (ARM, READMEs and man pages) 2018-08-31 06:03:42 -04:00
Mark Andrews 05bed0ecd6 Merge branch 'simplify' into 'master'
simplify

See merge request isc-projects/bind9!743
2018-08-31 05:02:17 -04:00
Mark Andrews 05eb9fd338 simplify 2018-08-31 18:47:29 +10:00
Mark Andrews 1b75d421b7 Merge branch '510-resolver-test-was-failing' into 'master'
Resolve "Resolver test was failing"

Closes #510

See merge request isc-projects/bind9!726
2018-08-31 03:56:16 -04:00
Mark AndrewsandWitold Krecicki feaf381adb use pack to construct the reply as Net::DNS just get it wrong 2018-08-31 03:47:56 -04:00
Mark Andrews 38f96de923 Merge branch '150-remove-workarounds-for-servers-that-are-not-edns-compliant' into 'master'
Resolve "Remove workarounds for servers that are not EDNS compliant."

Closes #150

See merge request isc-projects/bind9!555
2018-08-31 00:43:57 -04:00
Evan HuntandMark Andrews 5e37190877 add documentation 2018-08-31 14:34:31 +10:00
Mark AndrewsandEvan Hunt 615ebc39e3 remove EDNS workarounds, update legacy test 2018-08-30 21:17:00 -07:00
Mark AndrewsandEvan Hunt e7e4603f9b bring up interfaces 9 and 10 2018-08-30 21:16:59 -07:00
Mark AndrewsandEvan Hunt c81c9660f5 add -T ednsformerr/ednsnotimp/ednsrefused 2018-08-30 21:16:59 -07:00
Mark Andrews c0c80df254 Merge branch '418-bind-in-auto-dnssec-mode-should-support-signature-expiration-jitter' into 'master'
Resolve "BIND in auto-dnssec mode should support signature expiration jitter"

Closes #418

See merge request isc-projects/bind9!662
2018-08-30 22:46:15 -04:00
Mark Andrews d68499e1f7 add changes note 2018-08-30 22:37:09 -04:00
Mark Andrews 8e5abc6cdf report initial RRSIG expiry field values 2018-08-30 22:37:08 -04:00
Mark Andrews 050fca2139 increase jitter to cover the entire potential steady state expire range when initially signing the zone 2018-08-30 22:37:08 -04:00
Mark Andrews c5b4948db3 Merge branch '519-unclosed-files-in-lib-dns-tests-zt_test-c' into 'master'
Resolve "unclosed files in lib/dns/tests/zt_test.c"

Closes #519

See merge request isc-projects/bind9!736
2018-08-30 22:23:23 -04:00
Mark Andrews 455bb23236 fclose origfile and zonefile 2018-08-31 12:13:19 +10:00
Vicky Risk bbaff4d80f Merge branch 'patch-2' into 'master'
Update release.md

See merge request isc-projects/bind9!735
2018-08-30 17:01:26 -04:00
Vicky Risk e6106b9940 Update release.md 2018-08-30 14:47:26 -04:00
Ondřej Surý 7ee4f849b8 Merge branch 'checklist2' into 'master'
Proposed release checklist

See merge request isc-projects/bind9!734
2018-08-30 11:33:23 -04:00
Vicky Risk d9d96761cd Proposed release checklist 2018-08-30 11:15:46 -04:00
Evan Hunt 59156c60eb Merge branch 'fix-configure-loop' into 'master'
configure could loop if --with-pic was specified

See merge request isc-projects/bind9!731
2018-08-29 19:28:33 -04:00
Evan Hunt d3e2f848ec configure could loop if --with-pic was specified 2018-08-29 19:19:50 -04:00
Ondřej Surý 6a9031b0a6 Merge branch '509-fix-strerr_r-on-Windows' into 'master'
Resolve "current master not building on ubuntu 16.04 using --with-libtool --enable-developer" also on Windows

See merge request isc-projects/bind9!730
2018-08-29 16:53:41 -04:00
Ondřej Surý e582d085de Fix InterlockedCompareExchange64Acquire -> InterlockedCompareExchangeAcquire64 and variants 2018-08-29 22:23:46 +02:00
Ondřej Surý 7f508ec229 Link arpaname and mdig with ws2_32.lib 2018-08-29 22:16:37 +02:00
Ondřej Surý d67b07c115 gai_strerror on Windows is just 'char *' 2018-08-29 22:05:09 +02:00
Ondřej Surý 7cba3cc474 Bump the minimum required Windows version to Windows Vista and Windows Server 2008 2018-08-29 22:03:09 +02:00
Ondřej Surý c74ee5bb17 Remove *_loadnew from libdns.def.in 2018-08-29 21:36:27 +02:00
Ondřej Surý d967e107f6 Remove isc_net_pton and isc_net_ntop from Windows libisc.def.in 2018-08-29 21:21:52 +02:00
Ondřej Surý aa3e33575d Fixup Windows build after strerr changes 2018-08-29 21:21:52 +02:00
Ondřej Surý 7d44cc2422 Merge branch '495-pic-dlopen' into 'master'
Resolve "building with libtool requires either pic or dlopen to be enabled"

Closes #495

See merge request isc-projects/bind9!704
2018-08-29 11:02:25 -04:00
Ondřej Surý d60e553a64 -Xcompiler -shared is generally needed when using libtool on Linux, not only when -ld is present 2018-08-29 16:37:26 +02:00
Ondřej Surý d03b9ec544 Make dnsrps play well with dlopen 2018-08-29 16:37:26 +02:00
Ondřej Surý 77f71d7d4a Rewrite dlopen detection using modern autoconf language constructs 2018-08-29 16:37:26 +02:00
Evan HuntandOndřej Surý 5928d31efc make --without-pic imply --disable-shared and --without-dlopen 2018-08-29 16:37:26 +02:00
Ondřej Surý ae80e61684 Merge branch '509-use-xsi-strerror_r' into 'master'
Resolve "current master not building on ubuntu 16.04 using --with-libtool --enable-developer"

Closes #509

See merge request isc-projects/bind9!727
2018-08-29 07:43:51 -04:00
Evan HuntandOndřej Surý 1656152d76 Ensure that POSIX strerror_r variant is use even when _GNU_SOURCE is enabled by default 2018-08-29 13:31:28 +02:00
Ondřej Surý cacd21c075 Enable system extensions macros using AC_USE_SYSTEM_EXTENSIONS
and remove handcrafted code that enabled __EXTENSIONS__ and _GNU_SOURCE
2018-08-29 13:31:27 +02:00
Evan Hunt b938f50ded Merge branch 'silence-warning' into 'master'
silence "missing print.h" warning

See merge request isc-projects/bind9!723
2018-08-28 19:21:33 -04:00
Evan Hunt 3c18b7d3fd silence "missing print.h" warning 2018-08-28 15:59:20 -07:00
Ondřej Surý e2a2f08ed5 Merge branch 'fix-missing-ipv6.h' into 'master'
Remove broken @ISC_IPV6_H@ placeholder from Makefile.in

See merge request isc-projects/bind9!720
2018-08-28 15:33:05 -04:00
Ondřej Surý dc410ce58f Remove broken @ISC_IPV6_H@ placeholder from Makefile.in 2018-08-28 21:15:32 +02:00
Witold Krecicki 416e09d715 Merge branch 'set-sndbuf' into 'master'
Set sndbuf

See merge request isc-projects/bind9!74
2018-08-28 14:33:57 -04:00
Witold Kręcicki 103b60e0bc Pre-merge nits 2018-08-28 20:25:36 +02:00
Mukund SivaramanandWitold Kręcicki d077f5c180 Add CHANGES entry 2018-08-28 20:20:25 +02:00
Evan HuntandWitold Kręcicki cddb699690 style nits 2018-08-28 20:19:47 +02:00
Mukund SivaramanandWitold Kręcicki 700614a0eb Set SO_SNDBUF 2018-08-28 20:19:47 +02:00
Witold Krecicki cc8a647887 Merge branch '276-rndc-reconfig-fixes' into 'master'
Resolve "rndc reconfig now performs stat() for all zones"

Closes #276

See merge request isc-projects/bind9!518
2018-08-28 11:16:47 -04:00
Witold Kręcicki c4c3b98a27 CHANGES note 2018-08-28 17:05:28 +02:00
Witold Kręcicki 79ce86090a rndc reconfig should not touch already loaded zones, some refactoring of dns_{zone,view,zt}_{async,}load 2018-08-28 17:04:45 +02:00
Ondřej Surý c268c47c76 Merge branch '178-remove-isc_keyboard' into 'master'
Remove isc_keyboard family of functions

See merge request isc-projects/bind9!718
2018-08-28 08:47:40 -04:00
Ondřej Surý dedb104382 Add CHANGES note for GL #178.
5023.   [cleanup]       Remove isc_keyboard family of functions. [GL #178]
2018-08-28 14:37:30 +02:00
Ondřej Surý fecbc7923a Remove isc_keyboard family of functions as they were not used anywhere 2018-08-28 14:37:30 +02:00
Ondřej Surý 6034664e36 Merge branch '10-use-atomic_builtins' into 'master'
Resolve "Use and require atomic primitives support"

Closes #10

See merge request isc-projects/bind9!657
2018-08-28 07:53:41 -04:00
Ondřej Surý ddaa853ed6 Add CHANGES note for GL #10.
5023.	[func]		Replace custom assembly for atomic operations with
			atomic support from the compiler. The code will now use
			C11 stdatomic, or __atomic, or __sync builtins with GCC
			or Clang compilers, and Interlocked functions with MSVC.
			[GL #10]
2018-08-28 13:15:59 +02:00
Ondřej Surý 91aa405778 Update the isc_refcount documentation in doxygen format 2018-08-28 13:15:59 +02:00
Ondřej Surý 0f24c55d38 Refactor *_destroy and *_detach functions to unified order of actions.
This properly orders clearing the freed pointer and calling isc_refcount_destroy
as early as possible to have ability to put proper memory barrier when cleaning
up reference counting.
2018-08-28 13:15:59 +02:00
Ondřej Surý 9d5df99a9d Directly use return value of atomic_compare_exchange_strong_explicit insteaf of comparing expected value 2018-08-28 12:15:39 +02:00
Ondřej Surý b5709e5531 Explicitly load atomic values in lib/isc/rwlock.c 2018-08-28 12:15:39 +02:00
Ondřej Surý d1d15c03e2 Switch everything back to relaxed memory ordering 2018-08-28 12:15:39 +02:00
Ondřej Surý 69b9b9ec77 Remove no-op NODE_STRONG(UN)?LOCK and rename NODE_WEAK(UN)?LOCK to just NODE_(UN)?LOCK 2018-08-28 12:15:39 +02:00
Ondřej Surý bef8ac5bae Rewrite isc_refcount API to fetch_and_<op>, instead of former <op>_and_<fetch> 2018-08-28 12:15:39 +02:00
Ondřej Surý 7fbbf09d21 Remove checks for atomic rwlock from rbtdb.cz and zone.c 2018-08-28 12:15:39 +02:00
Ondřej Surý 2b74478c8f Remove check for atomic isc_refcount in dns/rbt.h and always use isc_refcount 2018-08-28 12:15:39 +02:00
Ondřej Surý 93e8ba1b50 Rewrite reference counting in isc_mem to use isc_refcount API 2018-08-28 12:15:39 +02:00
Ondřej Surý 0a7535ac81 isc_refcount_init() now doesn't return isc_result_t and asserts on failed initialization 2018-08-28 12:15:39 +02:00
Ondřej Surý e9e55cbd03 Remove isc_atomic usage from rwlock.c and stats.c 2018-08-28 12:15:39 +02:00
Ondřej Surý e119de4169 Replace arch specific atomic.h with global atomic.h header using either stdatomic, __atomic or __sync primitives 2018-08-28 12:15:39 +02:00
Ondřej Surý facc390b54 Update configure.in to check for both stdatomic.h and __atomic builtins 2018-08-28 12:15:39 +02:00
Ondřej Surý 7ab9c9dbee Merge branch 'remove-dnsperf-and-queryperf-from-contrib' into 'master'
Remove dnsperf, queryperf and perftcpdns from contrib

See merge request isc-projects/bind9!717
2018-08-28 06:05:52 -04:00
Ondřej Surý ecb27adf86 Remove dnsperf, queryperf and perftcpdns from util/copyrights 2018-08-28 11:49:28 +02:00
Ondřej Surý f4c8e42f3e Update contrib/README with new locations for dnsperf, queryperf, and perftcpdns 2018-08-28 11:44:58 +02:00
Ondřej Surý 7de898777f Remove perftcpdns from BIND 9 repository 2018-08-28 11:42:31 +02:00
Ondřej Surý 1e404fdb0e Remove queryperf from BIND 9 repository 2018-08-28 11:42:14 +02:00
Ondřej Surý 99f17b80b8 Remove dnsperf and dnsperf-patches from BIND 9 repository 2018-08-28 11:41:58 +02:00
Ondřej Surý b6e64eb23b Merge branch '192-make-ipv6-mandatory' into 'master'
Remove all kind of legacy compatibility layers (including IPv6, networking and functions defined by C99 or POSIX.1)

Closes #192

See merge request isc-projects/bind9!668
2018-08-28 04:51:38 -04:00
Ondřej Surý 2c19877197 Add CHANGES entry for GL #192
5016.   [cleanup]       Remove wrappers that try to fix broken or incomplete
                        implementations of IPv6, pthreads and other core
                        functionality required and used by BIND. [GL #192]
2018-08-28 10:36:41 +02:00
Ondřej Surý 19a374e45d Cleanup util/copyrights 2018-08-28 10:36:41 +02:00
Ondřej Surý a8b868e820 Add release notes entry. 2018-08-28 10:31:49 +02:00
Ondřej Surý f1d658764c Remove dead check for long long support 2018-08-28 10:31:49 +02:00
Ondřej Surý 52e1c45156 Assume PTHREAD_ONCE_INIT is not broken (remove support for ancient Solaris) 2018-08-28 10:31:48 +02:00
Ondřej Surý a11a271b28 Assume non-broken recvmsg 2018-08-28 10:31:48 +02:00
Ondřej Surý 1672935717 Use strerror_r from POSIX.1-2001 (strerror_s on Windows) instead of custom isc__strerror() 2018-08-28 10:31:48 +02:00
Ondřej Surý efd613e874 memmove, strtoul, and strcasestr functions are part of ISO C90, remove the compatibility shim 2018-08-28 10:31:48 +02:00
Ondřej Surý 1e1804bb96 getifaddrs() is available on all supported Unix platforms (Linux, BSDs, macOS and Solaris) 2018-08-28 10:31:48 +02:00
Ondřej Surý 62fb0759e9 Assume always working getaddrinfo/getnameinfo implemenation 2018-08-28 10:31:48 +02:00
Ondřej Surý 29c853f500 Remove check for isc_port_t; Windows never have it, Unix always have it 2018-08-28 10:31:48 +02:00
Ondřej Surý 40f7680efa Ignore sockaddr_{sin,sin6,sun}.{sin,sin6,sun}_len even on systems that define it 2018-08-28 10:31:48 +02:00
Ondřej Surý e6dc08b06c Always assume BSD4.4 msghdr version 2018-08-28 10:31:48 +02:00
Ondřej Surý 388d6db5a1 Remove support for legacy systems without inet_{ntop,pton} w/ IPv6 support 2018-08-28 10:31:48 +02:00
Ondřej Surý 3ab9c99567 Remove support for legacy systems without in6_pktinfo 2018-08-28 10:31:48 +02:00
Ondřej Surý 8c526df306 Remove support for legacy systems without sin6_scope_id 2018-08-28 10:31:48 +02:00
Ondřej Surý 4150a86046 Remove support for legacy platforms without in6addr_loopback 2018-08-28 10:31:48 +02:00
Ondřej Surý 5083a42072 Remove support for legacy systems without in6addr_any 2018-08-28 10:31:48 +02:00
Ondřej Surý b962f47d3e Remove support for pre-RFC2133 IPv6 implementation (in_addr6) 2018-08-28 10:31:48 +02:00
Ondřej Surý 243a347d60 Remove support for legacy KAME IPv6 stack 2018-08-28 10:31:47 +02:00
Ondřej Surý 7b21bbb7c1 Require IPv6 support from the OS 2018-08-28 10:31:47 +02:00
Ondřej Surý 00ca487fec We always want IPv6 2018-08-28 10:31:47 +02:00
Ondřej Surý c19713aa51 Remove support for legacy SGI IRIX 2018-08-28 10:31:47 +02:00
Ondřej Surý 9f4528c623 Remove legacy support for Compaq TruCluster 2018-08-28 10:31:47 +02:00
Ondřej Surý 02e349c051 Remove legacy support for HP-UX 2018-08-28 10:31:47 +02:00
Ondřej Surý b02de1ec30 Remove legacy support for SunOS 2018-08-28 10:31:47 +02:00
Ondřej Surý 18e3c8d232 Remove legacy support for Tru64 2018-08-28 10:31:47 +02:00
Ondřej Surý f0f71420c8 Remove legacy support for AIX 2018-08-28 10:31:47 +02:00
Ondřej Surý 9a8da1e25a Remove legacy BSD/OS support (ipv6,various hacks) 2018-08-28 10:31:47 +02:00
Ondřej Surý e53a72a649 Remove legacy UnixWare support (sigwait, ipv6) 2018-08-28 10:31:47 +02:00
Ondřej Surý 518772e4e0 Merge branch 'gitlab-ci-dont-run-make-clean' into 'master'
Disable make clean at the end of configure step in GitLab CI

See merge request isc-projects/bind9!714
2018-08-28 01:18:18 -04:00
Ondřej Surý a1d783bbe2 Disable make clean at the end of configure step in GitLab CI 2018-08-28 07:09:18 +02:00
Ondřej Surý ca0ce1cb42 Merge branch '496-fix-freebsd-issue' into 'master'
threads.h was missing on C11/thread_local builds

Closes #496

See merge request isc-projects/bind9!712
2018-08-27 14:34:47 -04:00
Witold Kręcicki 525fd76685 Include threads.h for thread_local 2018-08-27 16:41:43 +02:00
Stephen Morris 760182271e Merge branch '498-clang-scan-build-detected-errors' into 'master'
Resolve "clang scan-build detected errors"

Closes #498

See merge request isc-projects/bind9!703
2018-08-27 10:25:22 -04:00
Ondřej SurýandStephen Morris de41f0beea Cleanup couple of set-but-unused errors from Coverity 2018-08-27 10:12:19 -04:00
Ondřej SurýandStephen Morris 55361748d7 Initialize all tvresults to ISC_R_UNSET 2018-08-27 10:12:19 -04:00
Witold Krecicki edf5c01fcb Merge branch '499-fix-rsabigexponent-with-pkc11' into 'master'
Resolve "rsabigexponent test is broken w/pkcs11"

Closes #499

See merge request isc-projects/bind9!711
2018-08-27 05:33:29 -04:00
Ondřej Surý 8b3878dc7d Run rsabigexponent test only when OpenSSL is used as cryptography provider 2018-08-27 11:24:32 +02:00
Mark Andrews dc4086d4f2 Merge branch 'update-documentation-for-ms-and-krb5-rules' into 'master'
update {krb5,ms}-{self,subdomain} descriptions

See merge request isc-projects/bind9!708
2018-08-27 02:58:36 -04:00
Mark Andrews a3c5c2c29c add CHANGES note 2018-08-27 16:46:07 +10:00
Mark Andrews 0370d13667 update {krb5,ms}-{self,subdomain} descriptions 2018-08-27 16:39:51 +10:00
Mark Andrews 25bb33c866 Merge branch '487-reset-dig-exit-code-after-a-tcp-connection-is-established' into 'master'
Reset dig exit code after a TCP connection is established

Closes #487

See merge request isc-projects/bind9!698
2018-08-27 00:07:21 -04:00
Michał KępieńandMark Andrews 59057bee5b Add CHANGES entry
5020.	[bug]		dig returned a non-zero exit code when it received a
			reply over TCP after a retry. [GL #487]
2018-08-27 13:58:43 +10:00
Michał KępieńandMark Andrews deb3b85cb2 Reset dig exit code after a TCP connection is established
The "exitcode" variable is set to 9 if a TCP connection fails, but is
not reset to 0 if a subsequent TCP connection succeeds.  This causes dig
to return a non-zero exit code if it succeeds in getting a TCP response
after a retry.  Fix by resetting "exitcode" to 0 if connect_done()
receives an event with the "result" field set to ISC_R_SUCCESS.
2018-08-27 13:58:08 +10:00
Michał Kępień d3bd90f3a7 Merge branch 'set-use-alt-transfer-source-no-in-the-mirror-system-test' into 'master'
Set "use-alt-transfer-source no;" in the "mirror" system test

See merge request isc-projects/bind9!705
2018-08-25 16:20:28 -04:00
Michał Kępień a23162ab28 Set "use-alt-transfer-source no;" in the "mirror" system test
Force ns3 to use a constant source address (10.53.0.3) when sending
transfer requests for the "initially-unavailable" zone to prevent
failures of transfers not triggered by bin/tests/system/mirror/tests.sh
from causing fallback to using a source address for which transfers of
that zone are refused throughout the entire "mirror" system test since
that might yield false positives.
2018-08-25 21:48:17 +02:00
Ondřej Surý 8f37439ccf Merge branch '496-tls-in-rng' into 'master'
Resolve "RNG should not be locking"

Closes #340 and #496

See merge request isc-projects/bind9!697
2018-08-25 08:08:13 -04:00
Ondřej Surý 7ab228cf71 Use __declspec( thread ) for thread local storage when compiling with Visual Studio 2015 and higher 2018-08-25 13:59:26 +02:00
Witold Kręcicki 18ebcf2b30 Add runtime check on top of pthread_mutex_{lock,unlock} in rng 2018-08-25 13:26:25 +02:00
Witold Kręcicki 8c5aeb6c4c Use TLS variables to store RNG state, make RNG lockless 2018-08-25 13:26:25 +02:00
Ondřej Surý e79b42fec0 Merge branch 'fix-line-continuation-in-fuzz-Makefile.in' into 'master'
Fix line continuation in fuzz/Makefile.in

See merge request isc-projects/bind9!699
2018-08-24 11:01:10 -04:00
Michał Kępień 875b29c3e3 Fix line continuation in fuzz/Makefile.in
Add a missing semicolon to prevent "make test" run from the top-level
directory from failing even when all system and unit tests succeed due
to "(cd fuzz && ${MAKE} check)" returning a non-zero exit code.
2018-08-24 14:00:32 +02:00
Michał Kępień ba350f40ff Merge branch '470-log-a-message-when-ixfr-from-differences-is-set-for-an-inline-signed-zone' into 'master'
Log a message when "ixfr-from-differences" is set for an inline-signed zone

Closes #470

See merge request isc-projects/bind9!648
2018-08-24 04:35:29 -04:00
Michał Kępień 4fb5d072c2 Add CHANGES entry
5019.	[cleanup]	A message is now logged when ixfr-from-differences is
			set at zone level for an inline-signed zone. [GL #470]
2018-08-24 10:18:59 +02:00
Michał Kępień 087157d14f Log a message when "ixfr-from-differences" is set for an inline-signed zone
For inline-signed zones, the value of "ixfr-from-differences" is
hardcoded to:

  - "yes" for the raw version of the zone,
  - "no" for the signed version of the zone.

In other words, any user-provided "ixfr-from-differences" setting is
effectively ignored for an inline-signed zone.  Ensure the user is aware
of that by adding a note to the ARM and logging a message when an
"ixfr-from-differences" option is found at the zone level.
2018-08-24 10:18:59 +02:00
Michał Kępień 2359f06aa6 Merge branch '491-prevent-a-race-in-the-inline-system-test' into 'master'
Prevent a race in the "inline" system test

Closes #491

See merge request isc-projects/bind9!682
2018-08-24 03:55:13 -04:00
Michał Kępień e36c869e85 Prevent a race in the "inline" system test
A short time window exists between logging the addition of an NSEC3PARAM
record to a zone and committing it to the current version of the zone
database.  If a query arrives during such a time window, an unsigned
response will be returned.  One of the checks in the "inline" system
test requires NSEC3 records to be present in an answer - that check
would fail in the case described above.  Use rndc instead of log
watching for checking whether zone signing and NSEC3 chain modifications
are complete in order to prevent intermittent "inline" system test
failures.
2018-08-24 09:37:37 +02:00
Mark Andrews 1c82dde85c Merge branch 'fix-non-portable' into 'master'
use sizeof(CK_SLOT_ID)

See merge request isc-projects/bind9!588
2018-08-23 21:29:52 -04:00
Mark Andrews 42b16771db add CHANGES note 2018-08-24 11:02:27 +10:00
Mark Andrews 2c1d8b2e99 use sizeof(CK_SLOT_ID) 2018-08-24 11:00:39 +10:00
Mark Andrews 751c660b9d Merge branch 'value-not-updated-atomically' into 'master'
unlink before unlock

See merge request isc-projects/bind9!589
2018-08-23 20:49:38 -04:00
Mark Andrews 05531d3a86 add CHANGES note 2018-08-24 10:41:11 +10:00
Mark Andrews 4742f4ecba unlink before unlock 2018-08-24 10:36:53 +10:00
Mark Andrews e59617441e Merge branch '445-filter-aaaa-and-dns64-can-both-attempt-to-recurse-for-a-records-at-the-same-time' into 'master'
Resolve "filter-aaaa and dns64 can both attempt to recurse for A records at the same time"

Closes #445

See merge request isc-projects/bind9!561
2018-08-23 19:44:18 -04:00
Mark Andrews c1bc3baf7f add CHANGES note 2018-08-24 09:29:35 +10:00
Mark Andrews 1056376d10 when filter-aaaa and dns64 are both configured a assertion failure could occur 2018-08-24 09:26:54 +10:00
Evan Hunt 0213626992 Merge branch '436-fix-dnstap-test' into 'master'
Resolve "dnstap tests are failing in Jenkins"

Closes #436

See merge request isc-projects/bind9!683
2018-08-23 14:11:45 -04:00
Evan Hunt 0d6f504ba3 specify "dnssec-validation yes" instead of default "auto" 2018-08-23 13:52:57 -04:00
Ondřej Surý af1df8738f Merge branch 'bump-to-9.13.3-dev' into 'master'
Bump the version in the master to 9.13.3-dev

See merge request isc-projects/bind9!679
2018-08-23 06:11:51 -04:00
Ondřej SurýandOndřej Surý ca9aaf926f Bump the version in the master to 9.13.3-dev 2018-08-23 06:02:24 -04:00
Ondřej Surý 591a6c94ee Merge branch 'run-update_copyrights' into 'master'
Run update copyrights in precheck stage

See merge request isc-projects/bind9!680
2018-08-23 05:52:56 -04:00
Ondřej Surý 4016369212 Check update_copyright results in precheck stage 2018-08-23 11:39:01 +02:00
Ondřej Surý 31b5360943 Whitespace fixes 2018-08-23 11:39:01 +02:00
Ondřej Surý 65de91f512 Cleanup cruft in util/copyrights 2018-08-23 11:39:01 +02:00
Ondřej Surý db3d69263d Make update_copyrights return error code when error is encountered during processing the files 2018-08-23 11:38:21 +02:00
Ondřej Surý d877d4a561 Merge branch 'bshastry/bind9-oss-fuzz' into 'master'
Add a skeleton directory for the oss-fuzz testing

See merge request isc-projects/bind9!530
2018-08-23 04:27:11 -04:00
Bhargava ShastryandOndřej Surý 1c57b73e34 oss-fuzz: Improve interaction with fuzzing tools and add new tests in fuzz/ directory 2018-08-23 10:07:28 +02:00
Evan Hunt d30b90dba6 Merge branch '484-fix-non-libtool-build' into 'master'
Resolve "Build Fails with --enable-developer when building without libtool"

Closes #484

See merge request isc-projects/bind9!676
2018-08-22 17:00:52 -04:00
Evan Hunt e67f81bbf1 set PTHREAD_CFLAGS when building backtrace_test_nosymtbl 2018-08-22 13:52:03 -07:00
Michał Kępień cb28c27b30 Merge branch '435-fix-reloading-inline-signed-zones' into 'master'
Fix reloading inline-signed zones

Closes #435

See merge request isc-projects/bind9!664
2018-08-22 06:00:56 -04:00
Michał Kępień f9931f1d22 Add CHANGES entry
5015.	[bug]		Reloading all zones caused zone maintenance to cease
			for inline-signed zones. [GL #435]
2018-08-22 11:28:54 +02:00
Michał Kępień 5431583971 Fix reloading inline-signed zones
While "rndc reload" causes dns_zone_asyncload() to be called for the
signed version of an inline-signed zone, the subsequent zone_load() call
causes the raw version to be reloaded from storage.  This means that
DNS_ZONEFLG_LOADPENDING gets set for the signed version of the zone by
dns_zone_asyncload() before the reload is attempted, but zone_postload()
is only called for the raw version and thus DNS_ZONEFLG_LOADPENDING is
cleared for the raw version, but not for the signed version.  This in
turn prevents zone maintenance from happening for the signed version of
the zone.

Until commit 29b7efdd9f, this problem
remained dormant because DNS_ZONEFLG_LOADPENDING was previously
immediately, unconditionally cleared after zone loading was started
(whereas it should only be cleared when zone loading is finished or an
error occurs).  This behavior caused other issues [1] and thus had to be
changed.

Fix reloading inline-signed zones by clearing DNS_ZONEFLG_LOADPENDING
for the signed version of the zone once the raw version reload
completes.  Take care not to clear it prematurely during initial zone
load.  Also make sure that DNS_ZONEFLG_LOADPENDING gets cleared when
zone_postload() encounters an error or returns early, to prevent other
scenarios from resulting in the same problem.  Add comments aiming to
help explain code flow.

[1] see RT #47076
2018-08-22 11:28:54 +02:00
Michał Kępień d2785afebe Merge branch '482-fix-secure-journal-loading-for-inline-signed-zones' into 'master'
Set DNS_JOURNALOPT_RESIGN when loading the secure journal for an inline-signed zone

Closes #482

See merge request isc-projects/bind9!663
2018-08-22 05:21:20 -04:00
Michał Kępień b3b1a9081b Add CHANGES entry
5014.	[bug]		Signatures loaded from the journal for the signed
			version of an inline-signed zone were not scheduled for
			refresh. [GL #482]
2018-08-22 10:48:07 +02:00
Michał Kępień 8db550c42f Set DNS_JOURNALOPT_RESIGN when loading the secure journal for an inline-signed zone
When an inline-signed zone is loaded, the master file for its signed
version is loaded and then a rollforward of the journal for the signed
version of the zone is performed.  If DNS_JOURNALOPT_RESIGN is not set
during the latter phase, signatures loaded from the journal for the
signed version of the zone will not be scheduled for refresh.  Fix the
conditional expression determining which flags should be used for the
dns_journal_rollforward() call so that DNS_JOURNALOPT_RESIGN is set when
zone_postload() is called for the signed version of an inline-signed
zone.

Extend bin/tests/system/stop.pl so that it can use "rndc halt" instead
of "rndc stop" as the former allows master file flushing upon shutdown
to be suppressed.
2018-08-22 10:48:07 +02:00
Michał Kępień 71793853df Merge branch '390-do-not-treat-a-referral-with-a-non-empty-answer-section-as-an-error' into 'master'
Do not treat a referral with a non-empty ANSWER section as an error

Closes #390

See merge request isc-projects/bind9!628
2018-08-22 04:42:58 -04:00
Michał Kępień 2923ab4945 Add CHANGES entry
5013.	[bug]		A referral response with a non-empty ANSWER section was
			inadvertently being treated as an error. [GL #390]
2018-08-22 10:14:39 +02:00
Michał Kępień 24b9ec555a Do not treat a referral with a non-empty ANSWER section as an error
As part of resquery_response() refactoring [1], a goto statement was
replaced [2] with a call to a new function - originally called
rctx_delegation(), now folded into rctx_answer_none() - extracted from
existing code.  However, one call site of that refactored function does
not reset the "result" variable, causing a referral with a non-empty
ANSWER section to be inadvertently treated as an error, which prevents
resolution of names reliant on servers sending such responses.  Fix by
resetting the "result" variable to ISC_R_SUCCESS when a response
containing a non-empty ANSWER section can be treated as a delegation.

[1] see RT #45362

[2] see commit e1380a16741a3b4a57e54d7a9ce09dd12691522f
2018-08-22 10:14:37 +02:00
Mark Andrews 3596bad5ce Merge branch 'fix-lock-order-reversal' into 'master'
fix lock order reversal

See merge request isc-projects/bind9!590
2018-08-20 23:17:33 -04:00
Mark Andrews 083007e930 add CHANGES note 2018-08-21 12:18:27 +10:00
Mark Andrews 2bb4392bb3 fix lock order reversal 2018-08-20 22:15:18 -04:00
Ondřej Surý bf98eb41bf Merge branch 'configure.in-cmocka-CFLAGS-fix' into 'master'
Fix missing $ in CMOCKA_CFLAGS when --with-cmocka=<path> was used

See merge request isc-projects/bind9!665
2018-08-17 09:37:31 -04:00
Ondřej Surý ab9f12c7f4 Fix missing $ in CMOCKA_CFLAGS when --with-cmocka=<path> was used 2018-08-17 15:28:42 +02:00
Witold Krecicki 28cf1a7a9c Merge branch '478-remove-support-for-unthreaded-bind' into 'master'
Remove support for unthreaded BIND

Closes #478

See merge request isc-projects/bind9!655
2018-08-16 15:09:43 -04:00
Witold Kręcicki 44cec639c4 CHANGES/notes/docs 2018-08-16 19:46:10 +02:00
Ondřej SurýandWitold Kręcicki c692da2182 Improve autoconf pthread detection 2018-08-16 17:18:52 +02:00
Witold Kręcicki 5cdb38c2c7 Remove unthreaded support 2018-08-16 17:18:52 +02:00
Ondřej Surý 8e164f784d Merge branch 'gitlab-ci-make-install-job' into 'master'
Add make install job to GitLab CI

See merge request isc-projects/bind9!661
2018-08-16 09:38:06 -04:00
Ondřej SurýandOndřej Surý 9c950e5961 Add install test job 2018-08-16 09:13:41 -04:00
Ondřej SurýandOndřej Surý 28748db0b2 paste config.log to output if configure ends up with failure 2018-08-16 09:13:41 -04:00
Ondřej Surý 1ff71c7cee Merge branch 'config.h-fixes' into 'master'
Replace "config.h" with <config.h>

See merge request isc-projects/bind9!660
2018-08-16 06:54:57 -04:00
Ondřej Surý e2c938d882 Replace "config.h" with <config.h> 2018-08-16 12:45:59 +02:00
Evan Hunt 0bdefcb599 Merge branch '237-validate-except' into 'master'
Resolve "dnssec-validation exception domains"

Closes #237

See merge request isc-projects/bind9!224
2018-08-14 16:38:00 -04:00
Evan Hunt 4eb0897c90 CHANGES, release notes, README 2018-08-14 13:28:02 -07:00
Evan Hunt 7ecd699e81 add a system test 2018-08-14 13:28:02 -07:00
Evan Hunt eaac2057c7 option to disable validation under specified names
- added new 'validate-except' option, which configures an NTA with
  expiry of 0xffffffff.  NTAs with that value in the expiry field do not
  expire, are are not written out when saving the NTA table and are not
  dumped by rndc secroots
2018-08-14 13:28:02 -07:00
Evan Hunt 509d71e1aa Merge branch '465-missing-check-in-acl_test-c-unit-test' into 'master'
Resolve "Missing check in acl_test.c unit test"

Closes #465

See merge request isc-projects/bind9!639
2018-08-14 12:13:04 -04:00
Mark AndrewsandEvan Hunt 0ce82e9d5f add missing ATF_REQUIRE 2018-08-14 09:04:16 -07:00
Ondřej Surý 53690ef21f Merge branch '476-fix-openssl-error-logging' into 'master'
Fix OpenSSL error logging

Closes #476

See merge request isc-projects/bind9!644
2018-08-14 07:05:20 -04:00
Michał Kępień cab7c34fbd Add CHANGES entry
5009.	[bug]		Upon an OpenSSL failure, the first error in the OpenSSL
			error queue was not logged. [GL #476]
2018-08-14 12:49:19 +02:00
Michał Kępień fe20f8fe25 Do not remove errors from the OpenSSL error queue in toresult()
dst__openssl_toresult3() first calls toresult() and subsequently uses
ERR_get_error_line_data() in a loop.  Given this, it is a mistake to use
ERR_get_error() in toresult() because it causes the retrieved error to
be removed from the OpenSSL error queue, thus preventing it from being
retrieved by the subsequent ERR_get_error_line_data() calls.  Fix by
using ERR_peek_error() instead of ERR_get_error() in toresult().
2018-08-14 12:49:19 +02:00
Michał Kępień 527614c750 Merge branch '471-fix-rbt_insert_and_remove-unit-test' into 'master'
Prevent rare rbt_insert_and_remove unit test failures

Closes #471

See merge request isc-projects/bind9!614
2018-08-14 05:11:17 -04:00
Michał Kępień 13fe763798 Prevent rare rbt_insert_and_remove unit test failures
When two or more absolute, two-label names are added to a completely
empty RBT, an extra, empty node for the root name will be created due to
node splitting.  check_tree() expects that, but the extra node will not
be created when just one name is added to a completely empty RBT.  This
problem could be handled inside check_tree(), but that would introduce
unnecessary complexity into it since adding a single name will result in
a different node count for a completely empty RBT (node count will be 1)
and an RBT containing only an empty node for the root name, created due
to prior node splitting (node count will be 2).  Thus, first explicitly
create a node for the root name to prevent rare check_tree() failures
caused by a single name being added in the first iteration of the
insert/remove loop.
2018-08-14 10:43:51 +02:00
Michał Kępień 495e10ba5a Merge branch '285-make-the-inline-system-test-more-lightweight' into 'master'
Make the "inline" system test more lightweight

Closes #285

See merge request isc-projects/bind9!611
2018-08-14 04:38:57 -04:00
Michał Kępień 24dd865b97 Make the "inline" system test more lightweight
Each zone used in the "inline" system test contains a few dozen records.
Over a dozen of these zones are used in the test.  Most records present
in these zones are not subsequently used in the test itself, but all of
them need to be signed by the named instances launched by the test,
which puts quite a bit of strain on lower-end machines, leading to
intermittent failures of the "inline" system test.  Remove all redundant
records from the zones used in the "inline" system test in order to
stabilize it.
2018-08-14 10:16:08 +02:00
Evan Hunt e0d309572f Merge branch '474-mempool-is-broken-if-object-size-is-below-the-alignment-size' into 'master'
Resolve "mempool is broken if object size is below the alignment size"

Closes #474

See merge request isc-projects/bind9!635
2018-08-14 04:09:17 -04:00
Mark AndrewsandEvan Hunt 5dd1beec8e mempool didn't work for sizes less than sizeof(void*) 2018-08-14 03:47:14 -04:00
Michał Kępień dc5b8ec97a Merge branch '468-queue-rndc-signing-nsec3param-requests-if-needed' into 'master'
Queue "rndc signing -nsec3param ..." requests if needed

Closes #468

See merge request isc-projects/bind9!610
2018-08-14 03:44:53 -04:00
Michał Kępień eed6778be4 Add CHANGES entry
5008.	[bug]		"rndc signing -nsec3param ..." requests were silently
			ignored for zones which were not yet loaded or
			transferred. [GL #468]
2018-08-14 09:22:43 +02:00
Michał Kępień cb40c5229a Queue "rndc signing -nsec3param ..." requests if needed
If "rndc signing -nsec3param ..." is ran for a zone which has not yet
been loaded or transferred (i.e. its "db" field is NULL), it will be
silently ignored by named despite rndc logging an "nsec3param request
queued" message, which is misleading.  Prevent this by keeping a
per-zone queue of NSEC3PARAM change requests which arrive before a zone
is loaded or transferred and processing that queue once the raw version
of an inline-signed zone becomes available.
2018-08-14 09:22:43 +02:00
Ondřej Surý f34e7ee612 Merge branch '462-full-recv-queue-on-netbsd' into 'master'
Resolve "Full Recv-Queue"

Closes #462

See merge request isc-projects/bind9!629
2018-08-13 13:19:48 -04:00
Ondřej Surý ebf3083e08 Make ENOBUFS a soft error 2018-08-13 18:51:10 +02:00
Ondřej Surý 9689313331 Merge branch '9-use-C99-integer-types-fix-install' into 'master'
Don't try to install removed int.h and boolean.h headers

See merge request isc-projects/bind9!627
2018-08-13 09:38:55 -04:00
Mathieu ArnoldandOndřej Surý 4c06eb20cc Don't try to install removed int.h and boolean.h headers 2018-08-13 15:30:36 +02:00
Ondřej Surý a2188e61e7 Merge branch 'support-softhsm-2.4.0' into 'master'
Fix build failures on Debian sid

See merge request isc-projects/bind9!626
2018-08-13 07:22:25 -04:00
Ondřej Surý c746037622 Disable libidn2 on Debian stretch images 2018-08-13 12:43:38 +02:00
Ondřej Surý 28b0de3e86 Use clang on Debian stretch to workaround Debian Bug #903709 2018-08-13 12:43:38 +02:00
Ondřej Surý 6bc771828c SoftHSM 2.4.0 only supports softhsm2.conf now, rewrite GitLab CI commands to properly support that 2018-08-13 12:43:38 +02:00
Ondřej Surý 2cd0a493ae Merge branch '469-typo-in-validate-glue-branch' into 'master'
Resolve "Typo in validate-glue branch"

See merge request isc-projects/bind9!613
2018-08-11 04:16:34 -04:00
Ondřej SurýandOndřej Surý bdc9860262 Fix !!validate typo to -> !validate 2018-08-11 04:07:46 -04:00
Evan Hunt d6f4592f6b Merge branch 'fix-ns-log-mismatch' into 'master'
mismatch between defined log modules and ns_modules[] in lib/ns/log.c

See merge request isc-projects/bind9!612
2018-08-10 15:14:10 -04:00
Evan Hunt b865fb77de mismatch between defined log modules and ns_modules[] in lib/ns/log.c 2018-08-10 15:04:39 -04:00
Ondřej Surý c3e4363303 Merge branch '434-after-isc_safe-merge-the-windows-build-fails-due-missing-openssl_libs-in-project-files' into 'master'
Resolve "After isc_safe merge, the Windows build fails due missing OPENSSL_LIBS in project files"

Closes #434

See merge request isc-projects/bind9!617
2018-08-10 10:58:04 -04:00
Ondřej Surý c5040e5c9e Add @OPENSSL_LIB@ to Windows project files as needed 2018-08-10 16:45:00 +02:00
Ondřej Surý 86c377ccbb Merge branch '457-restore-logging-of-used-openssl-versions-upon-startup' into 'master'
Restore logging of used OpenSSL versions upon startup

Closes #457

See merge request isc-projects/bind9!615
2018-08-10 09:16:05 -04:00
Michał Kępień b14e127569 Restore logging of used OpenSSL versions upon startup
Remove an #ifdef which commit c3b8130fe8
should have removed.
2018-08-10 13:58:41 +02:00
Evan Hunt 337f9dd0ec Merge branch 'security-complete-dname-fix' into 'master'
Merge CVE-2018-5740 fix

See merge request isc-projects/bind9!607
2018-08-08 18:33:21 -04:00
Evan Hunt b4b4277f5a CHANGES, release note 2018-08-08 14:33:19 -07:00
Evan Hunt 3f907b8bee caclulate nlabels and set *chainingp correctly 2018-08-08 14:33:19 -07:00
Evan Hunt 9d7ad52506 test case 2018-08-08 14:33:19 -07:00
Evan Hunt cac3978af2 explicit DNAME query could trigger a crash if deny-answer-aliases was set 2018-08-08 14:33:19 -07:00
Ondřej Surý fa03f94102 Merge branch '9-use-C99-integer-types' into 'master'
Redefine ISC's int and boolean types to use <stdint.h> and <stdbool.h> types

See merge request isc-projects/bind9!162
2018-08-08 05:05:26 -04:00
Ondřej Surý 75c2356f42 Add CHANGES entry
5007.   [cleanup]       Replace custom ISC boolean and integer data types
                        with C99 stdint.h and stdbool.h types. [GL #9]
2018-08-08 09:37:30 +02:00
Ondřej Surý 7351c505a0 Remove duplicate config.h 2018-08-08 09:37:30 +02:00
Ondřej Surý 994e656977 Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
Ondřej Surý cb6a185c69 Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
Ondřej Surý 055278c936 Get rid of extra UINT64_MAX definition in lib/isc/win32/time.c 2018-08-08 09:36:44 +02:00
Ondřej Surý 64fe6bbaf2 Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants 2018-08-08 09:36:44 +02:00
Ondřej Surý 9e493798c6 Check for C99 compatible compiler 2018-08-08 09:36:44 +02:00
Ondřej Surý e5ee96fc1b Merge branch 'silence-openbsd-warning' into 'master'
Silence a compiler warning on openbsd and fix windows build

See merge request isc-projects/bind9!603
2018-08-08 03:34:44 -04:00
Evan HuntandOndřej Surý b55338e447 Silence a compiler warning on openbsd and fix windows build 2018-08-08 02:49:28 -04:00
Michał Kępień 20c52bf9b8 Merge branch '431-refactor-code-preparing-a-delegation-response' into 'master'
Refactor code preparing a delegation response

Closes #431

See merge request isc-projects/bind9!549
2018-08-08 02:26:40 -04:00
Michał Kępień 1d9c37876b Add CHANGES entry
5006.	[cleanup]	Code preparing a delegation response was extracted from
			query_delegation() and query_zone_delegation() into a
			separate function in order to decrease code
			duplication. [GL #431]
2018-08-08 08:08:40 +02:00
Michał Kępień 8e3fc5725f Extract code preparing a delegation response to a separate function
Changes introduced by the previous two commits make the parts of
query_delegation() and query_zone_delegation() which prepare a
delegation response functionally equivalent.  Extract this code into a
separate function, query_prepare_delegation_response(), and then call
the latter from both query_delegation() and query_zone_delegation() in
order to reduce code duplication.  Add a comment describing the purpose
of the extracted code.  Fix coding style issues.
2018-08-08 08:08:40 +02:00
Michał Kępień 7db4dedf6b Remove unused NS_QUERYATTR_CACHEGLUEOK query attribute
The NS_QUERYATTR_CACHEGLUEOK query attribute has no influence on query
processing.  Remove it.
2018-08-08 08:08:40 +02:00
Michał Kępień b6c77202cb Restore zone database and zone node if cache search results are to be ignored
When query processing hits a delegation from a locally configured zone,
an attempt may be made to look for a better answer in the cache.  In
such a case, the zone-sourced delegation data is set aside and the
lookup is retried using the cache database.  When that lookup is
completed, a decision is made whether the answer found in the cache is
better than the answer found in the zone.

Currently, if the zone-sourced answer turns out to be better than the
one found in the cache:

  - qctx->zdb is not restored into qctx->db,
  - qctx->node, holding the zone database node found, is not even saved.

Thus, in such a case both qctx->db and qctx->node will point at cache
data.  This is not an issue for BIND versions which do not support
mirror zones because in these versions non-recursive queries always
cause the zone-sourced delegation to be returned and thus the
non-recursive part of query_delegation() is never reached if the
delegation is coming from a zone.  With mirror zones, however,
non-recursive queries may cause cache lookups even after a zone
delegation is found.  Leaving qctx->db assigned to the cache database
when query_delegation() determines that the zone-sourced delegation is
the best answer to the client's query prevents DS records from being
added to delegations coming from mirror zones.  Fix this issue by
keeping the zone database and zone node in qctx while the cache is
searched for an answer and then restoring them into qctx->db and
qctx->node, respectively, if the zone-sourced delegation turns out to be
the best answer.  Since this change means that qctx->zdb cannot be used
as the glue database any more as it will be reset to NULL by RESTORE(),
ensure that qctx->db is not a cache database before attaching it to
qctx->client->query.gluedb.

Furthermore, current code contains a conditional statement which
prevents a mirror zone from being used as a source of glue records.
Said statement was added to prevent assertion failures caused by
attempting to use a zone database's glue cache for finding glue for an
NS RRset coming from a cache database.  However, that check is overly
strict since it completely prevents glue from being added to delegations
coming from mirror zones.  With the changes described above in place,
the scenario this check was preventing can no longer happen, so remove
the aforementioned check.

If qctx->zdb is not NULL, qctx->zfname will also not be NULL;
qctx->zsigrdataset may be NULL in such a case, but query_putrdataset()
handles pointers to NULL pointers gracefully.  Remove redundant
conditional expressions to make the cleanup code in query_freedata()
match the corresponding sequences of SAVE() / RESTORE() macros more
closely.
2018-08-08 08:07:46 +02:00
Ondřej Surý ec25056b48 Merge branch '440-root-zone-performance-regression-uint32' into 'master'
Resolve "Root zone performance regression since 9.12.2rc2 and 9.13.1"

Closes #440

See merge request isc-projects/bind9!602
2018-08-07 04:02:02 -04:00
Ondřej Surý e3131b8d52 Make sure the storage for isc_random32() result is 32-bit long 2018-08-07 09:52:47 +02:00
Ondřej Surý 21a547c100 Merge branch '440-root-zone-performance-regression' into 'master'
Resolve "Root zone performance regression since 9.12.2rc2 and 9.13.1"

Closes #440

See merge request isc-projects/bind9!593
2018-08-06 05:38:44 -04:00
Ondřej Surý 9e11b54bbc Update ARM on the default ordering 2018-08-06 11:24:14 +02:00
Ondřej Surý e80c26b22e Define and use new DNS_RDATASET_COUNT_UNDEFINED equals ISC_UINT32_MAX to make the code more readable 2018-08-06 11:24:14 +02:00
Ondřej Surý afddc2781e Modify the rrsetorder test to cope with the rrset order randomization (only four orders are now possible) 2018-08-06 11:24:14 +02:00
Ondřej Surý 41a68425ea Refactor code around random/cyclic/fixed to reduce code duplication 2018-08-06 11:24:14 +02:00
Mark AndrewsandOndřej Surý f7986c8d1a Only get one random number per response when order == random 2018-08-05 07:23:07 +02:00
1666 changed files with 46455 additions and 213592 deletions
+1 -29
View File
@@ -27,38 +27,10 @@ gen.dSYM/
.deps/
.dirstamp
.libs/
unit/atf-src/atf-c++/atf-c++.pc
unit/atf-src/atf-c/atf-c.pc
unit/atf-src/atf-c/defs.h
unit/atf-src/atf-c/detail/process_helpers
unit/atf-src/atf-config/atf-config
unit/atf-src/atf-report/atf-report
unit/atf-src/atf-report/fail_helper
unit/atf-src/atf-report/misc_helpers
unit/atf-src/atf-report/pass_helper
unit/atf-src/atf-run/atf-run
unit/atf-src/atf-run/bad_metadata_helper
unit/atf-src/atf-run/expect_helpers
unit/atf-src/atf-run/misc_helpers
unit/atf-src/atf-run/pass_helper
unit/atf-src/atf-run/several_tcs_helper
unit/atf-src/atf-run/zero_tcs_helper
unit/atf-src/atf-sh/atf-check
unit/atf-src/atf-sh/atf-sh
unit/atf-src/atf-sh/misc_helpers
unit/atf-src/atf-version/atf-version
unit/atf-src/atf-version/revision.h
unit/atf-src/atf-version/revision.h.stamp
unit/atf-src/bconfig.h
unit/atf-src/bootstrap/atconfig
unit/atf-src/doc/atf.7
unit/atf-src/stamp-h1
unit/atf-src/test-programs/c_helpers
unit/atf-src/test-programs/cpp_helpers
unit/atf-src/test-programs/sh_helpers
# ccc-analyzer store its results in .plist directories
*.plist/
*~
.project
.cproject
.settings
kyua.log
+139 -57
View File
@@ -4,11 +4,13 @@ variables:
DOCKER_DRIVER: overlay2
CI_REGISTRY_IMAGE: registry.gitlab.isc.org/isc-projects/images/bind9
CCACHE_DIR: "/ccache"
SOFTHSM2_CONF: "/var/tmp/softhsm2/softhsm2.conf"
stages:
- precheck
- build
- test
- push
.centos-centos6-amd64: &centos_centos6_amd64_image
image: "$CI_REGISTRY_IMAGE:centos-centos6-amd64"
@@ -114,20 +116,27 @@ stages:
- test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
# - ./autogen.sh
script:
- ./configure --enable-developer --with-libtool --disable-static --with-atf=/usr $EXTRA_CONFIGURE
- ./configure --enable-developer --with-libtool --disable-static --with-cmocka --prefix=$HOME/.local --without-make-clean $EXTRA_CONFIGURE || cat config.log
- make -j${PARALLEL_JOBS_BUILD:-1} -k all V=1
artifacts:
paths:
- doc/
expire_in: '1 hour'
untracked: true
.install_test: &install_test_job
stage: test
before_script:
- mkdir $HOME/.local
script:
- make install
.system_test: &system_test_job
stage: test
before_script:
- rm -rf .ccache
- bash -x bin/tests/system/ifconfig.sh up
- export SOFTHSM_CONF="/tmp/softhsm.conf"
- echo "0:/tmp/softhsm.db" > $SOFTHSM_CONF
- if command -v softhsm2-util >/dev/null; then softhsm2-util --init-token --free --pin 0000 --so-pin 0000 --label "softhsm"; fi
- bash -x util/prepare-softhsm2.sh
script:
- ( cd bin/tests && make -j${TEST_PARALLEL_JOBS:-1} -k test V=1 )
- test -s bin/tests/system/systests.output
@@ -140,23 +149,20 @@ stages:
stage: test
before_script:
- export KYUA_RESULT="$CI_PROJECT_DIR/kyua.results"
- export SOFTHSM_CONF="/tmp/softhsm.conf"
- echo "0:/tmp/softhsm.db" > $SOFTHSM_CONF
- if command -v softhsm2-util >/dev/null; then softhsm2-util --init-token --free --pin 0000 --so-pin 0000 --label "softhsm"; fi
- bash -x util/prepare-softhsm2.sh
script:
- make unit
after_script:
- kyua report-html --force --results-file kyua.results --results-filter "" --output kyua_html
artifacts:
paths:
- atf.out
- kyua.log
- kyua.results
- kyua_html/
expire_in: '1 week'
when: on_failure
precheck:debian:sid:amd64:
sid:amd64:precheck:
<<: *debian_sid_amd64_image
stage: precheck
script:
@@ -165,6 +171,8 @@ precheck:debian:sid:amd64:
- perl -w util/merge_copyrights
- diff -urNap util/copyrights util/newcopyrights
- rm util/newcopyrights
- perl -w util/update_copyrights < util/copyrights
- if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
- xmllint --noout --nonet `git ls-files '*.xml' '*.docbook'`
- xmllint --noout --nonet --html `git ls-files '*.html'`
artifacts:
@@ -174,15 +182,43 @@ precheck:debian:sid:amd64:
expire_in: '1 week'
when: on_failure
#build:debian:jessie:amd64:
🐞:sid:amd64:precheck:
<<: *debian_sid_amd64_image
stage: precheck
script: util/check-cocci
docs:sid:amd64:
<<: *debian_sid_amd64_image
stage: test
dependencies:
- sid:amd64:build
script:
- make -C doc/misc docbook
- make -C doc/arm Bv9ARM.html
artifacts:
paths:
- doc/arm/
expire_in: '1 month'
docs:push:
<<: *debian_sid_amd64_image
stage: push
dependencies: []
script:
- curl -X POST -F token=$GITLAB_PAGES_DOCS_TRIGGER_TOKEN -F ref=master $GITLAB_PAGES_DOCS_TRIGGER_URL
only:
- master@isc-projects/bind9
- /^v9_.*$/@isc-projects/bind9
#jessie:amd64:build:
# <<: *debian_jessie_amd64_image
# <<: *build_job
#
#build:debian:jessie:i386:
#build:jessie:i386:
# <<: *debian_jessie_i386_image
# <<: *build_job
#
#build:debian:stretch:amd64:
#build:stretch:amd64:
# <<: *debian_stretch_amd64_image
# <<: *build_job
#
@@ -198,7 +234,7 @@ precheck:debian:sid:amd64:
# <<: *ubuntu_xenial_i386_image
# <<: *build_job
build:centos:centos6:amd64:
centos6:amd64:build:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
@@ -206,7 +242,7 @@ build:centos:centos6:amd64:
<<: *centos_centos6_amd64_image
<<: *build_job
build:centos:centos7:amd64:
centos7:amd64:build:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
@@ -214,29 +250,29 @@ build:centos:centos7:amd64:
<<: *centos_centos7_amd64_image
<<: *build_job
build:clang:debian:sid:amd64:
clang:stretch:amd64:build:
variables:
CC: clang-6.0
CC: clang
CFLAGS: "-Wall -Wextra -Wenum-conversion -O2 -g"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *debian_sid_amd64_image
<<: *debian_stretch_amd64_image
<<: *build_job
build:debian:jessie:amd64:
jessie:amd64:build:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: --without-cmocka
<<: *debian_jessie_amd64_image
<<: *build_job
build:debian:stretch:amd64:
stretch:amd64:build:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
<<: *debian_stretch_amd64_image
<<: *build_job
build:debian:sid:amd64:
sid:amd64:build:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
@@ -244,15 +280,23 @@ build:debian:sid:amd64:
<<: *debian_sid_amd64_image
<<: *build_job
build:clang:debian:sid:i386:
asan:sid:amd64:build:
variables:
CC: clang-6.0
CFLAGS: "-Wall -Wextra -Wenum-conversion -O2 -g"
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g -fsanitize=address,undefined -DISC_MEM_USE_INTERNAL_MALLOC=0"
LDFLAGS: "-fsanitize=address,undefined"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *debian_sid_i386_image
<<: *debian_sid_amd64_image
<<: *build_job
build:debian:sid:i386:
clang:stretch:i386:build:
variables:
CC: clang
CFLAGS: "-Wall -Wextra -Wenum-conversion -O2 -g"
<<: *debian_stretch_i386_image
<<: *build_job
sid:i386:build:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
@@ -260,85 +304,103 @@ build:debian:sid:i386:
<<: *debian_sid_i386_image
<<: *build_job
unittest:centos:centos6:amd64:
unit:centos6:amd64:
<<: *centos_centos6_amd64_image
<<: *unit_test_job
dependencies:
- build:centos:centos6:amd64
- centos6:amd64:build
unittest:centos:centos7:amd64:
unit:centos7:amd64:
<<: *centos_centos7_amd64_image
<<: *unit_test_job
dependencies:
- build:centos:centos7:amd64
- centos7:amd64:build
unittest:debian:jessie:amd64:
unit:jessie:amd64:
<<: *debian_jessie_amd64_image
<<: *unit_test_job
dependencies:
- build:debian:jessie:amd64
- jessie:amd64:build
unittest:debian:stretch:amd64:
unit:stretch:amd64:
<<: *debian_stretch_amd64_image
<<: *unit_test_job
dependencies:
- build:debian:stretch:amd64
- stretch:amd64:build
unittest:debian:sid:amd64:
unit:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- build:debian:sid:amd64
- sid:amd64:build
unittest:clang:debian:sid:amd64:
unit:asan:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- build:clang:debian:sid:amd64
- asan:sid:amd64:build
unittest:debian:sid:i386:
unit:clang:stretch:amd64:
<<: *debian_stretch_amd64_image
<<: *unit_test_job
dependencies:
- clang:stretch:amd64:build
unit:sid:i386:
<<: *debian_sid_i386_image
<<: *unit_test_job
dependencies:
- build:debian:sid:i386
- sid:i386:build
systemtest:centos:centos6:amd64:
system:centos6:amd64:
<<: *centos_centos6_amd64_image
<<: *system_test_job
dependencies:
- build:centos:centos6:amd64
- centos6:amd64:build
systemtest:centos:centos7:amd64:
system:centos7:amd64:
<<: *centos_centos7_amd64_image
<<: *system_test_job
dependencies:
- build:centos:centos7:amd64
- centos7:amd64:build
systemtest:debian:jessie:amd64:
system:jessie:amd64:
<<: *debian_jessie_amd64_image
<<: *system_test_job
dependencies:
- build:debian:jessie:amd64
- jessie:amd64:build
systemtest:debian:stretch:amd64:
system:stretch:amd64:
<<: *debian_stretch_amd64_image
<<: *system_test_job
dependencies:
- build:debian:stretch:amd64
- stretch:amd64:build
systemtest:debian:sid:amd64:
system:sid:amd64:
<<: *debian_sid_amd64_image
<<: *system_test_job
dependencies:
- build:debian:sid:amd64
- sid:amd64:build
systemtest:debian:sid:i386:
system:asan:sid:amd64:
<<: *debian_sid_amd64_image
<<: *system_test_job
dependencies:
- asan:sid:amd64:build
system:sid:i386:
<<: *debian_sid_i386_image
<<: *system_test_job
dependencies:
- build:debian:sid:i386
- sid:i386:build
pkcs11:build:debian:sid:amd64:
install:sid:amd64:
<<: *debian_sid_amd64_image
<<: *install_test_job
dependencies:
- sid:amd64:build
pkcs11:sid:amd64:build:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
@@ -346,14 +408,34 @@ pkcs11:build:debian:sid:amd64:
<<: *debian_sid_amd64_image
<<: *build_job
pkcs11:unittest:debian:sid:amd64:
pkcs11:unit:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- pkcs11:build:debian:sid:amd64
- pkcs11:sid:amd64:build
pkcs11:systemtest:debian:sid:amd64:
pkcs11:system:sid:amd64:
<<: *debian_sid_amd64_image
<<: *system_test_job
dependencies:
- pkcs11:build:debian:sid:amd64
- pkcs11:sid:amd64:build
noassert:sid:amd64:build:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g -DISC_CHECK_NONE=1"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *debian_sid_amd64_image
<<: *build_job
noassert:unit:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- noassert:sid:amd64:build
noassert:system:sid:amd64:
<<: *debian_sid_amd64_image
<<: *system_test_job
dependencies:
- noassert:sid:amd64:build
+4
View File
@@ -9,6 +9,10 @@ email to [security-officer@isc.org](security-officer@isc.org).
(Summarize the bug encountered concisely.)
### BIND version used
(Paste the output of `named -V`.)
### Steps to reproduce
(How one can reproduce the issue - this is very important.)
+44
View File
@@ -0,0 +1,44 @@
## Release Checklist
- [ ] (Manager) Check for the presence of a milestone for the release:
- If there is a milestone, are all the issues for the milestone resolved? (other than this checklist).
- [ ] (Manager) Inform Support/Marketing of impending release (and give estimated release dates).
- (SwEng) Prepare the sources for tarball generation:
- [ ] Check perflab to ensure there has been no unexplained drop in performance for the version being released.
- [ ] Ensure that there are no outstanding merge requests in the private repository (subscription version only).
- [ ] Update API files for libraries with new version information.
- [ ] Change software version and library versions in configure.in (new major release only).
- [ ] Rebuild configure using autoconf on docs.isc.org.
- [ ] Update CHANGES.
- [ ] Update CHANGES.SE (subscription branch only).
- [ ] Update "version".
- [ ] Update "readme.md".
- Check the release notes are correct:
- [ ] Compare content with merge requests for the release.
- [ ] Check formatting.
- [ ] Build documentation on docs.isc.org.
- [ ] Commit changes and make sure the gitlab-ci tests are passing.
- [ ] Push the changes and tag ("alphatag" is an optional string such as "b1", "rc1" etc.). (```git tag -u <DEVELOPER_KEYID> -a -s -m "BIND 9.X.Y[alphatag]" v9_X_Y[alphatag]```)
- [ ] If this is the first tag for a release (e.g. beta), create a release branch named `release_v9_X_Y` (this allows development to continue on the release branch whilst release engineering continues).
- [ ] (SwEng) Run the "make release" Jenkins job to produce the tarballs and zips.
- [ ] (SwEng) Ask QA to sanity check the tarball and zips (passing to them the number of the Jenkins job).
- [ ] (QA) Sanity check the tarballs.
- [ ] (QA) Request the signature on the tarballs.
- [ ] (QA) Check signatures on tarballs.
- [ ] (QA) Tell Support to handle notification of release.
- [ ] (Manager) Inform Marketing of the release
- [ ] (Manager) Update the internal [BIND release dates wiki page](https://wiki.isc.org/bin/view/Main/BindReleaseDates) when public announcement has been made.
- [ ] (SwEng) Update DEB and RPM packages
- [ ] (SwEng) Merge the automatically prepared `prep 9.X.Y` commit which updates `version` and documentation on the release branch into the relevant maintenance branch (`v9_X`)
## Support
- [ ] Make tarballs and signatures available to download.
- [ ] Write release email to bind9-announce.
- [ ] Write email to bind9-users (if a major release).
- [ ] Update tickets in case of waiting support customers.
## Marketing
- [ ] Post short note to Twitter.
- [ ] Update [Wikipedia entry for BIND](http://en.wikipedia.org/wiki/BIND).
- [ ] Write blog article (if a major release).
+1434
View File
File diff suppressed because it is too large Load Diff
-5
View File
@@ -1,5 +0,0 @@
Content-Type: application/X-atf-atffile; version="1"
prop: test-suite = bind9
tp: lib
+332 -2
View File
@@ -1,3 +1,331 @@
5100. [func] Pin resolver tasks to specific task queues. [GL !1117]
5099. [func] Failed mutex and conditional creations are always
fatal. [GL #674]
--- 9.13.4 released ---
5098. [func] Failed memory allocations are now fatal. [GL #674]
5097. [cleanup] Remove embedded ATF unit testing framework
from BIND source distribution. [GL !875]
5096. [func] Use multiple event loops in socket code, and
make network threads CPU-affinitive. This
significantly improves performance on large
systems. [GL #666]
5095. [test] Converted all unit tests from ATF to CMocka;
removed the source code for the ATF libraries.
Build with "configure --with-cmocka" to enable
unit testing. [GL #620]
5094. [func] Add 'dig -r' to disable reading of .digrc. [GL !970]
5093. [bug] Log lame qname-minimization servers only if they're
really lame. [GL #671]
5092. [bug] Address memory leak on SIGTERM in nsupdate when using
GSS-TSIG. [GL #558]
5091. [func] Two new global and per-view options min-cache-ttl
and min-ncache-ttl [GL #613]
5090. [bug] dig and mdig failed to properly preparse dash value
pairs when value was a seperate argument and started
with a dash. [GL #584]
5089. [bug] Restore localhost fallback in dig and host which is
used when no nameserver addresses present in
/etc/resolv.conf are usable due to the requested
address family restrictions. [GL #433]
5088. [bug] dig/host/nslookup could crash when interrupted close to
a query timeout. [GL #599]
5087. [test] Check that result tables are complete. [GL #676]
5086. [func] Log of RPZ now includes the QTYPE and QCLASS. [GL #623]
5085. [bug] win32: Restore looking up nameservers, search list,
etc. [GL #186]
5084. [placeholder]
5083. [func] Add autoconf macro AX_POSIX_SHELL, so we
can use POSIX-compatible shell features
in the scripts.
5082. [bug] Fixed a race that could cause a crash in
dig/host/nslookup. [GL #650]
5081. [func] Use per-worker queues in task manager, make task
runners CPU-affine. [GL #659]
5080. [func] Improvements to "rndc nta" user interface:
- catch and report invalid command line options
- when removing an NTA from all views, do not
abort with an error if the NTA was not found
in one of the views
- include the view name in "rndc nta -dump"
output, for consistency with the add and remove
actions
Thanks to Tony Finch. [GL !816]
5079. [func] Disable IDN processing in dig and nslookup
when not on a tty. [GL #653]
5078. [cleanup] Require python components to be explicitly disabled if
python is not available on unix platforms. [GL #601]
5077. [cleanup] Remove ip6.int support (-i) from dig and mdig.
[GL !969]
5076. [bug] "require-server-cookie" was not effective if
"rate-limit" was configured. [GL #617]
5075. [bug] Refresh nameservers from cache when sending final
query in qname minimization. [GL #16]
5074. [cleanup] Remove vector socket functions - isc_socket_recvv(),
isc_socket_sendtov(), isc_socket_sendtov2(),
isc_socket_sendv() - in order to simplify socket code.
[GL #645]
5073. [bug] Destroy a task first when destroying rpzs and catzs.
[GL #84]
5072. [bug] Add unit tests for isc_buffer_copyregion() and fix its
behavior for auto-reallocated buffers. [GL #644]
5071. [bug] Comparision of NXT records was broken. [GL #631]
5070. [bug] Record types which support a empty rdata field were
not handling the empty rdata field case. [GL #638]
5069. [bug] Fix a hang on in RPZ when named is shutdown during RPZ
zone update. [GL !907]
5068. [bug] Fix a race in RPZ with min-update-interval set to 0.
[GL #643]
5067. [bug] Don't minimize qname when sending the query
to a forwarder. [GL #361]
5066. [cleanup] Allow unquoted strings to be used as a zone names
in response-policy statements. [GL #641]
5065. [bug] Only set IPV6_USE_MIN_MTU on IPv6. [GL #553]
5064. [test] Initalize TZ environment variable before calling
dns_test_begin in dnstap_test. [GL #624]
5063. [test] In statschannel test try a few times before failing
when checking if the compressed output is the same as
uncompressed. [GL !909]
5062. [func] Use non-crypto-secure PRNG to generate nonces for
cookies. [GL !887]
5061. [protocol] Add support for EID and NIMLOC. [GL #626]
5060. [bug] GID, UID and UINFO could not be loaded using unknown
record format. [GL #627]
5059. [bug] Display a per-view list of zones in the web interface.
[GL #427]
5058. [func] Replace old message digest and hmac APIs with more
generic isc_md and isc_hmac APIs, and convert their
respective tests to cmocka. [GL #305]
5057. [protocol] Add support for ATMA. [GL #619]
5056. [placeholder]
5055. [func] A default list of primary servers for the root zone is
now built into named, allowing the "masters" statement
to be omitted when configuring an IANA root zone
mirror. [GL #564]
5054. [func] Attempts to use mirror zones with recursion disabled
are now considered a configuration error. [GL #564]
5053. [func] The only valid zone-level NOTIFY settings for mirror
zones are now "notify no;" and "notify explicit;".
[GL #564]
5052. [func] Mirror zones are now configured using "type mirror;"
rather than "mirror yes;". [GL #564]
5051. [doc] Documentation incorrectly stated that the
"server-addresses" static-stub zone option accepts
custom port numbers. [GL #582]
5050. [bug] The libirs version of getaddrinfo() was unable to parse
scoped IPv6 addresses present in /etc/resolv.conf.
[GL #187]
5049. [cleanup] QNAME minimization has been deeply refactored. [GL #16]
5048. [func] Add configure option to enable and enforce FIPS mode
in BIND 9. [GL #506]
5047. [bug] Messages logged for certain query processing failures
now include a more specific error description if it is
available. [GL #572]
5046. [bug] named could crash during shutdown if an RPZ
reload was in progress. [RT #46210]
5045. [func] Remove support for DNSSEC algorithms 3 (DSA)
and 6 (DSA-NSEC3-SHA1). [GL #22]
5044. [cleanup] If "dnssec-enable" is no, then "dnssec-validation"
now also defaults to no. [GL #388]
5043. [bug] Fix creating and validating EdDSA signatures. [GL #579]
5042. [test] Make the chained delegations in reclimit behave
like they would in a regular name server. [GL #578]
5041. [test] The chain test contains a incomplete delegation.
[GL #568]
5040. [func] Extended dnstap so that it can log UPDATE requests
and responses as separate message types. Thanks
to Greg Rabil. [GL #570]
5039. [bug] Named could fail to preserve owner name case of new
RRset. [GL #420]
5038. [bug] Chaosnet addresses were compared incorrectly.
[GL #562]
5037. [func] "allow-recursion-on" and "allow-query-cache-on"
each now default to the other if only one of them
is set, in order to be more consistent with the way
"allow-recursion" and "allow-query-cache" work.
Also we now ensure that both query-cache ACLs are
checked when determining cache access. [GL #319]
5036. [cleanup] Fixed a spacing/formatting error in some RPZ-related
error messages in the log. [GL !805]
5035. [test] Fixed errors that prevented the DNSRPS subtests
from running in the rpz and rpzrecurse system
tests. [GL #503]
5034. [bug] A race between threads could prevent zone maintenance
scheduled immediately after zone load from being
performed. [GL #542]
5033. [bug] When adding NTAs to multiple views using "rndc nta",
the text returned via rndc was incorrectly terminated
after the first line, making it look as if only one
NTA had been added. Also, it was not possible to
differentiate between views with the same name but
different classes; this has been corrected with the
addition of a "-class" option. [GL #105]
5032. [func] Add krb5-selfsub and ms-selfsub update policy rules.
[GL #511]
5031. [cleanup] Various defines in platform.h has been either dropped
if always or never triggered on supported platforms
or replaced with config.h equivalents if the defines
didn't have any impact on public headers. Workarounds
for LinuxThreads have been removed because NPTL is
available since Linux kernel 2.6.0. [GL #525]
5030. [bug] Align CMSG buffers to a 64-bit boundary, fixes crash
on architectures with strict alignment. [GL #521]
--- 9.13.3 released ---
5029. [func] Workarounds for servers that misbehave when queried
with EDNS have been removed, because these broken
servers and the workarounds for their noncompliance
cause unnecessary delays, increase code complexity,
and prevent deployment of new DNS features. See
https://dnsflagday.net for further details. [GL #150]
5028. [bug] Spread the initial RRSIG expiration times over the
entire working sig-validity-interval when signing a
zone in named to even out re-signing and transfer
loads. [GL #418]
5027. [func] Set SO_SNDBUF size on sockets. [GL #74]
5026. [bug] rndc reconfig should not touch already loaded zones.
[GL #276]
5025. [cleanup] Remove isc_keyboard family of functions. [GL #178]
5024. [func] Replace custom assembly for atomic operations with
atomic support from the compiler. The code will now use
C11 stdatomic, or __atomic, or __sync builtins with GCC
or Clang compilers, and Interlocked functions with MSVC.
[GL #10]
5023. [cleanup] Remove wrappers that try to fix broken or incomplete
implementations of IPv6, pthreads and other core
functionality required and used by BIND. [GL #192]
5022. [doc] Update ms-self, ms-subdomain, krb5-self, and
krb5-subdomain documentation. [GL !708]
5021. [bug] dig returned a non-zero exit code when it received a
reply over TCP after a retry. [GL #487]
5020. [func] RNG uses thread-local storage instead of locks, if
supported by platform. [GL #496]
5019. [cleanup] A message is now logged when ixfr-from-differences is
set at zone level for an inline-signed zone. [GL #470]
5018. [bug] Fix incorrect sizeof arguments in lib/isc/pk11.c.
[GL !588]
5017. [bug] lib/isc/pk11.c failed to unlink the session before
releasing the lock which is unsafe. [GL !589]
5016. [bug] Named could assert with overlapping filter-aaaa and
dns64 acls. [GL #445]
5015. [bug] Reloading all zones caused zone maintenance to cease
for inline-signed zones. [GL #435]
5014. [bug] Signatures loaded from the journal for the signed
version of an inline-signed zone were not scheduled for
refresh. [GL #482]
5013. [bug] A referral response with a non-empty ANSWER section was
inadvertently being treated as an error. [GL #390]
5012. [bug] Fix lock order reversal in pk11_initialize. [GL !590]
5011. [func] Remove support for unthreaded named. [GL #478]
5010. [func] New "validate-except" option specifies a list of
domains beneath which DNSSEC validation should not
be performed. [GL #237]
5009. [bug] Upon an OpenSSL failure, the first error in the OpenSSL
error queue was not logged. [GL #476]
5008. [bug] "rndc signing -nsec3param ..." requests were silently
ignored for zones which were not yet loaded or
transferred. [GL #468]
5007. [cleanup] Replace custom ISC boolean and integer data types
with C99 stdint.h and stdbool.h types. [GL #9]
5006. [cleanup] Code preparing a delegation response was extracted from
query_delegation() and query_zone_delegation() into a
separate function in order to decrease code
duplication. [GL #431]
5005. [bug] dnssec-verify, and dnssec-signzone at the verification
step, failed on some validly signed zones. [GL #442]
@@ -17,12 +345,14 @@
5000. [bug] named_server_servestale() could leave the server in
exclusive mode if an error occured. [GL #441]
4999. [cleanup] Remove custom printf implementaion in lib/isc/print.c.
4999. [cleanup] Remove custom printf implementation in lib/isc/print.c.
[GL #261]
4998. [test] Make resolver and cacheclean tests more civilized.
4997. [placeholder]
4997. [security] named could crash during recursive processing
of DNAME records when "deny-answer-aliases" was
in use. (CVE-2018-5740) [GL #387]
4996. [bug] dig: Handle malformed +ednsopt option. [GL #403]
+2 -1
View File
@@ -14,7 +14,7 @@ top_builddir = @top_builddir@
VERSION=@BIND9_VERSION@
SUBDIRS = make unit lib bin doc
SUBDIRS = make lib fuzz bin doc
TARGETS =
PREREQS = bind.keys.h
@@ -90,6 +90,7 @@ force-test: test-force
test-force:
status=0; \
(cd fuzz && ${MAKE} check) || status=1; \
(cd bin/tests && ${MAKE} ${MAKEDEFS} test) || status=1; \
(test -f ${top_builddir}/unit/unittest.sh && \
$(SHELL) ${top_builddir}/unit/unittest.sh) || status=1; \
+37 -4
View File
@@ -1,9 +1,11 @@
Supported platforms
In general, this version of BIND will build and run on any POSIX-compliant
system with a C99-compliant C compiler, BSD-style sockets, and the OpenSSL
cryptography library. To build with multiprocessing support, a
C11-compliant C compiler will be needed for standard atomics.
system with a C99-compliant C compiler, BSD-style sockets with
RFC-compliant IPv6 support, POSIX-compliant threads, and the OpenSSL
cryptography library. Atomic operations support from the compiler is
needed, either in the form of builtin operations, C11 atomics or the
Interlocked family of functions on Windows.
ISC regularly tests BIND on many operating systems and architectures, but
lacks the resources to test all of them. Consequently, ISC is only able to
@@ -53,4 +55,35 @@ These are platforms on which BIND is known not to build or run:
* Platforms without at least OpenSSL 1.0.2
* Windows 10 / x86
* Windows Server 2012
* Windows Server 2012 and older
* Platforms that don't support IPv6 Advanced Socket API (RFC 3542)
* Platforms that don't support atomic operations (via compiler or
library)
* Linux without NPTL (Native POSIX Thread Library)
Platform quirks
ARM
If the compilation ends with following error:
Error: selected processor does not support `yield' in ARM mode
You will need to set -march compiler option to native, so the compiler
recognizes yield assembler instruction. The proper way to set -march=
native would be to put it into CFLAGS, e.g. run ./configure like this:
CFLAGS="-march=native -Os -g" ./configure plus your usual options.
If that doesn't work, you can enforce the minimum CPU and FPU (taken from
Debian armhf documentation):
* The lowest worthwhile CPU implementation is Armv7-A, therefore the
recommended build option is -march=armv7-a.
* FPU should be set at VFPv3-D16 as they represent the miminum
specification of the processors to support here, therefore the
recommended build option is -mfpu=vfpv3-d16.
The configure command should look like this:
CFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -Os -g" ./configure
+40 -4
View File
@@ -11,9 +11,11 @@
## Supported platforms
In general, this version of BIND will build and run on any POSIX-compliant
system with a C99-compliant C compiler, BSD-style sockets, and the OpenSSL
cryptography library. To build with multiprocessing support, a
C11-compliant C compiler will be needed for standard atomics.
system with a C99-compliant C compiler, BSD-style sockets with RFC-compliant
IPv6 support, POSIX-compliant threads, and the OpenSSL cryptography library.
Atomic operations support from the compiler is needed, either in the form of
builtin operations, C11 atomics or the Interlocked family of functions on
Windows.
ISC regularly tests BIND on many operating systems and architectures, but
lacks the resources to test all of them. Consequently, ISC is only able to
@@ -61,4 +63,38 @@ These are platforms on which BIND is known *not* to build or run:
* Platforms without at least OpenSSL 1.0.2
* Windows 10 / x86
* Windows Server 2012
* Windows Server 2012 and older
* Platforms that don't support IPv6 Advanced Socket API (RFC 3542)
* Platforms that don't support atomic operations (via compiler or library)
* Linux without NPTL (Native POSIX Thread Library)
## Platform quirks
### ARM
If the compilation ends with following error:
```
Error: selected processor does not support `yield' in ARM mode
```
You will need to set `-march` compiler option to `native`, so the compiler
recognizes `yield` assembler instruction. The proper way to set `-march=native`
would be to put it into `CFLAGS`, e.g. run `./configure` like this:
`CFLAGS="-march=native -Os -g" ./configure` plus your usual options.
If that doesn't work, you can enforce the minimum CPU and FPU (taken from Debian
armhf documentation):
* The lowest worthwhile CPU implementation is Armv7-A, therefore the recommended
build option is `-march=armv7-a`.
* FPU should be set at VFPv3-D16 as they represent the miminum specification of
the processors to support here, therefore the recommended build option is
`-mfpu=vfpv3-d16`.
The configure command should look like this:
```
CFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -Os -g" ./configure
```
+24 -14
View File
@@ -104,8 +104,8 @@ BIND 9.13 features
BIND 9.13 is the newest development branch of BIND 9. It includes a number
of changes from BIND 9.12 and earlier releases. New features include:
* The default value of "dnssec-validation" is now "auto".
* Support for IDNA2008 when linking with libidn2.
* Socket and task code has been refactored to improve performance.
* QNAME minimization, as described in RFC 7816, is now supported.
* "Root key sentinel" support, enabling validating resolvers to indicate
via a special query which trust anchors are configured for the root
zone.
@@ -114,12 +114,24 @@ of changes from BIND 9.12 and earlier releases. New features include:
subject to DNSSEC validation and are not treated as authoritative data
when answering. This makes it easier to configure a local copy of the
root zone as described in RFC 7706.
* The "validate-except" option allows configuration of domains below
which DNSSEC validation should not be performed.
* The default value of "dnssec-validation" is now "auto".
* IDNA2008 is now supported when linking with libidn2.
In addition, cryptographic support has been modernized. BIND now uses the
best available pseudo-random number generator for the platform on which
it's built. Very old versions of OpenSSL are no longer supported.
Cryptography is now mandatory; building BIND without DNSSEC is now longer
supported.
In addition, workarounds that were formerly in place to enable resolution
of domains whose authoritative servers did not respond to EDNS queries
have been removed. See https://dnsflagday.net for more details.
Cryptographic support has been modernized. BIND now uses the best
available pseudo-random number generator for the platform on which it's
built. Very old versions of OpenSSL are no longer supported. Cryptography
is now mandatory: building BIND without DNSSEC is now longer supported.
Special code to support certain legacy operating systems has also been
removed; see the file PLATFORMS.md for details of supported platforms. In
addition to OpenSSL, BIND now requires support for IPv6, threads, and
standard atomic operations provided by the C compiler.
Building BIND
@@ -127,7 +139,7 @@ Minimally, BIND requires a UNIX or Linux system with an ANSI C compiler,
basic POSIX support, and a 64-bit integer type. Successful builds have
been observed on many versions of Linux and UNIX, including RedHat,
Fedora, Debian, Ubuntu, SuSE, Slackware, FreeBSD, NetBSD, OpenBSD, Mac OS
X, Solaris, HP-UX, AIX, SCO OpenServer, and OpenWRT.
X, Solaris, HP-UX, and OpenWRT.
BIND requires a cryptography provider library such as OpenSSL or a
hardware service module supporting PKCS#11. On Linux, BIND requires the
@@ -253,10 +265,6 @@ specifying --enable-fixed-rrset or --disable-fixed-rrset on the configure
command line. By default, fixed rrset-order is disabled to reduce memory
footprint.
If your operating system has integrated support for IPv6, it will be used
automatically. If you have installed KAME IPv6 separately, use --with-kame
[=PATH] to specify its location.
make install will install named and the various BIND 9 libraries. By
default, installation is into /usr/local, but this can be changed with the
--prefix option when running configure.
@@ -282,8 +290,10 @@ and will be skipped if these are not available. Some tests require Python
and the 'dnspython' module and will be skipped if these are not available.
See bin/tests/system/README for further details.
Unit tests are implemented using Automated Testing Framework (ATF). To run
them, use configure --with-atf, then run make test or make unit.
Unit tests are implemented using the CMocka unit testing framework. To
build them, use configure --with-cmocka. Execution of tests is done by the
Kyua test execution engine; if the kyua command is available, then unit
tests can be run via make test or make unit.
Documentation
+24 -12
View File
@@ -122,8 +122,8 @@ BIND 9.13 is the newest development branch of BIND 9. It includes a
number of changes from BIND 9.12 and earlier releases. New features
include:
* The default value of "dnssec-validation" is now "auto".
* Support for IDNA2008 when linking with `libidn2`.
* Socket and task code has been refactored to improve performance.
* QNAME minimization, as described in RFC 7816, is now supported.
* "Root key sentinel" support, enabling validating resolvers to indicate
via a special query which trust anchors are configured for the root zone.
* Secondary zones can now be configured as "mirror" zones; their contents
@@ -131,20 +131,35 @@ include:
DNSSEC validation and are not treated as authoritative data when
answering. This makes it easier to configure a local copy of the root
zone as described in RFC 7706.
* The "validate-except" option allows configuration of domains below which
DNSSEC validation should not be performed.
* The default value of "dnssec-validation" is now "auto".
* IDNA2008 is now supported when linking with `libidn2`.
In addition, cryptographic support has been modernized. BIND now uses the
In addition, workarounds that were formerly in place to enable resolution
of domains whose authoritative servers did not respond to EDNS queries
have been removed. See [https://dnsflagday.net](https://dnsflagday.net)
for more details.
Cryptographic support has been modernized. BIND now uses the
best available pseudo-random number generator for the platform on which
it's built. Very old versions of OpenSSL are no longer supported.
Cryptography is now mandatory; building BIND without DNSSEC is now
Cryptography is now mandatory: building BIND without DNSSEC is now
longer supported.
Special code to support certain legacy operating systems has also
been removed; see the file [PLATFORMS.md](PLATFORMS.md) for details
of supported platforms. In addition to OpenSSL, BIND now requires
support for IPv6, threads, and standard atomic operations provided
by the C compiler.
### <a name="build"/> Building BIND
Minimally, BIND requires a UNIX or Linux system with an ANSI C compiler,
basic POSIX support, and a 64-bit integer type. Successful builds have been
observed on many versions of Linux and UNIX, including RedHat, Fedora,
Debian, Ubuntu, SuSE, Slackware, FreeBSD, NetBSD, OpenBSD, Mac OS X,
Solaris, HP-UX, AIX, SCO OpenServer, and OpenWRT.
Solaris, HP-UX, and OpenWRT.
BIND requires a cryptography provider library such as OpenSSL or a
hardware service module supporting PKCS#11. On Linux, BIND requires
@@ -268,10 +283,6 @@ specifying `--enable-fixed-rrset` or `--disable-fixed-rrset` on the
configure command line. By default, fixed rrset-order is disabled to
reduce memory footprint.
If your operating system has integrated support for IPv6, it will be used
automatically. If you have installed KAME IPv6 separately, use
`--with-kame[=PATH]` to specify its location.
`make install` will install `named` and the various BIND 9 libraries. By
default, installation is into /usr/local, but this can be changed with the
`--prefix` option when running `configure`.
@@ -297,9 +308,10 @@ and will be skipped if these are not available. Some tests require Python
and the 'dnspython' module and will be skipped if these are not available.
See bin/tests/system/README for further details.
Unit tests are implemented using Automated Testing Framework (ATF).
To run them, use `configure --with-atf`, then run `make test` or
`make unit`.
Unit tests are implemented using the CMocka unit testing framework.
To build them, use `configure --with-cmocka`. Execution of tests is done
by the Kyua test execution engine; if the `kyua` command is available,
then unit tests can be run via `make test` or `make unit`.
### <a name="doc"/> Documentation
-131
View File
@@ -1,131 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
/***
*** This file is not to be included by any public header files, because
*** it does not get installed.
***/
@TOP@
/** define on DEC OSF to enable 4.4BSD style sa_len support */
#undef _SOCKADDR_LEN
/** define if your system needs pthread_init() before using pthreads */
#undef NEED_PTHREAD_INIT
/** define if your system has sigwait() */
#undef HAVE_SIGWAIT
/** define if sigwait() is the UnixWare flavor */
#undef HAVE_UNIXWARE_SIGWAIT
/** define on Solaris to get sigwait() to work using pthreads semantics */
#undef _POSIX_PTHREAD_SEMANTICS
/** define if LinuxThreads is in use */
#undef HAVE_LINUXTHREADS
/** define if sysconf() is available */
#undef HAVE_SYSCONF
/** define if sysctlbyname() is available */
#undef HAVE_SYSCTLBYNAME
/** define if catgets() is available */
#undef HAVE_CATGETS
/** define if getifaddrs() exists */
#undef HAVE_GETIFADDRS
/** define if you have the NET_RT_IFLIST sysctl variable and sys/sysctl.h */
#undef HAVE_IFLIST_SYSCTL
/** define if tzset() is available */
#undef HAVE_TZSET
/** define if struct addrinfo exists */
#undef HAVE_ADDRINFO
/** define if getaddrinfo() exists */
#undef HAVE_GETADDRINFO
/** define if gai_strerror() exists */
#undef HAVE_GAISTRERROR
/**
* define if pthread_setconcurrency() should be called to tell the
* OS how many threads we might want to run.
*/
#undef CALL_PTHREAD_SETCONCURRENCY
/** define if IPv6 is not disabled */
#undef WANT_IPV6
/** define if flockfile() is available */
#undef HAVE_FLOCKFILE
/** define if getc_unlocked() is available */
#undef HAVE_GETCUNLOCKED
/** Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */
#undef SHUTUP_SPUTAUX
#ifdef SHUTUP_SPUTAUX
struct __sFILE;
extern __inline int __sputaux(int _c, struct __sFILE *_p);
#endif
/** Shut up warnings about missing sigwait prototype on BSD/OS 4.0* */
#undef SHUTUP_SIGWAIT
#ifdef SHUTUP_SIGWAIT
int sigwait(const unsigned int *set, int *sig);
#endif
/** Shut up warnings from gcc -Wcast-qual on BSD/OS 4.1. */
#undef SHUTUP_STDARG_CAST
#if defined(SHUTUP_STDARG_CAST) && defined(__GNUC__)
#include <stdarg.h> /** Grr. Must be included *every time*. */
/**
* The silly continuation line is to keep configure from
* commenting out the #undef.
*/
#undef \
va_start
#define va_start(ap, last) \
do { \
union { const void *konst; long *var; } _u; \
_u.konst = &(last); \
ap = (va_list)(_u.var + __va_words(__typeof(last))); \
} while (0)
#endif /** SHUTUP_STDARG_CAST && __GNUC__ */
/** define if the system has a random number generating device */
#undef PATH_RANDOMDEV
/** define if pthread_attr_getstacksize() is available */
#undef HAVE_PTHREAD_ATTR_GETSTACKSIZE
/** define if pthread_attr_setstacksize() is available */
#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
/** define if you have strerror in the C library. */
#undef HAVE_STRERROR
/* Define to the length type used by the socket API (socklen_t, size_t, int). */
#undef ISC_SOCKADDR_LEN_T
/* Define if threads need PTHREAD_SCOPE_SYSTEM */
#undef NEED_PTHREAD_SCOPE_SYSTEM
/* Define to 1 if you have the uname library function. */
#undef HAVE_UNAME
Vendored
+2
View File
@@ -289,6 +289,8 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
m4_include([m4/ax_check_openssl.m4])
m4_include([m4/ax_posix_shell.m4])
m4_include([m4/ax_pthread.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
+2 -2
View File
@@ -88,12 +88,12 @@ install:: named-checkconf@EXEEXT@ named-checkzone@EXEEXT@ installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkconf@EXEEXT@ ${DESTDIR}${sbindir}
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkzone@EXEEXT@ ${DESTDIR}${sbindir}
(cd ${DESTDIR}${sbindir}; rm -f named-compilezone@EXEEXT@; ${LINK_PROGRAM} named-checkzone@EXEEXT@ named-compilezone@EXEEXT@)
for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8; done
for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8 || exit 1; done
(cd ${DESTDIR}${mandir}/man8; rm -f named-compilezone.8; ${LINK_PROGRAM} named-checkzone.8 named-compilezone.8)
uninstall::
rm -f ${DESTDIR}${mandir}/man8/named-compilezone.8
for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m ; done
for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m || exit 1; done
rm -f ${DESTDIR}${sbindir}/named-compilezone@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named-checkconf@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named-checkzone@EXEEXT@
+45 -64
View File
@@ -14,7 +14,9 @@
#include <config.h>
#include <stdbool.h>
#include <stdio.h>
#include <inttypes.h>
#ifdef _WIN32
#include <Winsock2.h>
@@ -60,14 +62,6 @@
#define CHECK_LOCAL 1
#endif
#ifdef HAVE_ADDRINFO
#ifdef HAVE_GETADDRINFO
#ifdef HAVE_GAISTRERROR
#define USE_GETADDRINFO
#endif
#endif
#endif
#define CHECK(r) \
do { \
result = (r); \
@@ -88,15 +82,15 @@ static const char *dbtype[] = { "rbt" };
int debug = 0;
const char *journal = NULL;
isc_boolean_t nomerge = ISC_TRUE;
bool nomerge = true;
#if CHECK_LOCAL
isc_boolean_t docheckmx = ISC_TRUE;
isc_boolean_t dochecksrv = ISC_TRUE;
isc_boolean_t docheckns = ISC_TRUE;
bool docheckmx = true;
bool dochecksrv = true;
bool docheckns = true;
#else
isc_boolean_t docheckmx = ISC_FALSE;
isc_boolean_t dochecksrv = ISC_FALSE;
isc_boolean_t docheckns = ISC_FALSE;
bool docheckmx = false;
bool dochecksrv = false;
bool docheckns = false;
#endif
dns_zoneopt_t zone_options = DNS_ZONEOPT_CHECKNS |
DNS_ZONEOPT_CHECKMX |
@@ -142,7 +136,7 @@ add(char *key, int value) {
if (symtab == NULL) {
result = isc_symtab_create(sym_mctx, 100, freekey, sym_mctx,
ISC_FALSE, &symtab);
false, &symtab);
if (result != ISC_R_SUCCESS)
return;
}
@@ -158,32 +152,31 @@ add(char *key, int value) {
isc_mem_free(sym_mctx, key);
}
static isc_boolean_t
static bool
logged(char *key, int value) {
isc_result_t result;
if (symtab == NULL)
return (ISC_FALSE);
return (false);
result = isc_symtab_lookup(symtab, key, value, NULL);
if (result == ISC_R_SUCCESS)
return (ISC_TRUE);
return (ISC_FALSE);
return (true);
return (false);
}
static isc_boolean_t
static bool
checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
dns_rdataset_t *a, dns_rdataset_t *aaaa)
{
#ifdef USE_GETADDRINFO
dns_rdataset_t *rdataset;
dns_rdata_t rdata = DNS_RDATA_INIT;
struct addrinfo hints, *ai, *cur;
char namebuf[DNS_NAME_FORMATSIZE + 1];
char ownerbuf[DNS_NAME_FORMATSIZE];
char addrbuf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:123.123.123.123")];
isc_boolean_t answer = ISC_TRUE;
isc_boolean_t match;
bool answer = true;
bool match;
const char *type;
void *ptr = NULL;
int result;
@@ -232,7 +225,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
ownerbuf, namebuf,
cur->ai_canonname);
/* XXX950 make fatal for 9.5.0 */
/* answer = ISC_FALSE; */
/* answer = false; */
add(namebuf, ERR_IS_CNAME);
}
break;
@@ -248,7 +241,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
add(namebuf, ERR_NO_ADDRESSES);
}
/* XXX950 make fatal for 9.5.0 */
return (ISC_TRUE);
return (true);
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
@@ -257,7 +250,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
namebuf, gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return (ISC_TRUE);
return (true);
}
/*
@@ -268,13 +261,13 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
result = dns_rdataset_first(a);
while (result == ISC_R_SUCCESS) {
dns_rdataset_current(a, &rdata);
match = ISC_FALSE;
match = false;
for (cur = ai; cur != NULL; cur = cur->ai_next) {
if (cur->ai_family != AF_INET)
continue;
ptr = &((struct sockaddr_in *)(cur->ai_addr))->sin_addr;
if (memcmp(ptr, rdata.data, rdata.length) == 0) {
match = ISC_TRUE;
match = true;
break;
}
}
@@ -286,7 +279,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
addrbuf, sizeof(addrbuf)));
add(namebuf, ERR_EXTRA_A);
/* XXX950 make fatal for 9.5.0 */
/* answer = ISC_FALSE; */
/* answer = false; */
}
dns_rdata_reset(&rdata);
result = dns_rdataset_next(a);
@@ -298,13 +291,13 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
result = dns_rdataset_first(aaaa);
while (result == ISC_R_SUCCESS) {
dns_rdataset_current(aaaa, &rdata);
match = ISC_FALSE;
match = false;
for (cur = ai; cur != NULL; cur = cur->ai_next) {
if (cur->ai_family != AF_INET6)
continue;
ptr = &((struct sockaddr_in6 *)(cur->ai_addr))->sin6_addr;
if (memcmp(ptr, rdata.data, rdata.length) == 0) {
match = ISC_TRUE;
match = true;
break;
}
}
@@ -316,7 +309,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
addrbuf, sizeof(addrbuf)));
add(namebuf, ERR_EXTRA_AAAA);
/* XXX950 make fatal for 9.5.0. */
/* answer = ISC_FALSE; */
/* answer = false; */
}
dns_rdata_reset(&rdata);
result = dns_rdataset_next(aaaa);
@@ -327,7 +320,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
* Check that all addresses appear in the glue.
*/
if (!logged(namebuf, ERR_MISSING_GLUE)) {
isc_boolean_t missing_glue = ISC_FALSE;
bool missing_glue = false;
for (cur = ai; cur != NULL; cur = cur->ai_next) {
switch (cur->ai_family) {
case AF_INET:
@@ -343,7 +336,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
default:
continue;
}
match = ISC_FALSE;
match = false;
if (dns_rdataset_isassociated(rdataset))
result = dns_rdataset_first(rdataset);
else
@@ -351,7 +344,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
while (result == ISC_R_SUCCESS && !match) {
dns_rdataset_current(rdataset, &rdata);
if (memcmp(ptr, rdata.data, rdata.length) == 0)
match = ISC_TRUE;
match = true;
dns_rdata_reset(&rdata);
result = dns_rdataset_next(rdataset);
}
@@ -362,8 +355,8 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
inet_ntop(cur->ai_family, ptr,
addrbuf, sizeof(addrbuf)));
/* XXX950 make fatal for 9.5.0. */
/* answer = ISC_FALSE; */
missing_glue = ISC_TRUE;
/* answer = false; */
missing_glue = true;
}
}
if (missing_glue)
@@ -371,20 +364,16 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
}
freeaddrinfo(ai);
return (answer);
#else
return (ISC_TRUE);
#endif
}
static isc_boolean_t
static bool
checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
#ifdef USE_GETADDRINFO
struct addrinfo hints, *ai, *cur;
char namebuf[DNS_NAME_FORMATSIZE + 1];
char ownerbuf[DNS_NAME_FORMATSIZE];
int result;
int level = ISC_LOG_ERROR;
isc_boolean_t answer = ISC_TRUE;
bool answer = true;
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_CANONNAME;
@@ -428,7 +417,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
add(namebuf, ERR_IS_MXCNAME);
}
if (level == ISC_LOG_ERROR)
answer = ISC_FALSE;
answer = false;
}
}
freeaddrinfo(ai);
@@ -446,7 +435,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
add(namebuf, ERR_NO_ADDRESSES);
}
/* XXX950 make fatal for 9.5.0. */
return (ISC_TRUE);
return (true);
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
@@ -455,22 +444,18 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
namebuf, gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return (ISC_TRUE);
return (true);
}
#else
return (ISC_TRUE);
#endif
}
static isc_boolean_t
static bool
checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
#ifdef USE_GETADDRINFO
struct addrinfo hints, *ai, *cur;
char namebuf[DNS_NAME_FORMATSIZE + 1];
char ownerbuf[DNS_NAME_FORMATSIZE];
int result;
int level = ISC_LOG_ERROR;
isc_boolean_t answer = ISC_TRUE;
bool answer = true;
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_CANONNAME;
@@ -513,7 +498,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
add(namebuf, ERR_IS_SRVCNAME);
}
if (level == ISC_LOG_ERROR)
answer = ISC_FALSE;
answer = false;
}
}
freeaddrinfo(ai);
@@ -531,7 +516,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
add(namebuf, ERR_NO_ADDRESSES);
}
/* XXX950 make fatal for 9.5.0. */
return (ISC_TRUE);
return (true);
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
@@ -540,11 +525,8 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
namebuf, gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return (ISC_TRUE);
return (true);
}
#else
return (ISC_TRUE);
#endif
}
isc_result_t
@@ -650,7 +632,7 @@ check_ttls(dns_zone_t *zone, dns_ttl_t maxttl) {
if (dbiter != NULL)
dns_dbiterator_destroy(&dbiter);
if (version != NULL)
dns_db_closeversion(db, &version, ISC_FALSE);
dns_db_closeversion(db, &version, false);
if (db != NULL)
dns_db_detach(&db);
@@ -697,7 +679,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
CHECK(dns_rdataclass_fromtext(&rdclass, &region));
dns_zone_setclass(zone, rdclass);
dns_zone_setoption(zone, zone_options, ISC_TRUE);
dns_zone_setoption(zone, zone_options, true);
dns_zone_setoption(zone, DNS_ZONEOPT_NOMERGE, nomerge);
dns_zone_setmaxttl(zone, maxttl);
@@ -709,7 +691,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
if (dochecksrv)
dns_zone_setchecksrv(zone, checksrv);
CHECK(dns_zone_load(zone));
CHECK(dns_zone_load(zone, false));
/*
* When loading map files we can't catch oversize TTLs during
@@ -734,7 +716,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
isc_result_t
dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
dns_masterformat_t fileformat, const dns_master_style_t *style,
const isc_uint32_t rawversion)
const uint32_t rawversion)
{
isc_result_t result;
FILE *output = stdout;
@@ -789,4 +771,3 @@ DestroySockets(void) {
WSACleanup();
}
#endif
+8 -5
View File
@@ -15,6 +15,9 @@
/*! \file */
#include <inttypes.h>
#include <stdbool.h>
#include <isc/lang.h>
#include <isc/stdio.h>
#include <isc/types.h>
@@ -36,7 +39,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
isc_result_t
dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
dns_masterformat_t fileformat, const dns_master_style_t *style,
const isc_uint32_t rawversion);
const uint32_t rawversion);
#ifdef _WIN32
void InitSockets(void);
@@ -45,10 +48,10 @@ void DestroySockets(void);
extern int debug;
extern const char *journal;
extern isc_boolean_t nomerge;
extern isc_boolean_t docheckmx;
extern isc_boolean_t docheckns;
extern isc_boolean_t dochecksrv;
extern bool nomerge;
extern bool docheckmx;
extern bool docheckns;
extern bool dochecksrv;
extern dns_zoneopt_t zone_options;
ISC_LANG_ENDDECLS
+47 -32
View File
@@ -15,6 +15,7 @@
#include <config.h>
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
@@ -91,18 +92,18 @@ directory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) {
return (ISC_R_SUCCESS);
}
static isc_boolean_t
static bool
get_maps(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
int i;
for (i = 0;; i++) {
if (maps[i] == NULL)
return (ISC_FALSE);
return (false);
if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS)
return (ISC_TRUE);
return (true);
}
}
static isc_boolean_t
static bool
get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
const cfg_listelt_t *element;
const cfg_obj_t *checknames;
@@ -113,14 +114,14 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
for (i = 0;; i++) {
if (maps[i] == NULL)
return (ISC_FALSE);
return (false);
checknames = NULL;
result = cfg_map_get(maps[i], "check-names", &checknames);
if (result != ISC_R_SUCCESS)
continue;
if (checknames != NULL && !cfg_obj_islist(checknames)) {
*obj = checknames;
return (ISC_TRUE);
return (true);
}
for (element = cfg_list_first(checknames);
element != NULL;
@@ -135,7 +136,7 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
continue;
}
*obj = cfg_tuple_get(value, "mode");
return (ISC_TRUE);
return (true);
}
}
}
@@ -168,7 +169,7 @@ configure_hint(const char *zfile, const char *zclass, isc_mem_t *mctx) {
static isc_result_t
configure_zone(const char *vclass, const char *view,
const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
const cfg_obj_t *config, isc_mem_t *mctx, isc_boolean_t list)
const cfg_obj_t *config, isc_mem_t *mctx, bool list)
{
int i = 0;
isc_result_t result;
@@ -281,8 +282,10 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKDUPRR;
zone_options &= ~DNS_ZONEOPT_CHECKDUPRRFAIL;
} else
} else {
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKDUPRR;
zone_options &= ~DNS_ZONEOPT_CHECKDUPRRFAIL;
@@ -299,8 +302,10 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKMX;
zone_options &= ~DNS_ZONEOPT_CHECKMXFAIL;
} else
} else {
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKMX;
zone_options &= ~DNS_ZONEOPT_CHECKMXFAIL;
@@ -326,8 +331,10 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options |= DNS_ZONEOPT_WARNMXCNAME;
zone_options |= DNS_ZONEOPT_IGNOREMXCNAME;
} else
} else {
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_WARNMXCNAME;
zone_options &= ~DNS_ZONEOPT_IGNOREMXCNAME;
@@ -344,8 +351,10 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options |= DNS_ZONEOPT_WARNSRVCNAME;
zone_options |= DNS_ZONEOPT_IGNORESRVCNAME;
} else
} else {
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_WARNSRVCNAME;
zone_options &= ~DNS_ZONEOPT_IGNORESRVCNAME;
@@ -365,8 +374,10 @@ configure_zone(const char *vclass, const char *view,
zone_options |= DNS_ZONEOPT_CHECKSPF;
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKSPF;
} else
} else {
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKSPF;
}
@@ -382,8 +393,10 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKNAMES;
zone_options &= ~DNS_ZONEOPT_CHECKNAMESFAIL;
} else
} else {
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKNAMES;
zone_options |= DNS_ZONEOPT_CHECKNAMESFAIL;
@@ -393,14 +406,16 @@ configure_zone(const char *vclass, const char *view,
fmtobj = NULL;
if (get_maps(maps, "masterfile-format", &fmtobj)) {
const char *masterformatstr = cfg_obj_asstring(fmtobj);
if (strcasecmp(masterformatstr, "text") == 0)
if (strcasecmp(masterformatstr, "text") == 0) {
masterformat = dns_masterformat_text;
else if (strcasecmp(masterformatstr, "raw") == 0)
} else if (strcasecmp(masterformatstr, "raw") == 0) {
masterformat = dns_masterformat_raw;
else if (strcasecmp(masterformatstr, "map") == 0)
} else if (strcasecmp(masterformatstr, "map") == 0) {
masterformat = dns_masterformat_map;
else
} else {
INSIST(0);
ISC_UNREACHABLE();
}
}
obj = NULL;
@@ -420,7 +435,7 @@ configure_zone(const char *vclass, const char *view,
/*% configure a view */
static isc_result_t
configure_view(const char *vclass, const char *view, const cfg_obj_t *config,
const cfg_obj_t *vconfig, isc_mem_t *mctx, isc_boolean_t list)
const cfg_obj_t *vconfig, isc_mem_t *mctx, bool list)
{
const cfg_listelt_t *element;
const cfg_obj_t *voptions;
@@ -469,7 +484,7 @@ config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
/*% load zones from the configuration */
static isc_result_t
load_zones_fromconfig(const cfg_obj_t *config, isc_mem_t *mctx,
isc_boolean_t list_zones)
bool list_zones)
{
const cfg_listelt_t *element;
const cfg_obj_t *views;
@@ -537,12 +552,12 @@ main(int argc, char **argv) {
isc_mem_t *mctx = NULL;
isc_result_t result;
int exit_status = 0;
isc_boolean_t load_zones = ISC_FALSE;
isc_boolean_t list_zones = ISC_FALSE;
isc_boolean_t print = ISC_FALSE;
bool load_zones = false;
bool list_zones = false;
bool print = false;
unsigned int flags = 0;
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
/*
* Process memory debugging argument first.
@@ -566,7 +581,7 @@ main(int argc, char **argv) {
break;
}
}
isc_commandline_reset = ISC_TRUE;
isc_commandline_reset = true;
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
@@ -577,11 +592,11 @@ main(int argc, char **argv) {
break;
case 'j':
nomerge = ISC_FALSE;
nomerge = false;
break;
case 'l':
list_zones = ISC_TRUE;
list_zones = true;
break;
case 'm':
@@ -597,7 +612,7 @@ main(int argc, char **argv) {
break;
case 'p':
print = ISC_TRUE;
print = true;
break;
case 'v':
@@ -609,10 +624,10 @@ main(int argc, char **argv) {
break;
case 'z':
load_zones = ISC_TRUE;
docheckmx = ISC_FALSE;
docheckns = ISC_FALSE;
dochecksrv = ISC_FALSE;
load_zones = true;
docheckmx = false;
docheckns = false;
dochecksrv = false;
break;
case '?':
+30 -26
View File
@@ -14,7 +14,9 @@
#include <config.h>
#include <stdbool.h>
#include <stdlib.h>
#include <inttypes.h>
#include <isc/app.h>
#include <isc/commandline.h>
@@ -106,10 +108,10 @@ main(int argc, char **argv) {
dns_masterformat_t inputformat = dns_masterformat_text;
dns_masterformat_t outputformat = dns_masterformat_text;
dns_masterrawheader_t header;
isc_uint32_t rawversion = 1, serialnum = 0;
uint32_t rawversion = 1, serialnum = 0;
dns_ttl_t maxttl = 0;
isc_boolean_t snset = ISC_FALSE;
isc_boolean_t logdump = ISC_FALSE;
bool snset = false;
bool logdump = false;
FILE *errout = stdout;
char *endp;
@@ -137,12 +139,14 @@ main(int argc, char **argv) {
#define PROGCMP(X) \
(strcasecmp(prog_name, X) == 0 || strcasecmp(prog_name, X ".exe") == 0)
if (PROGCMP("named-checkzone"))
if (PROGCMP("named-checkzone")) {
progmode = progmode_check;
else if (PROGCMP("named-compilezone"))
} else if (PROGCMP("named-compilezone")) {
progmode = progmode_compile;
else
} else {
INSIST(0);
ISC_UNREACHABLE();
}
/* Compilation specific defaults */
if (progmode == progmode_compile) {
@@ -159,7 +163,7 @@ main(int argc, char **argv) {
#define ARGCMP(X) (strcmp(isc_commandline_argument, X) == 0)
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
while ((c = isc_commandline_parse(argc, argv,
"c:df:hi:jJ:k:L:l:m:n:qr:s:t:o:vw:DF:M:S:T:W:"))
@@ -177,33 +181,33 @@ main(int argc, char **argv) {
if (ARGCMP("full")) {
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY |
DNS_ZONEOPT_CHECKSIBLING;
docheckmx = ISC_TRUE;
docheckns = ISC_TRUE;
dochecksrv = ISC_TRUE;
docheckmx = true;
docheckns = true;
dochecksrv = true;
} else if (ARGCMP("full-sibling")) {
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
zone_options &= ~DNS_ZONEOPT_CHECKSIBLING;
docheckmx = ISC_TRUE;
docheckns = ISC_TRUE;
dochecksrv = ISC_TRUE;
docheckmx = true;
docheckns = true;
dochecksrv = true;
} else if (ARGCMP("local")) {
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
zone_options |= DNS_ZONEOPT_CHECKSIBLING;
docheckmx = ISC_FALSE;
docheckns = ISC_FALSE;
dochecksrv = ISC_FALSE;
docheckmx = false;
docheckns = false;
dochecksrv = false;
} else if (ARGCMP("local-sibling")) {
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
zone_options &= ~DNS_ZONEOPT_CHECKSIBLING;
docheckmx = ISC_FALSE;
docheckns = ISC_FALSE;
dochecksrv = ISC_FALSE;
docheckmx = false;
docheckns = false;
dochecksrv = false;
} else if (ARGCMP("none")) {
zone_options &= ~DNS_ZONEOPT_CHECKINTEGRITY;
zone_options &= ~DNS_ZONEOPT_CHECKSIBLING;
docheckmx = ISC_FALSE;
docheckns = ISC_FALSE;
dochecksrv = ISC_FALSE;
docheckmx = false;
docheckns = false;
dochecksrv = false;
} else {
fprintf(stderr, "invalid argument to -i: %s\n",
isc_commandline_argument);
@@ -220,12 +224,12 @@ main(int argc, char **argv) {
break;
case 'j':
nomerge = ISC_FALSE;
nomerge = false;
break;
case 'J':
journal = isc_commandline_argument;
nomerge = ISC_FALSE;
nomerge = false;
break;
case 'k':
@@ -246,7 +250,7 @@ main(int argc, char **argv) {
break;
case 'L':
snset = ISC_TRUE;
snset = true;
endp = NULL;
serialnum = strtol(isc_commandline_argument, &endp, 0);
if (*endp != '\0') {
@@ -505,7 +509,7 @@ main(int argc, char **argv) {
strcmp(output_filename, "/dev/fd/1") == 0 ||
strcmp(output_filename, "/dev/stdout") == 0)) {
errout = stderr;
logdump = ISC_FALSE;
logdump = false;
}
if (isc_commandline_index + 2 != argc)
+2 -2
View File
@@ -70,7 +70,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
@@ -99,7 +99,7 @@
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
+2 -2
View File
@@ -70,7 +70,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
@@ -105,7 +105,7 @@ copy /Y named-checkzone.ilk named-compilezone.ilk
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
<PostBuildEvent>
+13 -11
View File
@@ -19,15 +19,15 @@
#include <config.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/assertions.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
#include <isc/file.h>
#include <isc/keyboard.h>
#include <isc/mem.h>
#include <isc/net.h>
#include <isc/print.h>
@@ -56,7 +56,7 @@
static char program[256];
const char *progname;
static enum { progmode_keygen, progmode_confgen} progmode;
isc_boolean_t verbose = ISC_FALSE; /* needed by util.c but not used here */
bool verbose = false; /* needed by util.c but not used here */
ISC_PLATFORM_NORETURN_PRE static void
usage(int status) ISC_PLATFORM_NORETURN_POST;
@@ -87,8 +87,8 @@ Usage:\n\
int
main(int argc, char **argv) {
isc_result_t result = ISC_R_SUCCESS;
isc_boolean_t show_final_mem = ISC_FALSE;
isc_boolean_t quiet = ISC_FALSE;
bool show_final_mem = false;
bool quiet = false;
isc_buffer_t key_txtbuffer;
char key_txtsecret[256];
isc_mem_t *mctx = NULL;
@@ -124,13 +124,15 @@ main(int argc, char **argv) {
if (PROGCMP("tsig-keygen")) {
progmode = progmode_keygen;
quiet = ISC_TRUE;
} else if (PROGCMP("ddns-confgen"))
quiet = true;
} else if (PROGCMP("ddns-confgen")) {
progmode = progmode_confgen;
else
} else {
INSIST(0);
ISC_UNREACHABLE();
}
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv,
"a:hk:Mmr:qs:y:z:")) != -1) {
@@ -155,11 +157,11 @@ main(int argc, char **argv) {
isc_mem_debugging = ISC_MEM_DEBUGTRACE;
break;
case 'm':
show_final_mem = ISC_TRUE;
show_final_mem = true;
break;
case 'q':
if (progmode == progmode_confgen)
quiet = ISC_TRUE;
quiet = true;
else
usage(1);
break;
-2
View File
@@ -20,7 +20,6 @@
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/file.h>
#include <isc/keyboard.h>
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/result.h>
@@ -192,4 +191,3 @@ write_key_file(const char *keyfile, const char *user,
fatal("fclose(%s) failed\n", keyfile);
fprintf(stderr, "wrote key file \"%s\"\n", keyfile);
}
+9 -9
View File
@@ -22,15 +22,15 @@
#include <config.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/assertions.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
#include <isc/file.h>
#include <isc/keyboard.h>
#include <isc/mem.h>
#include <isc/net.h>
#include <isc/print.h>
@@ -57,7 +57,7 @@
static char program[256];
const char *progname;
isc_boolean_t verbose = ISC_FALSE;
bool verbose = false;
const char *keyfile, *keydef;
@@ -87,7 +87,7 @@ Usage:\n\
int
main(int argc, char **argv) {
isc_boolean_t show_final_mem = ISC_FALSE;
bool show_final_mem = false;
isc_buffer_t key_txtbuffer;
char key_txtsecret[256];
isc_mem_t *mctx = NULL;
@@ -104,7 +104,7 @@ main(int argc, char **argv) {
struct in6_addr addr6_dummy;
char *chrootdir = NULL;
char *user = NULL;
isc_boolean_t keyonly = ISC_FALSE;
bool keyonly = false;
int len;
keydef = keyfile = RNDC_KEYFILE;
@@ -119,14 +119,14 @@ main(int argc, char **argv) {
serveraddr = DEFAULT_SERVER;
port = DEFAULT_PORT;
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv,
"aA:b:c:hk:Mmp:r:s:t:u:Vy")) != -1)
{
switch (ch) {
case 'a':
keyonly = ISC_TRUE;
keyonly = true;
break;
case 'A':
algname = isc_commandline_argument;
@@ -153,7 +153,7 @@ main(int argc, char **argv) {
break;
case 'm':
show_final_mem = ISC_TRUE;
show_final_mem = true;
break;
case 'p':
port = strtol(isc_commandline_argument, &p, 10);
@@ -177,7 +177,7 @@ main(int argc, char **argv) {
user = isc_commandline_argument;
break;
case 'V':
verbose = ISC_TRUE;
verbose = true;
break;
case '?':
if (isc_commandline_option != '?') {
+2 -2
View File
@@ -15,15 +15,15 @@
#include <config.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <isc/boolean.h>
#include <isc/print.h>
#include "util.h"
extern isc_boolean_t verbose;
extern bool verbose;
extern const char *progname;
void
+2 -2
View File
@@ -70,7 +70,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
@@ -106,7 +106,7 @@ copy /Y ddns-confgen.ilk tsig-keygen.ilk
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
+2 -2
View File
@@ -70,7 +70,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
@@ -100,7 +100,7 @@
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+111 -76
View File
@@ -24,7 +24,9 @@
#include <netdb.h>
#endif
#include <stdbool.h>
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -94,40 +96,40 @@ static const char *port = "53";
static isc_sockaddr_t *srcaddr4 = NULL, *srcaddr6 = NULL;
static isc_sockaddr_t a4, a6;
static char *curqname = NULL, *qname = NULL;
static isc_boolean_t classset = ISC_FALSE;
static bool classset = false;
static dns_rdatatype_t qtype = dns_rdatatype_none;
static isc_boolean_t typeset = ISC_FALSE;
static bool typeset = false;
static unsigned int styleflags = 0;
static isc_uint32_t splitwidth = 0xffffffff;
static isc_boolean_t
showcomments = ISC_TRUE,
showdnssec = ISC_TRUE,
showtrust = ISC_TRUE,
rrcomments = ISC_TRUE,
noclass = ISC_FALSE,
nocrypto = ISC_FALSE,
nottl = ISC_FALSE,
multiline = ISC_FALSE,
short_form = ISC_FALSE,
print_unknown_format = ISC_FALSE;
static uint32_t splitwidth = 0xffffffff;
static bool
showcomments = true,
showdnssec = true,
showtrust = true,
rrcomments = true,
noclass = false,
nocrypto = false,
nottl = false,
multiline = false,
short_form = false,
print_unknown_format = false;
static isc_boolean_t
resolve_trace = ISC_FALSE,
validator_trace = ISC_FALSE,
message_trace = ISC_FALSE;
static bool
resolve_trace = false,
validator_trace = false,
message_trace = false;
static isc_boolean_t
use_ipv4 = ISC_TRUE,
use_ipv6 = ISC_TRUE;
static bool
use_ipv4 = true,
use_ipv6 = true;
static isc_boolean_t
cdflag = ISC_FALSE,
no_sigs = ISC_FALSE,
root_validation = ISC_TRUE,
dlv_validation = ISC_TRUE;
static bool
cdflag = false,
no_sigs = false,
root_validation = true,
dlv_validation = true;
static isc_boolean_t use_tcp = ISC_FALSE;
static bool use_tcp = false;
static char *anchorfile = NULL;
static char *trust_anchor = NULL;
@@ -144,10 +146,10 @@ static char anchortext[] = MANAGED_KEYS;
* Static function prototypes
*/
static isc_result_t
get_reverse(char *reverse, size_t len, char *value, isc_boolean_t strict);
get_reverse(char *reverse, size_t len, char *value, bool strict);
static isc_result_t
parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
parse_uint(uint32_t *uip, const char *value, uint32_t max,
const char *desc);
static void
@@ -408,7 +410,7 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
{
isc_result_t result = ISC_R_SUCCESS;
static dns_trust_t trust;
static isc_boolean_t first = ISC_TRUE;
static bool first = true;
isc_buffer_t target;
isc_region_t r;
char *t = NULL;
@@ -430,7 +432,7 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
putchar('\n');
print_status(rdataset);
trust = rdataset->trust;
first = ISC_FALSE;
first = false;
}
do {
@@ -566,7 +568,7 @@ convert_name(dns_fixedname_t *fn, dns_name_t **name, const char *text) {
static isc_result_t
key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
dns_rdata_dnskey_t keystruct;
isc_uint32_t flags, proto, alg;
uint32_t flags, proto, alg;
const char *keystr, *keynamestr;
unsigned char keydata[4096];
isc_buffer_t keydatabuf;
@@ -576,7 +578,7 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
dns_fixedname_t fkeyname;
dns_name_t *keyname;
isc_result_t result;
isc_boolean_t match_root = ISC_FALSE, match_dlv = ISC_FALSE;
bool match_root = false, match_dlv = false;
keynamestr = cfg_obj_asstring(cfg_tuple_get(key, "name"));
CHECK(convert_name(&fkeyname, &keyname, keynamestr));
@@ -621,9 +623,9 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
if (alg > 0xff)
CHECK(ISC_R_RANGE);
keystruct.flags = (isc_uint16_t)flags;
keystruct.protocol = (isc_uint8_t)proto;
keystruct.algorithm = (isc_uint8_t)alg;
keystruct.flags = (uint16_t)flags;
keystruct.protocol = (uint8_t)proto;
keystruct.algorithm = (uint8_t)alg;
isc_buffer_init(&keydatabuf, keydata, sizeof(keydata));
isc_buffer_init(&rrdatabuf, rrdata, sizeof(rrdata));
@@ -763,7 +765,14 @@ setup_dnsseckeys(dns_client_t *client) {
if (dlv_validation)
dns_client_setdlv(client, dns_rdataclass_in, dlv_anchor);
cleanup:
if (bindkeys != NULL) {
cfg_obj_destroy(parser, &bindkeys);
}
if (parser != NULL) {
cfg_parser_destroy(&parser);
}
if (result != ISC_R_SUCCESS)
delv_log(ISC_LOG_ERROR, "setup_dnsseckeys: %s",
isc_result_totext(result));
@@ -778,7 +787,7 @@ addserver(dns_client_t *client) {
struct in6_addr in6;
isc_sockaddr_t *sa;
isc_sockaddrlist_t servers;
isc_uint32_t destport;
uint32_t destport;
isc_result_t result;
dns_name_t *name = NULL;
@@ -869,7 +878,7 @@ findserver(dns_client_t *client) {
irs_resconf_t *resconf = NULL;
isc_sockaddrlist_t *nameservers;
isc_sockaddr_t *sa, *next;
isc_uint32_t destport;
uint32_t destport;
result = parse_uint(&destport, port, 0xffff, "port");
if (result != ISC_R_SUCCESS)
@@ -944,9 +953,9 @@ cleanup:
}
static isc_result_t
parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
parse_uint(uint32_t *uip, const char *value, uint32_t max,
const char *desc) {
isc_uint32_t n;
uint32_t n;
isc_result_t result = isc_parse_uint32(&n, value, 10);
if (result == ISC_R_SUCCESS && n > max)
result = ISC_R_RANGE;
@@ -963,7 +972,7 @@ static void
plus_option(char *option) {
isc_result_t result;
char *cmd, *value, *last = NULL;
isc_boolean_t state = ISC_TRUE;
bool state = true;
INSIST(option != NULL);
@@ -974,7 +983,7 @@ plus_option(char *option) {
}
if (strncasecmp(cmd, "no", 2)==0) {
cmd += 2;
state = ISC_FALSE;
state = false;
}
value = strtok_r(NULL, "\0", &last);
@@ -1001,7 +1010,7 @@ plus_option(char *option) {
break;
case 'l': /* class */
FULLCHECK("class");
noclass = ISC_TF(!state);
noclass = !state;
break;
case 'o': /* comments */
FULLCHECK("comments");
@@ -1009,7 +1018,7 @@ plus_option(char *option) {
break;
case 'r': /* crypto */
FULLCHECK("crypto");
nocrypto = ISC_TF(!state);
nocrypto = !state;
break;
default:
goto invalid_option;
@@ -1082,10 +1091,10 @@ plus_option(char *option) {
FULLCHECK("short");
short_form = state;
if (short_form) {
multiline = ISC_FALSE;
showcomments = ISC_FALSE;
showtrust = ISC_FALSE;
showdnssec = ISC_FALSE;
multiline = false;
showcomments = false;
showtrust = false;
showdnssec = false;
}
break;
case 'p': /* split */
@@ -1137,7 +1146,7 @@ plus_option(char *option) {
break;
case 't': /* ttl */
FULLCHECK("ttl");
nottl = ISC_TF(!state);
nottl = !state;
break;
default:
goto invalid_option;
@@ -1165,11 +1174,13 @@ plus_option(char *option) {
* options: "46a:b:c:d:himp:q:t:vx:";
*/
static const char *single_dash_opts = "46himv";
static isc_boolean_t
dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
static const char *dash_opts = "46abcdhimpqtvx";
static bool
dash_option(char *option, char *next, bool *open_type_class) {
char opt, *value;
isc_result_t result;
isc_boolean_t value_from_next;
bool value_from_next;
isc_textregion_t tr;
dns_rdatatype_t rdtype;
dns_rdataclass_t rdclass;
@@ -1177,7 +1188,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
struct in_addr in4;
struct in6_addr in6;
in_port_t srcport;
isc_uint32_t num;
uint32_t num;
char *hash;
while (strpbrk(option, single_dash_opts) == &option[0]) {
@@ -1193,7 +1204,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
fatal("IPv4 networking not available");
if (use_ipv6) {
isc_net_disableipv6();
use_ipv6 = ISC_FALSE;
use_ipv6 = false;
}
break;
case '6':
@@ -1201,7 +1212,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
fatal("IPv6 networking not available");
if (use_ipv4) {
isc_net_disableipv4();
use_ipv4 = ISC_FALSE;
use_ipv4 = false;
}
break;
case 'h':
@@ -1209,9 +1220,9 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
exit(0);
/* NOTREACHED */
case 'i':
no_sigs = ISC_TRUE;
dlv_validation = ISC_FALSE;
root_validation = ISC_FALSE;
no_sigs = true;
dlv_validation = false;
root_validation = false;
break;
case 'm':
/* handled in preparse_args() */
@@ -1222,18 +1233,19 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
/* NOTREACHED */
default:
INSIST(0);
ISC_UNREACHABLE();
}
if (strlen(option) > 1U)
option = &option[1];
else
return (ISC_FALSE);
return (false);
}
opt = option[0];
if (strlen(option) > 1U) {
value_from_next = ISC_FALSE;
value_from_next = false;
value = &option[1];
} else {
value_from_next = ISC_TRUE;
value_from_next = true;
value = next;
}
if (value == NULL)
@@ -1279,13 +1291,13 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
if (classset)
warn("extra query class");
*open_type_class = ISC_FALSE;
*open_type_class = false;
tr.base = value;
tr.length = strlen(value);
result = dns_rdataclass_fromtext(&rdclass,
(isc_textregion_t *)&tr);
if (result == ISC_R_SUCCESS)
classset = ISC_TRUE;
classset = true;
else if (rdclass != dns_rdataclass_in)
warn("ignoring non-IN query class");
else
@@ -1310,7 +1322,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
fatal("out of memory");
return (value_from_next);
case 't':
*open_type_class = ISC_FALSE;
*open_type_class = false;
tr.base = value;
tr.length = strlen(value);
result = dns_rdatatype_fromtext(&rdtype,
@@ -1322,13 +1334,13 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
rdtype == dns_rdatatype_axfr)
fatal("Transfer not supported");
qtype = rdtype;
typeset = ISC_TRUE;
typeset = true;
} else
warn("ignoring invalid type");
return (value_from_next);
case 'x':
result = get_reverse(textname, sizeof(textname), value,
ISC_FALSE);
false);
if (result == ISC_R_SUCCESS) {
if (curqname != NULL) {
isc_mem_free(mctx, curqname);
@@ -1340,7 +1352,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
if (typeset)
warn("extra query type");
qtype = dns_rdatatype_ptr;
typeset = ISC_TRUE;
typeset = true;
} else {
fprintf(stderr, "Invalid IP address %s\n", value);
exit(1);
@@ -1352,7 +1364,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
usage();
}
/* NOTREACHED */
return (ISC_FALSE);
return (false);
}
/*
@@ -1361,12 +1373,14 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
*/
static void
preparse_args(int argc, char **argv) {
isc_boolean_t ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
bool ipv4only = false, ipv6only = false;
char *option;
for (argc--, argv++; argc > 0; argc--, argv++) {
if (argv[0][0] != '-')
if (argv[0][0] != '-') {
continue;
}
option = &argv[0][1];
while (strpbrk(option, single_dash_opts) == &option[0]) {
switch (option[0]) {
@@ -1378,17 +1392,38 @@ preparse_args(int argc, char **argv) {
if (ipv6only) {
fatal("only one of -4 and -6 allowed");
}
ipv4only = ISC_TRUE;
ipv4only = true;
break;
case '6':
if (ipv4only) {
fatal("only one of -4 and -6 allowed");
}
ipv6only = ISC_TRUE;
ipv6only = true;
break;
}
option = &option[1];
}
if (strlen(option) == 0U) {
continue;
}
/* Look for dash value option. */
if (strpbrk(option, dash_opts) != &option[0] ||
strlen(option) > 1U)
{
/* Error or value in option. */
continue;
}
/* Dash value is next argument so we need to skip it. */
argc--;
argv++;
/* Handle missing argument */
if (argc == 0) {
break;
}
}
}
@@ -1404,7 +1439,7 @@ parse_args(int argc, char **argv) {
isc_textregion_t tr;
dns_rdatatype_t rdtype;
dns_rdataclass_t rdclass;
isc_boolean_t open_type_class = ISC_TRUE;
bool open_type_class = true;
for (; argc > 0; argc--, argv++) {
if (argv[0][0] == '@') {
@@ -1443,7 +1478,7 @@ parse_args(int argc, char **argv) {
rdtype == dns_rdatatype_axfr)
fatal("Transfer not supported");
qtype = rdtype;
typeset = ISC_TRUE;
typeset = true;
continue;
}
result = dns_rdataclass_fromtext(&rdclass,
@@ -1512,7 +1547,7 @@ reverse_octets(const char *in, char **p, char *end) {
}
static isc_result_t
get_reverse(char *reverse, size_t len, char *value, isc_boolean_t strict) {
get_reverse(char *reverse, size_t len, char *value, bool strict) {
int r;
isc_result_t result;
isc_netaddr_t addr;
@@ -1588,7 +1623,7 @@ main(int argc, char *argv[]) {
fatal("failed to create mctx");
CHECK(isc_appctx_create(mctx, &actx));
CHECK(isc_taskmgr_createinctx(mctx, actx, 1, 0, &taskmgr));
CHECK(isc_taskmgr_createinctx(mctx, actx, 1, &taskmgr));
CHECK(isc_socketmgr_createinctx(mctx, actx, &socketmgr));
CHECK(isc_timermgr_createinctx(mctx, actx, &timermgr));
+2 -2
View File
@@ -68,7 +68,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libisc.lib;libdns.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;libdns.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
@@ -98,7 +98,7 @@
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libisc.lib;libdns.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;libdns.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+3 -3
View File
@@ -101,12 +101,12 @@ install:: dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@ installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
nslookup@EXEEXT@ ${DESTDIR}${bindir}
for m in ${MANPAGES}; do \
${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man1; \
done
${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man1 || exit 1; \
done
uninstall::
for m in ${MANPAGES}; do \
rm -f ${DESTDIR}${mandir}/man1/$$m ; \
rm -f ${DESTDIR}${mandir}/man1/$$m || exit 1; \
done
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${bindir}/nslookup@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${bindir}/host@EXEEXT@
+20 -12
View File
@@ -74,7 +74,9 @@ will perform an NS query for "\&." (the root)\&.
It is possible to set per\-user defaults for
\fBdig\fR
via
${HOME}/\&.digrc\&. This file is read and any options in it are applied before the command line arguments\&.
${HOME}/\&.digrc\&. This file is read and any options in it are applied before the command line arguments\&. The
\fB\-r\fR
option disables this feature, for scripts that need predictable behaviour\&.
.PP
The IN and CH class names overlap with the IN and CH top level domain names\&. Either use the
\fB\-t\fR
@@ -174,11 +176,6 @@ reads a list of lookup requests to process from the given
using the command\-line interface\&.
.RE
.PP
\-i
.RS 4
Do reverse IPv6 lookups using the obsolete RFC 1886 IP6\&.INT domain, which is no longer in use\&. Obsolete bit string label queries (RFC 2874) are not attempted\&.
.RE
.PP
\-k \fIkeyfile\fR
.RS 4
Sign queries using TSIG using a key read from the given file\&. Key files can be generated using
@@ -208,6 +205,12 @@ The domain name to query\&. This is useful to distinguish the
from other arguments\&.
.RE
.PP
\-r
.RS 4
Do not read options from
${HOME}/\&.digrc\&. This is useful for scripts that need predictable behaviour\&.
.RE
.PP
\-t \fItype\fR
.RS 4
The resource record type to query\&. It can be any valid query type\&. If it is a resource record type supported in BIND 9, it can be given by the type mnemonic (such as "NS" or "AAAA")\&. The default query type is "A", unless the
@@ -246,9 +249,7 @@ arguments\&.
\fBdig\fR
automatically performs a lookup for a name like
94\&.2\&.0\&.192\&.in\-addr\&.arpa
and sets the query type and class to PTR and IN respectively\&. IPv6 addresses are looked up using nibble format under the IP6\&.ARPA domain (but see also the
\fB\-i\fR
option)\&.
and sets the query type and class to PTR and IN respectively\&. IPv6 addresses are looked up using nibble format under the IP6\&.ARPA domain\&.
.RE
.PP
\-y \fI[hmac:]\fR\fIkeyname:secret\fR
@@ -468,12 +469,16 @@ option is enabled\&. If short form answers are requested, the default is not to
.PP
\fB+[no]idnin\fR
.RS 4
Process [do not process] IDN domain names on input\&. This requires IDN SUPPORT to have been enabled at compile time\&. The default is to process IDN input\&.
Process [do not process] IDN domain names on input\&. This requires IDN SUPPORT to have been enabled at compile time\&.
.sp
The default is to process IDN input when standard output is a tty\&. The IDN processing on input is disabled when dig output is redirected to files, pipes, and other non\-tty file descriptors\&.
.RE
.PP
\fB+[no]idnout\fR
.RS 4
Convert [do not convert] puny code on output\&. This requires IDN SUPPORT to have been enabled at compile time\&. The default is to convert output\&.
Convert [do not convert] puny code on output\&. This requires IDN SUPPORT to have been enabled at compile time\&.
.sp
The default is to process puny code on output when standard output is a tty\&. The puny code processing on output is disabled when dig output is redirected to files, pipes, and other non\-tty file descriptors\&.
.RE
.PP
\fB+[no]ignore\fR
@@ -795,7 +800,10 @@ has been built with IDN (internationalized domain name) support, it can accept a
appropriately converts character encoding of domain name before sending a request to DNS server or displaying a reply from the server\&. If you\*(Aqd like to turn off the IDN support for some reason, use parameters
\fI+noidnin\fR
and
\fI+noidnout\fR\&.
\fI+noidnout\fR
or define the
\fBIDN_DISABLE\fR
environment variable\&.
.SH "FILES"
.PP
/etc/resolv\&.conf
+185 -149
View File
@@ -12,6 +12,9 @@
/*! \file */
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
@@ -61,10 +64,10 @@ static int addresscount = 0;
static char domainopt[DNS_NAME_MAXTEXT];
static char hexcookie[81];
static isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE,
ip6_int = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE,
ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
static isc_uint32_t splitwidth = 0xffffffff;
static bool short_form = false, printcmd = true,
plusquest = false, pluscomm = false,
ipv4only = false, ipv6only = false, digrc = true;
static uint32_t splitwidth = 0xffffffff;
/*% opcode text */
static const char * const opcodetext[] = {
@@ -150,11 +153,11 @@ help(void) {
" -b address[#port] (bind to source address/port)\n"
" -c class (specify query class)\n"
" -f filename (batch mode)\n"
" -i (use IP6.INT for IPv6 reverse lookups)\n"
" -k keyfile (specify tsig key file)\n"
" -m (enable memory usage debugging)\n"
" -p port (specify port number)\n"
" -q name (specify query name)\n"
" -r (do not read ~/.digrc)\n"
" -t type (specify query type)\n"
" -u (display times in usec instead of msec)\n"
" -x dot-notation (shortcut for reverse lookups)\n"
@@ -190,8 +193,10 @@ help(void) {
" +[no]fail (Don't try next server on SERVFAIL)\n"
" +[no]header-only (Send query without a question section)\n"
" +[no]identify (ID responders in short answers)\n"
" +[no]idnin (Parse IDN names)\n"
" +[no]idnout (Convert IDN response)\n"
#ifdef HAVE_LIBIDN2
" +[no]idnin (Parse IDN names [default=on on tty])\n"
" +[no]idnout (Convert IDN response [default=on on tty])\n"
#endif
" +[no]ignore (Don't revert to TCP for TC responses.)\n"
" +[no]keepalive (Request EDNS TCP keepalive)\n"
" +[no]keepopen (Keep the TCP socket open between queries)\n"
@@ -240,7 +245,7 @@ help(void) {
*/
static void
received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
isc_uint64_t diff;
uint64_t diff;
time_t tnow;
struct tm tmnow;
#ifdef WIN32
@@ -260,7 +265,7 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
printf(";; Query time: %ld msec\n", (long) diff / 1000);
printf(";; SERVER: %s(%s)\n", fromtext, query->servname);
time(&tnow);
#if defined(ISC_PLATFORM_USETHREADS) && !defined(WIN32)
#if !defined(WIN32)
(void)localtime_r(&tnow, &tmnow);
#else
tmnow = *localtime(&tnow);
@@ -281,7 +286,7 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
#endif
if (query->lookup->doing_xfr) {
printf(";; XFR size: %u records (messages %u, "
"bytes %" ISC_PRINT_QUADFORMAT "u)\n",
"bytes %" PRIu64 ")\n",
query->rr_count, query->msg_count,
query->byte_count);
} else {
@@ -299,18 +304,18 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
} else if (query->lookup->identify && !short_form) {
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
if (query->lookup->use_usec)
printf(";; Received %" ISC_PRINT_QUADFORMAT "u bytes "
printf(";; Received %" PRIu64 " bytes "
"from %s(%s) in %ld us\n\n",
query->lookup->doing_xfr
? query->byte_count
: (isc_uint64_t)bytes,
: (uint64_t)bytes,
fromtext, query->userarg, (long) diff);
else
printf(";; Received %" ISC_PRINT_QUADFORMAT "u bytes "
printf(";; Received %" PRIu64 " bytes "
"from %s(%s) in %ld ms\n\n",
query->lookup->doing_xfr
? query->byte_count
: (isc_uint64_t)bytes,
: (uint64_t)bytes,
fromtext, query->userarg, (long) diff / 1000);
}
}
@@ -332,7 +337,7 @@ trying(char *frm, dig_lookup_t *lookup) {
static isc_result_t
say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
isc_result_t result;
isc_uint64_t diff;
uint64_t diff;
char store[sizeof(" in 18446744073709551616 us.")];
unsigned int styleflags = 0;
@@ -360,10 +365,11 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
ADD_STRING(buf, " from server ");
ADD_STRING(buf, query->servname);
if (query->lookup->use_usec)
snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u us.", diff);
else
snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u ms.", diff / 1000);
if (query->lookup->use_usec) {
snprintf(store, sizeof(store), " in %" PRIu64 " us.", diff);
} else {
snprintf(store, sizeof(store), " in %" PRIu64 " ms.", diff / 1000);
}
ADD_STRING(buf, store);
}
ADD_STRING(buf, "\n");
@@ -421,7 +427,7 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags,
return (ISC_R_SUCCESS);
}
static isc_boolean_t
static bool
isdotlocal(dns_message_t *msg) {
isc_result_t result;
static unsigned char local_ndata[] = { "\005local\0" };
@@ -436,16 +442,16 @@ isdotlocal(dns_message_t *msg) {
dns_name_t *name = NULL;
dns_message_currentname(msg, DNS_SECTION_QUESTION, &name);
if (dns_name_issubdomain(name, &local))
return (ISC_TRUE);
return (true);
}
return (ISC_FALSE);
return (false);
}
/*
* Callback from dighost.c to print the reply from a server
*/
static isc_result_t
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
isc_result_t result;
dns_messagetextflag_t flags;
isc_buffer_t *buf = NULL;
@@ -689,7 +695,7 @@ cleanup:
static void
printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
int i;
static isc_boolean_t first = ISC_TRUE;
static bool first = true;
char append[MXNAME];
if (printcmd) {
@@ -716,7 +722,7 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
";; global options:%s%s\n",
short_form ? " +short" : "",
printcmd ? " +cmd" : "");
first = ISC_FALSE;
first = false;
strlcat(lookup->cmdline, append,
sizeof(lookup->cmdline));
}
@@ -731,13 +737,13 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
*/
static void
plus_option(char *option, isc_boolean_t is_batchfile,
plus_option(char *option, bool is_batchfile,
dig_lookup_t *lookup)
{
isc_result_t result;
char *cmd, *value, *last = NULL, *code, *extra;
isc_uint32_t num;
isc_boolean_t state = ISC_TRUE;
uint32_t num;
bool state = true;
size_t n;
INSIST(option != NULL);
@@ -748,7 +754,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
}
if (strncasecmp(cmd, "no", 2)==0) {
cmd += 2;
state = ISC_FALSE;
state = false;
}
/* parse the rest of the string */
value = strtok_r(NULL, "", &last);
@@ -855,7 +861,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
case 'l': /* class */
/* keep +cl for backwards compatibility */
FULLCHECK2("cl", "class");
lookup->noclass = ISC_TF(!state);
lookup->noclass = !state;
break;
case 'm': /* cmd */
FULLCHECK("cmd");
@@ -891,7 +897,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
break;
case 'r':
FULLCHECK("crypto");
lookup->nocrypto = ISC_TF(!state);
lookup->nocrypto = !state;
break;
default:
goto invalid_option;
@@ -1004,7 +1010,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
code = NULL;
if (value != NULL) {
code = strtok_r(value,
":",
":",
&last);
}
if (code == NULL) {
@@ -1162,17 +1168,17 @@ plus_option(char *option, isc_boolean_t is_batchfile,
FULLCHECK("nssearch");
lookup->ns_search_only = state;
if (state) {
lookup->trace_root = ISC_TRUE;
lookup->recurse = ISC_TRUE;
lookup->identify = ISC_TRUE;
lookup->stats = ISC_FALSE;
lookup->comments = ISC_FALSE;
lookup->section_additional = ISC_FALSE;
lookup->section_authority = ISC_FALSE;
lookup->section_question = ISC_FALSE;
lookup->trace_root = true;
lookup->recurse = true;
lookup->identify = true;
lookup->stats = false;
lookup->comments = false;
lookup->section_additional = false;
lookup->section_authority = false;
lookup->section_question = false;
lookup->rdtype = dns_rdatatype_ns;
lookup->rdtypeset = ISC_TRUE;
short_form = ISC_TRUE;
lookup->rdtypeset = true;
short_form = true;
lookup->rrcomments = 0;
}
break;
@@ -1230,7 +1236,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
warn("Couldn't parse padding");
goto exit_or_usage;
}
lookup->padding = (isc_uint16_t)num;
lookup->padding = (uint16_t)num;
break;
case 'q':
switch (cmd[1]) {
@@ -1306,13 +1312,13 @@ plus_option(char *option, isc_boolean_t is_batchfile,
FULLCHECK("short");
short_form = state;
if (state) {
printcmd = ISC_FALSE;
lookup->section_additional = ISC_FALSE;
lookup->section_answer = ISC_TRUE;
lookup->section_authority = ISC_FALSE;
lookup->section_question = ISC_FALSE;
lookup->comments = ISC_FALSE;
lookup->stats = ISC_FALSE;
printcmd = false;
lookup->section_additional = false;
lookup->section_answer = true;
lookup->section_authority = false;
lookup->section_question = false;
lookup->comments = false;
lookup->stats = false;
lookup->rrcomments = -1;
}
break;
@@ -1406,7 +1412,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
FULLCHECK("tcp");
if (!is_batchfile) {
lookup->tcp_mode = state;
lookup->tcp_mode_set = ISC_TRUE;
lookup->tcp_mode_set = true;
}
break;
default:
@@ -1439,17 +1445,17 @@ plus_option(char *option, isc_boolean_t is_batchfile,
lookup->trace = state;
lookup->trace_root = state;
if (state) {
lookup->recurse = ISC_FALSE;
lookup->identify = ISC_TRUE;
lookup->comments = ISC_FALSE;
lookup->recurse = false;
lookup->identify = true;
lookup->comments = false;
lookup->rrcomments = 0;
lookup->stats = ISC_FALSE;
lookup->section_additional = ISC_FALSE;
lookup->section_authority = ISC_TRUE;
lookup->section_question = ISC_FALSE;
lookup->dnssec = ISC_TRUE;
lookup->sendcookie = ISC_TRUE;
usesearch = ISC_FALSE;
lookup->stats = false;
lookup->section_additional = false;
lookup->section_authority = true;
lookup->section_question = false;
lookup->dnssec = true;
lookup->sendcookie = true;
usesearch = false;
}
break;
case 'i': /* tries */
@@ -1483,12 +1489,12 @@ plus_option(char *option, isc_boolean_t is_batchfile,
case 0:
case 'i': /* ttlid */
FULLCHECK2("ttl", "ttlid");
lookup->nottl = ISC_TF(!state);
lookup->nottl = !state;
break;
case 'u': /* ttlunits */
FULLCHECK("ttlunits");
lookup->nottl = ISC_FALSE;
lookup->ttlunits = ISC_TF(state);
lookup->nottl = false;
lookup->ttlunits = state;
break;
default:
goto invalid_option;
@@ -1510,7 +1516,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
FULLCHECK("vc");
if (!is_batchfile) {
lookup->tcp_mode = state;
lookup->tcp_mode_set = ISC_TRUE;
lookup->tcp_mode_set = true;
}
break;
case 'z': /* zflag */
@@ -1536,19 +1542,19 @@ plus_option(char *option, isc_boolean_t is_batchfile,
}
/*%
* #ISC_TRUE returned if value was used
* #true returned if value was used
*/
static const char *single_dash_opts = "46dhimnuv";
static const char *dash_opts = "46bcdfhikmnptvyx";
static isc_boolean_t
static const char *single_dash_opts = "46dhimnruv";
static const char *dash_opts = "46bcdfhikmnpqrtvyx";
static bool
dash_option(char *option, char *next, dig_lookup_t **lookup,
isc_boolean_t *open_type_class, isc_boolean_t *need_clone,
isc_boolean_t config_only, int argc, char **argv,
isc_boolean_t *firstarg)
bool *open_type_class, bool *need_clone,
bool config_only, int argc, char **argv,
bool *firstarg)
{
char opt, *value, *ptr, *ptr2, *ptr3, *last;
isc_result_t result;
isc_boolean_t value_from_next;
bool value_from_next;
isc_textregion_t tr;
dns_rdatatype_t rdtype;
dns_rdataclass_t rdclass;
@@ -1557,7 +1563,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
struct in6_addr in6;
in_port_t srcport;
char *hash, *cmd;
isc_uint32_t num;
uint32_t num;
while (strpbrk(option, single_dash_opts) == &option[0]) {
/*
@@ -1570,21 +1576,21 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
case '4':
if (have_ipv4) {
isc_net_disableipv6();
have_ipv6 = ISC_FALSE;
have_ipv6 = false;
} else {
fatal("can't find IPv4 networking");
/* NOTREACHED */
return (ISC_FALSE);
return (false);
}
break;
case '6':
if (have_ipv6) {
isc_net_disableipv4();
have_ipv4 = ISC_FALSE;
have_ipv4 = false;
} else {
fatal("can't find IPv6 networking");
/* NOTREACHED */
return (ISC_FALSE);
return (false);
}
break;
case 'd':
@@ -1592,17 +1598,17 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
if (ptr != &option[1]) {
cmd = option;
FULLCHECK("debug");
debugging = ISC_TRUE;
return (ISC_FALSE);
debugging = true;
return (false);
} else
debugging = ISC_TRUE;
debugging = true;
break;
case 'h':
help();
exit(0);
break;
case 'i':
ip6_int = ISC_TRUE;
/* deprecated */
break;
case 'm': /* memdebug */
/* memdebug is handled in preparse_args() */
@@ -1610,8 +1616,12 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
case 'n':
/* deprecated */
break;
case 'r':
debug("digrc (late)");
digrc = false;
break;
case 'u':
(*lookup)->use_usec = ISC_TRUE;
(*lookup)->use_usec = true;
break;
case 'v':
version();
@@ -1621,14 +1631,14 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
if (strlen(option) > 1U)
option = &option[1];
else
return (ISC_FALSE);
return (false);
}
opt = option[0];
if (strlen(option) > 1U) {
value_from_next = ISC_FALSE;
value_from_next = false;
value = &option[1];
} else {
value_from_next = ISC_TRUE;
value_from_next = true;
value = next;
}
if (value == NULL)
@@ -1658,20 +1668,20 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
}
if (hash != NULL)
*hash = '#';
specified_source = ISC_TRUE;
specified_source = true;
return (value_from_next);
case 'c':
if ((*lookup)->rdclassset) {
fprintf(stderr, ";; Warning, extra class option\n");
}
*open_type_class = ISC_FALSE;
*open_type_class = false;
tr.base = value;
tr.length = (unsigned int) strlen(value);
result = dns_rdataclass_fromtext(&rdclass,
(isc_textregion_t *)&tr);
if (result == ISC_R_SUCCESS) {
(*lookup)->rdclass = rdclass;
(*lookup)->rdclassset = ISC_TRUE;
(*lookup)->rdclassset = true;
} else
fprintf(stderr, ";; Warning, ignoring "
"invalid class %s\n",
@@ -1693,23 +1703,23 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
if (!config_only) {
if (*need_clone)
(*lookup) = clone_lookup(default_lookup,
ISC_TRUE);
*need_clone = ISC_TRUE;
true);
*need_clone = true;
strlcpy((*lookup)->textname, value,
sizeof((*lookup)->textname));
(*lookup)->trace_root = ISC_TF((*lookup)->trace ||
(*lookup)->ns_search_only);
(*lookup)->new_search = ISC_TRUE;
(*lookup)->trace_root = ((*lookup)->trace ||
(*lookup)->ns_search_only);
(*lookup)->new_search = true;
if (*firstarg) {
printgreeting(argc, argv, *lookup);
*firstarg = ISC_FALSE;
*firstarg = false;
}
ISC_LIST_APPEND(lookup_list, (*lookup), link);
debug("looking up %s", (*lookup)->textname);
}
return (value_from_next);
case 't':
*open_type_class = ISC_FALSE;
*open_type_class = false;
if (strncasecmp(value, "ixfr=", 5) == 0) {
rdtype = dns_rdatatype_ixfr;
result = ISC_R_SUCCESS;
@@ -1729,9 +1739,9 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
"extra type option\n");
}
if (rdtype == dns_rdatatype_ixfr) {
isc_uint32_t serial;
uint32_t serial;
(*lookup)->rdtype = dns_rdatatype_ixfr;
(*lookup)->rdtypeset = ISC_TRUE;
(*lookup)->rdtypeset = true;
result = parse_uint(&serial, &value[5],
MAXSERIAL, "serial number");
if (result != ISC_R_SUCCESS)
@@ -1740,19 +1750,19 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
(*lookup)->section_question = plusquest;
(*lookup)->comments = pluscomm;
if (!(*lookup)->tcp_mode_set)
(*lookup)->tcp_mode = ISC_TRUE;
(*lookup)->tcp_mode = true;
} else {
(*lookup)->rdtype = rdtype;
if (!config_only)
(*lookup)->rdtypeset = ISC_TRUE;
(*lookup)->rdtypeset = true;
if (rdtype == dns_rdatatype_axfr) {
(*lookup)->section_question = plusquest;
(*lookup)->comments = pluscomm;
} else if (rdtype == dns_rdatatype_any) {
if (!(*lookup)->tcp_mode_set)
(*lookup)->tcp_mode = ISC_TRUE;
(*lookup)->tcp_mode = true;
}
(*lookup)->ixfr_serial = ISC_FALSE;
(*lookup)->ixfr_serial = false;
}
} else
fprintf(stderr, ";; Warning, ignoring "
@@ -1780,24 +1790,23 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
return (value_from_next);
case 'x':
if (*need_clone)
*lookup = clone_lookup(default_lookup, ISC_TRUE);
*need_clone = ISC_TRUE;
*lookup = clone_lookup(default_lookup, true);
*need_clone = true;
if (get_reverse(textname, sizeof(textname), value,
ip6_int, ISC_FALSE) == ISC_R_SUCCESS) {
false) == ISC_R_SUCCESS) {
strlcpy((*lookup)->textname, textname,
sizeof((*lookup)->textname));
debug("looking up %s", (*lookup)->textname);
(*lookup)->trace_root = ISC_TF((*lookup)->trace ||
(*lookup)->ns_search_only);
(*lookup)->ip6_int = ip6_int;
(*lookup)->trace_root = ((*lookup)->trace ||
(*lookup)->ns_search_only);
if (!(*lookup)->rdtypeset)
(*lookup)->rdtype = dns_rdatatype_ptr;
if (!(*lookup)->rdclassset)
(*lookup)->rdclass = dns_rdataclass_in;
(*lookup)->new_search = ISC_TRUE;
(*lookup)->new_search = true;
if (*firstarg) {
printgreeting(argc, argv, *lookup);
*firstarg = ISC_FALSE;
*firstarg = false;
}
ISC_LIST_APPEND(lookup_list, *lookup, link);
} else {
@@ -1811,7 +1820,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
usage();
}
/* NOTREACHED */
return (ISC_FALSE);
return (false);
}
/*%
@@ -1837,24 +1846,50 @@ preparse_args(int argc, char **argv) {
option = &rv[0][1];
while (strpbrk(option, single_dash_opts) == &option[0]) {
switch (option[0]) {
case 'd':
/* For debugging early startup */
debugging = true;
break;
case 'm':
memdebugging = ISC_TRUE;
memdebugging = true;
isc_mem_debugging = ISC_MEM_DEBUGTRACE |
ISC_MEM_DEBUGRECORD;
break;
case 'r':
/*
* Must be done early, because ~/.digrc
* is read before command line parsing
*/
debug("digrc (early)");
digrc = false;
break;
case '4':
if (ipv6only)
fatal("only one of -4 and -6 allowed");
ipv4only = ISC_TRUE;
ipv4only = true;
break;
case '6':
if (ipv4only)
fatal("only one of -4 and -6 allowed");
ipv6only = ISC_TRUE;
ipv6only = true;
break;
}
option = &option[1];
}
if (strlen(option) == 0U) {
continue;
}
/* Look for dash value option. */
if (strpbrk(option, dash_opts) != &option[0] ||
strlen(option) > 1U) {
/* Error or value in option. */
continue;
}
/* Dash value is next argument so we need to skip it. */
rc--, rv++;
/* Handle missing argument */
if (rc == 0)
break;
}
}
@@ -1875,16 +1910,16 @@ split_batchline(char *batchline, char **bargv, int len, const char *msg) {
}
static void
parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
parse_args(bool is_batchfile, bool config_only,
int argc, char **argv)
{
isc_result_t result;
isc_textregion_t tr;
isc_boolean_t firstarg = ISC_TRUE;
bool firstarg = true;
dig_lookup_t *lookup = NULL;
dns_rdatatype_t rdtype;
dns_rdataclass_t rdclass;
isc_boolean_t open_type_class = ISC_TRUE;
bool open_type_class = true;
char batchline[MXNAME];
int bargc;
char *bargv[64];
@@ -1894,7 +1929,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
char *homedir;
char rcfile[PATH_MAX];
#endif
isc_boolean_t need_clone = ISC_TRUE;
bool need_clone = true;
/*
* The semantics for parsing the args is a bit complex; if
@@ -1911,9 +1946,9 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
if (!is_batchfile) {
debug("making new lookup");
default_lookup = make_empty_lookup();
default_lookup->adflag = ISC_TRUE;
default_lookup->adflag = true;
default_lookup->edns = 0;
default_lookup->sendcookie = ISC_TRUE;
default_lookup->sendcookie = true;
#ifndef NOPOSIX
/*
@@ -1921,8 +1956,9 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
*/
INSIST(batchfp == NULL);
homedir = getenv("HOME");
if (homedir != NULL) {
if (homedir != NULL && digrc) {
unsigned int n;
debug("digrc (open)");
n = snprintf(rcfile, sizeof(rcfile), "%s/.digrc",
homedir);
if (n < sizeof(rcfile)) {
@@ -1938,7 +1974,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
".digrc argv");
bargv[0] = argv[0];
argv0 = argv[0];
parse_args(ISC_TRUE, ISC_TRUE,
parse_args(true, true,
bargc, (char **)bargv);
}
fclose(batchfp);
@@ -1948,8 +1984,8 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
if (is_batchfile && !config_only) {
/* Processing '-f batchfile'. */
lookup = clone_lookup(default_lookup, ISC_TRUE);
need_clone = ISC_FALSE;
lookup = clone_lookup(default_lookup, true);
need_clone = false;
} else {
lookup = default_lookup;
}
@@ -2032,10 +2068,10 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
"extra type option\n");
}
if (rdtype == dns_rdatatype_ixfr) {
isc_uint32_t serial;
uint32_t serial;
lookup->rdtype =
dns_rdatatype_ixfr;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = true;
result = parse_uint(&serial,
&rv[0][5],
MAXSERIAL,
@@ -2048,10 +2084,10 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
plusquest;
lookup->comments = pluscomm;
if (!lookup->tcp_mode_set)
lookup->tcp_mode = ISC_TRUE;
lookup->tcp_mode = true;
} else {
lookup->rdtype = rdtype;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = true;
if (rdtype ==
dns_rdatatype_axfr) {
lookup->section_question =
@@ -2061,8 +2097,8 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
if (rdtype ==
dns_rdatatype_any &&
!lookup->tcp_mode_set)
lookup->tcp_mode = ISC_TRUE;
lookup->ixfr_serial = ISC_FALSE;
lookup->tcp_mode = true;
lookup->ixfr_serial = false;
}
continue;
}
@@ -2074,7 +2110,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
"extra class option\n");
}
lookup->rdclass = rdclass;
lookup->rdclassset = ISC_TRUE;
lookup->rdclassset = true;
continue;
}
}
@@ -2082,16 +2118,16 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
if (!config_only) {
if (need_clone)
lookup = clone_lookup(default_lookup,
ISC_TRUE);
need_clone = ISC_TRUE;
true);
need_clone = true;
strlcpy(lookup->textname, rv[0],
sizeof(lookup->textname));
lookup->trace_root = ISC_TF(lookup->trace ||
lookup->ns_search_only);
lookup->new_search = ISC_TRUE;
lookup->trace_root = (lookup->trace ||
lookup->ns_search_only);
lookup->new_search = true;
if (firstarg) {
printgreeting(argc, argv, lookup);
firstarg = ISC_FALSE;
firstarg = false;
}
ISC_LIST_APPEND(lookup_list, lookup, link);
debug("looking up %s", lookup->textname);
@@ -2127,7 +2163,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
"batch argv");
bargv[0] = argv[0];
argv0 = argv[0];
parse_args(ISC_TRUE, ISC_FALSE, bargc, (char **)bargv);
parse_args(true, false, bargc, (char **)bargv);
return;
}
return;
@@ -2137,17 +2173,17 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
*/
if ((lookup_list.head == NULL) && !config_only) {
if (need_clone)
lookup = clone_lookup(default_lookup, ISC_TRUE);
need_clone = ISC_TRUE;
lookup->trace_root = ISC_TF(lookup->trace ||
lookup->ns_search_only);
lookup->new_search = ISC_TRUE;
lookup = clone_lookup(default_lookup, true);
need_clone = true;
lookup->trace_root = (lookup->trace ||
lookup->ns_search_only);
lookup->new_search = true;
strlcpy(lookup->textname, ".", sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_ns;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = true;
if (firstarg) {
printgreeting(argc, argv, lookup);
firstarg = ISC_FALSE;
firstarg = false;
}
ISC_LIST_APPEND(lookup_list, lookup, link);
}
@@ -2184,7 +2220,7 @@ query_finished(void) {
debug("batch line %s", batchline);
bargc = split_batchline(batchline, bargv, 14, "batch argv");
bargv[0] = argv0;
parse_args(ISC_TRUE, ISC_FALSE, bargc, (char **)bargv);
parse_args(true, false, bargc, (char **)bargv);
start_lookup();
} else {
batchname = NULL;
@@ -2221,7 +2257,7 @@ void dig_setup(int argc, char **argv)
setup_system(ipv4only, ipv6only);
}
void dig_query_setup(isc_boolean_t is_batchfile, isc_boolean_t config_only,
void dig_query_setup(bool is_batchfile, bool config_only,
int argc, char **argv)
{
debug("dig_query_setup");
@@ -2233,7 +2269,7 @@ void dig_query_setup(isc_boolean_t is_batchfile, isc_boolean_t config_only,
setup_text_key();
if (domainopt[0] != '\0') {
set_search_domain(domainopt);
usesearch = ISC_TRUE;
usesearch = true;
}
}
@@ -2270,7 +2306,7 @@ int
main(int argc, char **argv) {
dig_setup(argc, argv);
dig_query_setup(ISC_FALSE, ISC_FALSE, argc, argv);
dig_query_setup(false, false, argc, argv);
dig_startup();
dig_shutdown();
+32 -19
View File
@@ -131,9 +131,10 @@
<para>
It is possible to set per-user defaults for <command>dig</command> via
<filename>${HOME}/.digrc</filename>. This file is read and
any options in it
are applied before the command line arguments.
<filename>${HOME}/.digrc</filename>. This file is read and any
options in it are applied before the command line arguments.
The <option>-r</option> option disables this feature, for
scripts that need predictable behaviour.
</para>
<para>
@@ -271,17 +272,6 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-i</term>
<listitem>
<para>
Do reverse IPv6 lookups using the obsolete RFC 1886 IP6.INT
domain, which is no longer in use. Obsolete bit string
label queries (RFC 2874) are not attempted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-k <replaceable class="parameter">keyfile</replaceable></term>
<listitem>
@@ -334,6 +324,16 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-r</term>
<listitem>
<para>
Do not read options from <filename>${HOME}/.digrc</filename>.
This is useful for scripts that need predictable behaviour.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-t <replaceable class="parameter">type</replaceable></term>
<listitem>
@@ -394,8 +394,7 @@
<literal>94.2.0.192.in-addr.arpa</literal> and sets the
query type and class to PTR and IN respectively. IPv6
addresses are looked up using nibble format under the
IP6.ARPA domain (but see also the <option>-i</option>
option).
IP6.ARPA domain.
</para>
</listitem>
</varlistentry>
@@ -789,7 +788,13 @@
<para>
Process [do not process] IDN domain names on input.
This requires IDN SUPPORT to have been enabled at
compile time. The default is to process IDN input.
compile time.
</para>
<para>
The default is to process IDN input when standard output
is a tty. The IDN processing on input is disabled when
dig output is redirected to files, pipes, and other
non-tty file descriptors.
</para>
</listitem>
</varlistentry>
@@ -800,7 +805,13 @@
<para>
Convert [do not convert] puny code on output.
This requires IDN SUPPORT to have been enabled at
compile time. The default is to convert output.
compile time.
</para>
<para>
The default is to process puny code on output when
standard output is a tty. The puny code processing on
output is disabled when dig output is redirected to
files, pipes, and other non-tty file descriptors.
</para>
</listitem>
</varlistentry>
@@ -1330,7 +1341,9 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
reply from the server.
If you'd like to turn off the IDN support for some reason, use
parameters <parameter>+noidnin</parameter> and
<parameter>+noidnout</parameter>.
<parameter>+noidnout</parameter> or define
the <envar>IDN_DISABLE</envar> environment variable.
</para>
</refsection>
+29 -16
View File
@@ -106,9 +106,10 @@
<p>
It is possible to set per-user defaults for <span class="command"><strong>dig</strong></span> via
<code class="filename">${HOME}/.digrc</code>. This file is read and
any options in it
are applied before the command line arguments.
<code class="filename">${HOME}/.digrc</code>. This file is read and any
options in it are applied before the command line arguments.
The <code class="option">-r</code> option disables this feature, for
scripts that need predictable behaviour.
</p>
<p>
@@ -227,14 +228,6 @@
<span class="command"><strong>dig</strong></span> using the command-line interface.
</p>
</dd>
<dt><span class="term">-i</span></dt>
<dd>
<p>
Do reverse IPv6 lookups using the obsolete RFC 1886 IP6.INT
domain, which is no longer in use. Obsolete bit string
label queries (RFC 2874) are not attempted.
</p>
</dd>
<dt><span class="term">-k <em class="replaceable"><code>keyfile</code></em></span></dt>
<dd>
<p>
@@ -274,6 +267,13 @@
the <em class="parameter"><code>name</code></em> from other arguments.
</p>
</dd>
<dt><span class="term">-r</span></dt>
<dd>
<p>
Do not read options from <code class="filename">${HOME}/.digrc</code>.
This is useful for scripts that need predictable behaviour.
</p>
</dd>
<dt><span class="term">-t <em class="replaceable"><code>type</code></em></span></dt>
<dd>
<p>
@@ -324,8 +324,7 @@
<code class="literal">94.2.0.192.in-addr.arpa</code> and sets the
query type and class to PTR and IN respectively. IPv6
addresses are looked up using nibble format under the
IP6.ARPA domain (but see also the <code class="option">-i</code>
option).
IP6.ARPA domain.
</p>
</dd>
<dt><span class="term">-y <em class="replaceable"><code>[<span class="optional">hmac:</span>]keyname:secret</code></em></span></dt>
@@ -631,7 +630,13 @@
<p>
Process [do not process] IDN domain names on input.
This requires IDN SUPPORT to have been enabled at
compile time. The default is to process IDN input.
compile time.
</p>
<p>
The default is to process IDN input when standard output
is a tty. The IDN processing on input is disabled when
dig output is redirected to files, pipes, and other
non-tty file descriptors.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]idnout</code></span></dt>
@@ -639,7 +644,13 @@
<p>
Convert [do not convert] puny code on output.
This requires IDN SUPPORT to have been enabled at
compile time. The default is to convert output.
compile time.
</p>
<p>
The default is to process puny code on output when
standard output is a tty. The puny code processing on
output is disabled when dig output is redirected to
files, pipes, and other non-tty file descriptors.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]ignore</code></span></dt>
@@ -1061,7 +1072,9 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
reply from the server.
If you'd like to turn off the IDN support for some reason, use
parameters <em class="parameter"><code>+noidnin</code></em> and
<em class="parameter"><code>+noidnout</code></em>.
<em class="parameter"><code>+noidnout</code></em> or define
the <code class="envar">IDN_DISABLE</code> environment variable.
</p>
</div>
+383 -361
View File
File diff suppressed because it is too large Load Diff
+1 -6
View File
@@ -112,11 +112,6 @@ Print debugging traces\&. Equivalent to the
verbose option\&.
.RE
.PP
\-i
.RS 4
Obsolete\&. Use the IP6\&.INT domain for reverse lookups of IPv6 addresses as defined in RFC1886 and deprecated in RFC4159\&. The default is to use IP6\&.ARPA as specified in RFC3596\&.
.RE
.PP
\-l
.RS 4
List zone: The
@@ -257,7 +252,7 @@ If
\fBhost\fR
has been built with IDN (internationalized domain name) support, it can accept and display non\-ASCII domain names\&.
\fBhost\fR
appropriately converts character encoding of domain name before sending a request to DNS server or displaying a reply from the server\&. If you\*(Aqd like to turn off the IDN support for some reason, defines the
appropriately converts character encoding of domain name before sending a request to DNS server or displaying a reply from the server\&. If you\*(Aqd like to turn off the IDN support for some reason, define the
\fBIDN_DISABLE\fR
environment variable\&. The IDN support is disabled if the variable is set when
\fBhost\fR
+88 -87
View File
@@ -12,6 +12,9 @@
/*! \file */
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <limits.h>
@@ -26,7 +29,6 @@
#include <isc/string.h>
#include <isc/util.h>
#include <isc/task.h>
#include <isc/stdlib.h>
#include <dns/byaddr.h>
#include <dns/fixedname.h>
@@ -40,14 +42,14 @@
#include <dig/dig.h>
static isc_boolean_t short_form = ISC_TRUE, listed_server = ISC_FALSE;
static isc_boolean_t default_lookups = ISC_TRUE;
static bool short_form = true, listed_server = false;
static bool default_lookups = true;
static int seen_error = -1;
static isc_boolean_t list_addresses = ISC_TRUE;
static isc_boolean_t list_almost_all = ISC_FALSE;
static bool list_addresses = true;
static bool list_almost_all = false;
static dns_rdatatype_t list_type = dns_rdatatype_a;
static isc_boolean_t printed_server = ISC_FALSE;
static isc_boolean_t ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
static bool printed_server = false;
static bool ipv4only = false, ipv6only = false;
static const char *opcodetext[] = {
"QUERY",
@@ -141,7 +143,6 @@ show_usage(void) {
" -c specifies query class for non-IN data\n"
" -C compares SOA records on authoritative nameservers\n"
" -d is equivalent to -v\n"
" -i IP6.INT reverse lookups\n"
" -l lists all hosts in a domain, using AXFR\n"
" -m set memory debugging flag (trace|record|usage)\n"
" -N changes the number of dots allowed before root lookup is done\n"
@@ -224,7 +225,7 @@ say_message(dns_name_t *name, const char *msg, dns_rdata_t *rdata,
static isc_result_t
printsection(dns_message_t *msg, dns_section_t sectionid,
const char *section_name, isc_boolean_t headers,
const char *section_name, bool headers,
dig_query_t *query)
{
dns_name_t *name, *print_name;
@@ -235,13 +236,13 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
isc_region_t r;
dns_name_t empty_name;
char tbuf[4096];
isc_boolean_t first;
isc_boolean_t no_rdata;
bool first;
bool no_rdata;
if (sectionid == DNS_SECTION_QUESTION)
no_rdata = ISC_TRUE;
no_rdata = true;
else
no_rdata = ISC_FALSE;
no_rdata = false;
if (headers)
printf(";; %s SECTION:\n", section_name);
@@ -259,7 +260,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
dns_message_currentname(msg, sectionid, &name);
isc_buffer_init(&target, tbuf, sizeof(tbuf));
first = ISC_TRUE;
first = true;
print_name = name;
for (rdataset = ISC_LIST_HEAD(name->list);
@@ -283,7 +284,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
if (!short_form) {
result = dns_rdataset_totext(rdataset,
print_name,
ISC_FALSE,
false,
no_rdata,
&target);
if (result != ISC_R_SUCCESS)
@@ -291,7 +292,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
#ifdef USEINITALWS
if (first) {
print_name = &empty_name;
first = ISC_FALSE;
first = false;
}
#else
UNUSED(first); /* Shut up compiler. */
@@ -350,7 +351,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
static isc_result_t
printrdata(dns_message_t *msg, dns_rdataset_t *rdataset,
const dns_name_t *owner, const char *set_name,
isc_boolean_t headers)
bool headers)
{
isc_buffer_t target;
isc_result_t result;
@@ -363,7 +364,7 @@ printrdata(dns_message_t *msg, dns_rdataset_t *rdataset,
isc_buffer_init(&target, tbuf, sizeof(tbuf));
result = dns_rdataset_totext(rdataset, owner, ISC_FALSE, ISC_FALSE,
result = dns_rdataset_totext(rdataset, owner, false, false,
&target);
if (result != ISC_R_SUCCESS)
return (result);
@@ -400,8 +401,8 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
}
static isc_result_t
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
isc_boolean_t did_flag = ISC_FALSE;
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
bool did_flag = false;
dns_rdataset_t *opt, *tsig = NULL;
const dns_name_t *tsigname;
isc_result_t result = ISC_R_SUCCESS;
@@ -424,7 +425,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
sizeof(sockstr));
printf("Address: %s\n", sockstr);
printf("Aliases: \n\n");
printed_server = ISC_TRUE;
printed_server = true;
}
if (msg->rcode != 0) {
@@ -456,22 +457,22 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
dns_name_copy(query->lookup->name, name, NULL);
chase_cnamechain(msg, name);
dns_name_format(name, namestr, sizeof(namestr));
lookup = clone_lookup(query->lookup, ISC_FALSE);
lookup = clone_lookup(query->lookup, false);
if (lookup != NULL) {
strlcpy(lookup->textname, namestr,
sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_aaaa;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = true;
lookup->origin = NULL;
lookup->retries = tries;
ISC_LIST_APPEND(lookup_list, lookup, link);
}
lookup = clone_lookup(query->lookup, ISC_FALSE);
lookup = clone_lookup(query->lookup, false);
if (lookup != NULL) {
strlcpy(lookup->textname, namestr,
sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_mx;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = true;
lookup->origin = NULL;
lookup->retries = tries;
ISC_LIST_APPEND(lookup_list, lookup, link);
@@ -485,31 +486,31 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
printf(";; flags: ");
if ((msg->flags & DNS_MESSAGEFLAG_QR) != 0) {
printf("qr");
did_flag = ISC_TRUE;
did_flag = true;
}
if ((msg->flags & DNS_MESSAGEFLAG_AA) != 0) {
printf("%saa", did_flag ? " " : "");
did_flag = ISC_TRUE;
did_flag = true;
}
if ((msg->flags & DNS_MESSAGEFLAG_TC) != 0) {
printf("%stc", did_flag ? " " : "");
did_flag = ISC_TRUE;
did_flag = true;
}
if ((msg->flags & DNS_MESSAGEFLAG_RD) != 0) {
printf("%srd", did_flag ? " " : "");
did_flag = ISC_TRUE;
did_flag = true;
}
if ((msg->flags & DNS_MESSAGEFLAG_RA) != 0) {
printf("%sra", did_flag ? " " : "");
did_flag = ISC_TRUE;
did_flag = true;
}
if ((msg->flags & DNS_MESSAGEFLAG_AD) != 0) {
printf("%sad", did_flag ? " " : "");
did_flag = ISC_TRUE;
did_flag = true;
}
if ((msg->flags & DNS_MESSAGEFLAG_CD) != 0) {
printf("%scd", did_flag ? " " : "");
did_flag = ISC_TRUE;
did_flag = true;
POST(did_flag);
}
printf("; QUERY: %u, ANSWER: %u, "
@@ -532,7 +533,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
!short_form) {
printf("\n");
result = printsection(msg, DNS_SECTION_QUESTION, "QUESTION",
ISC_TRUE, query);
true, query);
if (result != ISC_R_SUCCESS)
return (result);
}
@@ -540,7 +541,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
if (!short_form)
printf("\n");
result = printsection(msg, DNS_SECTION_ANSWER, "ANSWER",
ISC_TF(!short_form), query);
!short_form, query);
if (result != ISC_R_SUCCESS)
return (result);
}
@@ -549,7 +550,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
!short_form) {
printf("\n");
result = printsection(msg, DNS_SECTION_AUTHORITY, "AUTHORITY",
ISC_TRUE, query);
true, query);
if (result != ISC_R_SUCCESS)
return (result);
}
@@ -557,14 +558,14 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
!short_form) {
printf("\n");
result = printsection(msg, DNS_SECTION_ADDITIONAL,
"ADDITIONAL", ISC_TRUE, query);
"ADDITIONAL", true, query);
if (result != ISC_R_SUCCESS)
return (result);
}
if ((tsig != NULL) && !short_form) {
printf("\n");
result = printrdata(msg, tsig, tsigname,
"PSEUDOSECTION TSIG", ISC_TRUE);
"PSEUDOSECTION TSIG", true);
if (result != ISC_R_SUCCESS)
return (result);
}
@@ -599,7 +600,7 @@ pre_parse_args(int argc, char **argv) {
while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
switch (c) {
case 'm':
memdebugging = ISC_TRUE;
memdebugging = true;
if (strcasecmp("trace", isc_commandline_argument) == 0)
isc_mem_debugging |= ISC_MEM_DEBUGTRACE;
else if (strcasecmp("record",
@@ -613,12 +614,12 @@ pre_parse_args(int argc, char **argv) {
case '4':
if (ipv6only)
fatal("only one of -4 and -6 allowed");
ipv4only = ISC_TRUE;
ipv4only = true;
break;
case '6':
if (ipv4only)
fatal("only one of -4 and -6 allowed");
ipv6only = ISC_TRUE;
ipv6only = true;
break;
case 'a': break;
case 'A': break;
@@ -639,8 +640,8 @@ pre_parse_args(int argc, char **argv) {
case 'C': break;
case 'D':
if (debugging)
debugtiming = ISC_TRUE;
debugging = ISC_TRUE;
debugtiming = true;
debugging = true;
break;
case 'N': break;
case 'R': break;
@@ -650,12 +651,12 @@ pre_parse_args(int argc, char **argv) {
show_usage();
}
}
isc_commandline_reset = ISC_TRUE;
isc_commandline_reset = true;
isc_commandline_index = 1;
}
static void
parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
parse_args(bool is_batchfile, int argc, char **argv) {
char hostname[MXNAME];
dig_lookup_t *lookup;
int c;
@@ -664,30 +665,30 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
isc_result_t result = ISC_R_SUCCESS;
dns_rdatatype_t rdtype;
dns_rdataclass_t rdclass;
isc_uint32_t serial = 0;
uint32_t serial = 0;
UNUSED(is_batchfile);
lookup = make_empty_lookup();
lookup->servfail_stops = ISC_FALSE;
lookup->comments = ISC_FALSE;
lookup->servfail_stops = false;
lookup->comments = false;
short_form = !verbose;
while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
switch (c) {
case 'l':
lookup->tcp_mode = ISC_TRUE;
lookup->tcp_mode = true;
lookup->rdtype = dns_rdatatype_axfr;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = true;
fatalexit = 3;
break;
case 'v':
case 'd':
short_form = ISC_FALSE;
short_form = false;
break;
case 'r':
lookup->recurse = ISC_FALSE;
lookup->recurse = false;
break;
case 't':
if (strncasecmp(isc_commandline_argument,
@@ -712,23 +713,23 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
if (!lookup->rdtypeset ||
lookup->rdtype != dns_rdatatype_axfr)
lookup->rdtype = rdtype;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = true;
if (rdtype == dns_rdatatype_axfr) {
/* -l -t any -v */
list_type = dns_rdatatype_any;
short_form = ISC_FALSE;
lookup->tcp_mode = ISC_TRUE;
short_form = false;
lookup->tcp_mode = true;
} else if (rdtype == dns_rdatatype_ixfr) {
lookup->ixfr_serial = serial;
lookup->tcp_mode = ISC_TRUE;
lookup->tcp_mode = true;
list_type = rdtype;
} else if (rdtype == dns_rdatatype_any) {
if (!lookup->tcp_mode_set)
lookup->tcp_mode = ISC_TRUE;
lookup->tcp_mode = true;
} else
list_type = rdtype;
list_addresses = ISC_FALSE;
default_lookups = ISC_FALSE;
list_addresses = false;
default_lookups = false;
break;
case 'c':
tr.base = isc_commandline_argument;
@@ -742,25 +743,25 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
isc_commandline_argument);
} else {
lookup->rdclass = rdclass;
lookup->rdclassset = ISC_TRUE;
lookup->rdclassset = true;
}
default_lookups = ISC_FALSE;
default_lookups = false;
break;
case 'A':
list_almost_all = ISC_TRUE;
list_almost_all = true;
/* FALL THROUGH */
case 'a':
if (!lookup->rdtypeset ||
lookup->rdtype != dns_rdatatype_axfr)
lookup->rdtype = dns_rdatatype_any;
list_type = dns_rdatatype_any;
list_addresses = ISC_FALSE;
lookup->rdtypeset = ISC_TRUE;
short_form = ISC_FALSE;
default_lookups = ISC_FALSE;
list_addresses = false;
lookup->rdtypeset = true;
short_form = false;
default_lookups = false;
break;
case 'i':
lookup->ip6_int = ISC_TRUE;
/* deprecated */
break;
case 'n':
/* deprecated */
@@ -786,23 +787,23 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
tries = 2;
break;
case 'T':
lookup->tcp_mode = ISC_TRUE;
lookup->tcp_mode_set = ISC_TRUE;
lookup->tcp_mode = true;
lookup->tcp_mode_set = true;
break;
case 'U':
lookup->tcp_mode = ISC_FALSE;
lookup->tcp_mode_set = ISC_TRUE;
lookup->tcp_mode = false;
lookup->tcp_mode_set = true;
break;
case 'C':
debug("showing all SOAs");
lookup->rdtype = dns_rdatatype_ns;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = true;
lookup->rdclass = dns_rdataclass_in;
lookup->rdclassset = ISC_TRUE;
lookup->ns_search_only = ISC_TRUE;
lookup->trace_root = ISC_TRUE;
lookup->identify_previous_line = ISC_TRUE;
default_lookups = ISC_FALSE;
lookup->rdclassset = true;
lookup->ns_search_only = true;
lookup->trace_root = true;
lookup->identify_previous_line = true;
default_lookups = false;
break;
case 'N':
debug("setting NDOTS to %s",
@@ -819,7 +820,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
/* Handled by pre_parse_args(). */
break;
case 's':
lookup->servfail_stops = ISC_TRUE;
lookup->servfail_stops = true;
break;
}
}
@@ -834,22 +835,22 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
if (argc > isc_commandline_index + 1) {
set_nameserver(argv[isc_commandline_index+1]);
debug("server is %s", argv[isc_commandline_index+1]);
listed_server = ISC_TRUE;
listed_server = true;
} else
check_ra = ISC_TRUE;
check_ra = true;
lookup->pending = ISC_FALSE;
if (get_reverse(store, sizeof(store), hostname,
lookup->ip6_int, ISC_TRUE) == ISC_R_SUCCESS) {
lookup->pending = false;
if (get_reverse(store, sizeof(store), hostname, true)
== ISC_R_SUCCESS) {
strlcpy(lookup->textname, store, sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_ptr;
lookup->rdtypeset = ISC_TRUE;
default_lookups = ISC_FALSE;
lookup->rdtypeset = true;
default_lookups = false;
} else {
strlcpy(lookup->textname, hostname, sizeof(lookup->textname));
usesearch = ISC_TRUE;
usesearch = true;
}
lookup->new_search = ISC_TRUE;
lookup->new_search = true;
ISC_LIST_APPEND(lookup_list, lookup, link);
}
@@ -878,7 +879,7 @@ main(int argc, char **argv) {
check_result(result, "isc_app_start");
setup_libs();
setup_system(ipv4only, ipv6only);
parse_args(ISC_FALSE, argc, argv);
parse_args(false, argc, argv);
if (keyfile[0] != 0)
setup_file_key();
else if (keysecret[0] != 0)
+1 -13
View File
@@ -179,18 +179,6 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-i</term>
<listitem>
<para>
Obsolete.
Use the IP6.INT domain for reverse lookups of IPv6
addresses as defined in RFC1886 and deprecated in RFC4159.
The default is to use IP6.ARPA as specified in RFC3596.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-l</term>
<listitem>
@@ -389,7 +377,7 @@
<command>host</command> appropriately converts character encoding of
domain name before sending a request to DNS server or displaying a
reply from the server.
If you'd like to turn off the IDN support for some reason, defines
If you'd like to turn off the IDN support for some reason, define
the <envar>IDN_DISABLE</envar> environment variable.
The IDN support is disabled if the variable is set when
<command>host</command> runs.
+1 -10
View File
@@ -138,15 +138,6 @@
Equivalent to the <code class="option">-v</code> verbose option.
</p>
</dd>
<dt><span class="term">-i</span></dt>
<dd>
<p>
Obsolete.
Use the IP6.INT domain for reverse lookups of IPv6
addresses as defined in RFC1886 and deprecated in RFC4159.
The default is to use IP6.ARPA as specified in RFC3596.
</p>
</dd>
<dt><span class="term">-l</span></dt>
<dd>
<p>
@@ -311,7 +302,7 @@
<span class="command"><strong>host</strong></span> appropriately converts character encoding of
domain name before sending a request to DNS server or displaying a
reply from the server.
If you'd like to turn off the IDN support for some reason, defines
If you'd like to turn off the IDN support for some reason, define
the <code class="envar">IDN_DISABLE</code> environment variable.
The IDN support is disabled if the variable is set when
<span class="command"><strong>host</strong></span> runs.
+45 -42
View File
@@ -14,16 +14,19 @@
/*! \file */
#include <inttypes.h>
#include <stdbool.h>
#include <dns/rdatalist.h>
#include <dst/dst.h>
#include <isc/boolean.h>
#include <isc/buffer.h>
#include <isc/bufferlist.h>
#include <isc/formatcheck.h>
#include <isc/lang.h>
#include <isc/list.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/sockaddr.h>
@@ -79,9 +82,14 @@ typedef struct dig_server dig_server_t;
typedef ISC_LIST(dig_server_t) dig_serverlist_t;
typedef struct dig_searchlist dig_searchlist_t;
#define DIG_QUERY_MAGIC ISC_MAGIC('D','i','g','q')
#define DIG_VALID_QUERY(x) ISC_MAGIC_VALID((x), DIG_QUERY_MAGIC)
/*% The dig_lookup structure */
struct dig_lookup {
isc_boolean_t
bool
pending, /*%< Pending a successful answer */
waiting_connect,
doing_xfr,
@@ -101,7 +109,6 @@ struct dig_lookup {
trace_root, /*% initial query for either +trace or +nssearch */
tcp_mode,
tcp_mode_set,
ip6_int,
comments,
stats,
section_question,
@@ -139,8 +146,8 @@ struct dig_lookup {
dns_rdatatype_t rdtype;
dns_rdatatype_t qrdtype;
dns_rdataclass_t rdclass;
isc_boolean_t rdtypeset;
isc_boolean_t rdclassset;
bool rdtypeset;
bool rdclassset;
char name_space[BUFSIZE];
char oname_space[BUFSIZE];
isc_buffer_t namebuf;
@@ -158,17 +165,17 @@ struct dig_lookup {
dig_serverlist_t my_server_list;
dig_searchlist_t *origin;
dig_query_t *xfr_q;
isc_uint32_t retries;
uint32_t retries;
int nsfound;
isc_uint16_t udpsize;
isc_int16_t edns;
isc_int16_t padding;
isc_uint32_t ixfr_serial;
uint16_t udpsize;
int16_t edns;
int16_t padding;
uint32_t ixfr_serial;
isc_buffer_t rdatabuf;
char rdatastore[MXNAME];
dst_context_t *tsigctx;
isc_buffer_t *querysig;
isc_uint32_t msgcounter;
uint32_t msgcounter;
dns_fixedname_t fdomain;
isc_sockaddr_t *ecs_addr;
char *cookie;
@@ -183,8 +190,9 @@ struct dig_lookup {
/*% The dig_query structure */
struct dig_query {
unsigned int magic;
dig_lookup_t *lookup;
isc_boolean_t waiting_connect,
bool waiting_connect,
pending_free,
waiting_senddone,
first_pass,
@@ -194,30 +202,26 @@ struct dig_query {
recv_made,
warn_id,
timedout;
isc_uint32_t first_rr_serial;
isc_uint32_t second_rr_serial;
isc_uint32_t msg_count;
isc_uint32_t rr_count;
isc_boolean_t ixfr_axfr;
uint32_t first_rr_serial;
uint32_t second_rr_serial;
uint32_t msg_count;
uint32_t rr_count;
bool ixfr_axfr;
char *servname;
char *userarg;
isc_bufferlist_t sendlist,
recvlist,
lengthlist;
isc_buffer_t recvbuf,
lengthbuf,
slbuf;
char *recvspace,
lengthspace[4],
slspace[4];
tmpsendbuf,
sendbuf;
char *recvspace, *tmpsendspace,
lengthspace[4];
isc_socket_t *sock;
ISC_LINK(dig_query_t) link;
ISC_LINK(dig_query_t) clink;
isc_sockaddr_t sockaddr;
isc_time_t time_sent;
isc_time_t time_recv;
isc_uint64_t byte_count;
isc_buffer_t sendbuf;
uint64_t byte_count;
isc_timer_t *timer;
};
@@ -244,7 +248,7 @@ extern dig_serverlist_t server_list;
extern dig_searchlistlist_t search_list;
extern unsigned int extrabytes;
extern isc_boolean_t check_ra, have_ipv4, have_ipv6, specified_source,
extern bool check_ra, have_ipv4, have_ipv6, specified_source,
usesearch, showsearch;
extern in_port_t port;
extern unsigned int timeout;
@@ -260,17 +264,17 @@ extern char keysecret[MXNAME];
extern const dns_name_t *hmacname;
extern unsigned int digestbits;
extern dns_tsigkey_t *tsigkey;
extern isc_boolean_t validated;
extern bool validated;
extern isc_taskmgr_t *taskmgr;
extern isc_task_t *global_task;
extern isc_boolean_t free_now;
extern isc_boolean_t debugging, debugtiming, memdebugging;
extern isc_boolean_t keep_open;
extern bool free_now;
extern bool debugging, debugtiming, memdebugging;
extern bool keep_open;
extern char *progname;
extern int tries;
extern int fatalexit;
extern isc_boolean_t verbose;
extern bool verbose;
/*
* Routines in dighost.c.
@@ -282,8 +286,7 @@ int
getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp);
isc_result_t
get_reverse(char *reverse, size_t len, char *value, isc_boolean_t ip6_int,
isc_boolean_t strict);
get_reverse(char *reverse, size_t len, char *value, bool strict);
ISC_PLATFORM_NORETURN_PRE void
fatal(const char *format, ...)
@@ -302,7 +305,7 @@ debug(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
void
check_result(isc_result_t result, const char *msg);
isc_boolean_t
bool
setup_lookup(dig_lookup_t *lookup);
void
@@ -324,14 +327,14 @@ void
setup_libs(void);
void
setup_system(isc_boolean_t ipv4only, isc_boolean_t ipv6only);
setup_system(bool ipv4only, bool ipv6only);
isc_result_t
parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
parse_uint(uint32_t *uip, const char *value, uint32_t max,
const char *desc);
isc_result_t
parse_xint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
parse_xint(uint32_t *uip, const char *value, uint32_t max,
const char *desc);
isc_result_t
@@ -341,13 +344,13 @@ void
parse_hmac(const char *hmacstr);
dig_lookup_t *
requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers);
requeue_lookup(dig_lookup_t *lookold, bool servers);
dig_lookup_t *
make_empty_lookup(void);
dig_lookup_t *
clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers);
clone_lookup(dig_lookup_t *lookold, bool servers);
dig_server_t *
make_server(const char *servname, const char *userarg);
@@ -376,7 +379,7 @@ set_search_domain(char *domain);
* then assigned to the appropriate function pointer
*/
extern isc_result_t
(*dighost_printmessage)(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers);
(*dighost_printmessage)(dig_query_t *query, dns_message_t *msg, bool headers);
/*%<
* Print the final result of the lookup.
*/
@@ -418,7 +421,7 @@ dig_setup(int argc, char **argv);
* Call to supply new parameters for the next lookup
*/
void
dig_query_setup(isc_boolean_t, isc_boolean_t, int argc, char **argv);
dig_query_setup(bool, bool, int argc, char **argv);
/*%<
* set the main application event cycle running
+11
View File
@@ -277,6 +277,17 @@ Try the next nameserver if a nameserver responds with SERVFAIL or a referral (no
.PP
\fBnslookup\fR
returns with an exit status of 1 if any query failed, and 0 otherwise\&.
.SH "IDN SUPPORT"
.PP
If
\fBnslookup\fR
has been built with IDN (internationalized domain name) support, it can accept and display non\-ASCII domain names\&.
\fBnslookup\fR
appropriately converts character encoding of domain name before sending a request to DNS server or displaying a reply from the server\&. If you\*(Aqd like to turn off the IDN support for some reason, define the
\fBIDN_DISABLE\fR
environment variable\&. The IDN support is disabled if the variable is set when
\fBnslookup\fR
runs or when the standard output is not a tty\&.
.SH "FILES"
.PP
/etc/resolv\&.conf
+88 -92
View File
@@ -11,6 +11,8 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
@@ -53,18 +55,18 @@
#endif
#endif
static isc_boolean_t short_form = ISC_TRUE,
tcpmode = ISC_FALSE, tcpmode_set = ISC_FALSE,
identify = ISC_FALSE, stats = ISC_TRUE,
comments = ISC_TRUE, section_question = ISC_TRUE,
section_answer = ISC_TRUE, section_authority = ISC_TRUE,
section_additional = ISC_TRUE, recurse = ISC_TRUE,
aaonly = ISC_FALSE, nofail = ISC_TRUE,
default_lookups = ISC_TRUE, a_noanswer = ISC_FALSE;
static bool short_form = true,
tcpmode = false, tcpmode_set = false,
identify = false, stats = true,
comments = true, section_question = true,
section_answer = true, section_authority = true,
section_additional = true, recurse = true,
aaonly = false, nofail = true,
default_lookups = true, a_noanswer = false;
static isc_boolean_t interactive;
static bool interactive;
static isc_boolean_t in_use = ISC_FALSE;
static bool in_use = false;
static char defclass[MXRD] = "IN";
static char deftype[MXRD] = "A";
static isc_event_t *global_event = NULL;
@@ -213,7 +215,7 @@ printrdata(dns_rdata_t *rdata) {
isc_result_t result;
isc_buffer_t *b = NULL;
unsigned int size = 1024;
isc_boolean_t done = ISC_FALSE;
bool done = false;
if (rdata->type < N_KNOWN_RRTYPES)
printf("%s", rtypetext[rdata->type]);
@@ -228,7 +230,7 @@ printrdata(dns_rdata_t *rdata) {
if (result == ISC_R_SUCCESS) {
printf("%.*s\n", (int)isc_buffer_usedlength(b),
(char *)isc_buffer_base(b));
done = ISC_TRUE;
done = true;
} else if (result != ISC_R_NOSPACE)
check_result(result, "dns_rdata_totext");
isc_buffer_free(&b);
@@ -237,7 +239,7 @@ printrdata(dns_rdata_t *rdata) {
}
static isc_result_t
printsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers,
printsection(dig_query_t *query, dns_message_t *msg, bool headers,
dns_section_t section) {
isc_result_t result, loopresult;
dns_name_t *name;
@@ -304,7 +306,7 @@ printsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers,
}
static isc_result_t
detailsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers,
detailsection(dig_query_t *query, dns_message_t *msg, bool headers,
dns_section_t section) {
isc_result_t result, loopresult;
dns_name_t *name;
@@ -429,7 +431,7 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
}
static isc_result_t
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
char servtext[ISC_SOCKADDR_FORMATSIZE];
/* I've we've gotten this far, we've reached a server. */
@@ -448,10 +450,10 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
if (!short_form) {
puts("------------");
/* detailheader(query, msg);*/
detailsection(query, msg, ISC_TRUE, DNS_SECTION_QUESTION);
detailsection(query, msg, ISC_TRUE, DNS_SECTION_ANSWER);
detailsection(query, msg, ISC_TRUE, DNS_SECTION_AUTHORITY);
detailsection(query, msg, ISC_TRUE, DNS_SECTION_ADDITIONAL);
detailsection(query, msg, true, DNS_SECTION_QUESTION);
detailsection(query, msg, true, DNS_SECTION_ANSWER);
detailsection(query, msg, true, DNS_SECTION_AUTHORITY);
detailsection(query, msg, true, DNS_SECTION_ADDITIONAL);
puts("------------");
}
@@ -479,12 +481,12 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
dns_name_copy(query->lookup->name, name, NULL);
chase_cnamechain(msg, name);
dns_name_format(name, namestr, sizeof(namestr));
lookup = clone_lookup(query->lookup, ISC_FALSE);
lookup = clone_lookup(query->lookup, false);
if (lookup != NULL) {
strlcpy(lookup->textname, namestr,
sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_aaaa;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = true;
lookup->origin = NULL;
lookup->retries = tries;
ISC_LIST_APPEND(lookup_list, lookup, link);
@@ -498,7 +500,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
printsection(query, msg, headers, DNS_SECTION_ANSWER);
else {
if (default_lookups && query->lookup->rdtype == dns_rdatatype_a)
a_noanswer = ISC_TRUE;
a_noanswer = true;
else if (!default_lookups ||
(query->lookup->rdtype == dns_rdatatype_aaaa &&
@@ -520,7 +522,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
}
static void
show_settings(isc_boolean_t full, isc_boolean_t serv_only) {
show_settings(bool full, bool serv_only) {
dig_server_t *srv;
isc_sockaddr_t sockaddr;
dig_searchlist_t *listent;
@@ -565,7 +567,7 @@ show_settings(isc_boolean_t full, isc_boolean_t serv_only) {
printf("\n");
}
static isc_boolean_t
static bool
testtype(char *typetext) {
isc_result_t result;
isc_textregion_t tr;
@@ -575,14 +577,14 @@ testtype(char *typetext) {
tr.length = strlen(typetext);
result = dns_rdatatype_fromtext(&rdtype, &tr);
if (result == ISC_R_SUCCESS)
return (ISC_TRUE);
return (true);
else {
printf("unknown query type: %s\n", typetext);
return (ISC_FALSE);
return (false);
}
}
static isc_boolean_t
static bool
testclass(char *typetext) {
isc_result_t result;
isc_textregion_t tr;
@@ -592,24 +594,24 @@ testclass(char *typetext) {
tr.length = strlen(typetext);
result = dns_rdataclass_fromtext(&rdclass, &tr);
if (result == ISC_R_SUCCESS)
return (ISC_TRUE);
return (true);
else {
printf("unknown query class: %s\n", typetext);
return (ISC_FALSE);
return (false);
}
}
static void
set_port(const char *value) {
isc_uint32_t n;
uint32_t n;
isc_result_t result = parse_uint(&n, value, 65535, "port");
if (result == ISC_R_SUCCESS)
port = (isc_uint16_t) n;
port = (uint16_t) n;
}
static void
set_timeout(const char *value) {
isc_uint32_t n;
uint32_t n;
isc_result_t result = parse_uint(&n, value, UINT_MAX, "timeout");
if (result == ISC_R_SUCCESS)
timeout = n;
@@ -617,7 +619,7 @@ set_timeout(const char *value) {
static void
set_tries(const char *value) {
isc_uint32_t n;
uint32_t n;
isc_result_t result = parse_uint(&n, value, INT_MAX, "tries");
if (result == ISC_R_SUCCESS)
tries = n;
@@ -625,7 +627,7 @@ set_tries(const char *value) {
static void
set_ndots(const char *value) {
isc_uint32_t n;
uint32_t n;
isc_result_t result = parse_uint(&n, value, 128, "ndots");
if (result == ISC_R_SUCCESS)
ndots = n;
@@ -644,7 +646,7 @@ setoption(char *opt) {
((l >= N) && (l < sizeof(A)) && (strncasecmp(opt, A, l) == 0))
if (CHECKOPT("all", 3)) {
show_settings(ISC_TRUE, ISC_FALSE);
show_settings(true, false);
} else if (strncasecmp(opt, "class=", 6) == 0) {
if (testclass(&opt[6]))
strlcpy(defclass, &opt[6], sizeof(defclass));
@@ -654,41 +656,41 @@ setoption(char *opt) {
} else if (strncasecmp(opt, "type=", 5) == 0) {
if (testtype(&opt[5])) {
strlcpy(deftype, &opt[5], sizeof(deftype));
default_lookups = ISC_FALSE;
default_lookups = false;
}
} else if (strncasecmp(opt, "ty=", 3) == 0) {
if (testtype(&opt[3])) {
strlcpy(deftype, &opt[3], sizeof(deftype));
default_lookups = ISC_FALSE;
default_lookups = false;
}
} else if (strncasecmp(opt, "querytype=", 10) == 0) {
if (testtype(&opt[10])) {
strlcpy(deftype, &opt[10], sizeof(deftype));
default_lookups = ISC_FALSE;
default_lookups = false;
}
} else if (strncasecmp(opt, "query=", 6) == 0) {
if (testtype(&opt[6])) {
strlcpy(deftype, &opt[6], sizeof(deftype));
default_lookups = ISC_FALSE;
default_lookups = false;
}
} else if (strncasecmp(opt, "qu=", 3) == 0) {
if (testtype(&opt[3])) {
strlcpy(deftype, &opt[3], sizeof(deftype));
default_lookups = ISC_FALSE;
default_lookups = false;
}
} else if (strncasecmp(opt, "q=", 2) == 0) {
if (testtype(&opt[2])) {
strlcpy(deftype, &opt[2], sizeof(deftype));
default_lookups = ISC_FALSE;
default_lookups = false;
}
} else if (strncasecmp(opt, "domain=", 7) == 0) {
strlcpy(domainopt, &opt[7], sizeof(domainopt));
set_search_domain(domainopt);
usesearch = ISC_TRUE;
usesearch = true;
} else if (strncasecmp(opt, "do=", 3) == 0) {
strlcpy(domainopt, &opt[3], sizeof(domainopt));
set_search_domain(domainopt);
usesearch = ISC_TRUE;
usesearch = true;
} else if (strncasecmp(opt, "port=", 5) == 0) {
set_port(&opt[5]);
} else if (strncasecmp(opt, "po=", 3) == 0) {
@@ -698,43 +700,43 @@ setoption(char *opt) {
} else if (strncasecmp(opt, "t=", 2) == 0) {
set_timeout(&opt[2]);
} else if (CHECKOPT("recurse", 3)) {
recurse = ISC_TRUE;
recurse = true;
} else if (CHECKOPT("norecurse", 5)) {
recurse = ISC_FALSE;
recurse = false;
} else if (strncasecmp(opt, "retry=", 6) == 0) {
set_tries(&opt[6]);
} else if (strncasecmp(opt, "ret=", 4) == 0) {
set_tries(&opt[4]);
} else if (CHECKOPT("defname", 3)) {
usesearch = ISC_TRUE;
usesearch = true;
} else if (CHECKOPT("nodefname", 5)) {
usesearch = ISC_FALSE;
usesearch = false;
} else if (CHECKOPT("vc", 2)) {
tcpmode = ISC_TRUE;
tcpmode_set = ISC_TRUE;
tcpmode = true;
tcpmode_set = true;
} else if (CHECKOPT("novc", 4)) {
tcpmode = ISC_FALSE;
tcpmode_set = ISC_TRUE;
tcpmode = false;
tcpmode_set = true;
} else if (CHECKOPT("debug", 3)) {
short_form = ISC_FALSE;
showsearch = ISC_TRUE;
short_form = false;
showsearch = true;
} else if (CHECKOPT("nodebug", 5)) {
short_form = ISC_TRUE;
showsearch = ISC_FALSE;
short_form = true;
showsearch = false;
} else if (CHECKOPT("d2", 2)) {
debugging = ISC_TRUE;
debugging = true;
} else if (CHECKOPT("nod2", 4)) {
debugging = ISC_FALSE;
debugging = false;
} else if (CHECKOPT("search", 3)) {
usesearch = ISC_TRUE;
usesearch = true;
} else if (CHECKOPT("nosearch", 5)) {
usesearch = ISC_FALSE;
usesearch = false;
} else if (CHECKOPT("sil", 3)) {
/* deprecation_msg = ISC_FALSE; */
/* deprecation_msg = false; */
} else if (CHECKOPT("fail", 3)) {
nofail=ISC_FALSE;
nofail=false;
} else if (CHECKOPT("nofail", 5)) {
nofail=ISC_TRUE;
nofail=true;
} else if (strncasecmp(opt, "ndots=", 6) == 0) {
set_ndots(&opt[6]);
} else {
@@ -753,7 +755,7 @@ addlookup(char *opt) {
debug("addlookup()");
a_noanswer = ISC_FALSE;
a_noanswer = false;
tr.base = deftype;
tr.length = strlen(deftype);
@@ -770,21 +772,21 @@ addlookup(char *opt) {
rdclass = dns_rdataclass_in;
}
lookup = make_empty_lookup();
if (get_reverse(store, sizeof(store), opt, lookup->ip6_int, ISC_TRUE)
if (get_reverse(store, sizeof(store), opt, true)
== ISC_R_SUCCESS) {
strlcpy(lookup->textname, store, sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_ptr;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = true;
} else {
strlcpy(lookup->textname, opt, sizeof(lookup->textname));
lookup->rdtype = rdtype;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = true;
}
lookup->rdclass = rdclass;
lookup->rdclassset = ISC_TRUE;
lookup->trace = ISC_FALSE;
lookup->rdclassset = true;
lookup->trace = false;
lookup->trace_root = lookup->trace;
lookup->ns_search_only = ISC_FALSE;
lookup->ns_search_only = false;
lookup->identify = identify;
lookup->recurse = recurse;
lookup->aaonly = aaonly;
@@ -792,7 +794,7 @@ addlookup(char *opt) {
lookup->udpsize = 0;
lookup->comments = comments;
if (lookup->rdtype == dns_rdatatype_any && !tcpmode_set)
lookup->tcp_mode = ISC_TRUE;
lookup->tcp_mode = true;
else
lookup->tcp_mode = tcpmode;
lookup->stats = stats;
@@ -800,9 +802,9 @@ addlookup(char *opt) {
lookup->section_answer = section_answer;
lookup->section_authority = section_authority;
lookup->section_additional = section_additional;
lookup->new_search = ISC_TRUE;
lookup->new_search = true;
if (nofail)
lookup->servfail_stops = ISC_FALSE;
lookup->servfail_stops = false;
ISC_LIST_INIT(lookup->q);
ISC_LINK_INIT(lookup, link);
ISC_LIST_APPEND(lookup_list, lookup, link);
@@ -826,11 +828,11 @@ do_next_command(char *input) {
(strcasecmp(ptr, "lserver") == 0)) {
isc_app_block();
set_nameserver(arg);
check_ra = ISC_FALSE;
check_ra = false;
isc_app_unblock();
show_settings(ISC_TRUE, ISC_TRUE);
show_settings(true, true);
} else if (strcasecmp(ptr, "exit") == 0) {
in_use = ISC_FALSE;
in_use = false;
} else if (strcasecmp(ptr, "help") == 0 ||
strcasecmp(ptr, "?") == 0) {
printf("The '%s' command is not yet implemented.\n", ptr);
@@ -867,7 +869,7 @@ get_next_command(void) {
ptr = fgets(buf, COMMSIZE, stdin);
isc_app_unblock();
if (ptr == NULL) {
in_use = ISC_FALSE;
in_use = false;
} else
do_next_command(ptr);
#ifdef HAVE_READLINE
@@ -879,9 +881,9 @@ get_next_command(void) {
static void
parse_args(int argc, char **argv) {
isc_boolean_t have_lookup = ISC_FALSE;
bool have_lookup = false;
usesearch = ISC_TRUE;
usesearch = true;
for (argc--, argv++; argc > 0; argc--, argv++) {
debug("main parsing %s", argv[0]);
if (argv[0][0] == '-') {
@@ -891,15 +893,15 @@ parse_args(int argc, char **argv) {
} else if (argv[0][1] != 0) {
setoption(&argv[0][1]);
} else
have_lookup = ISC_TRUE;
have_lookup = true;
} else {
if (!have_lookup) {
have_lookup = ISC_TRUE;
in_use = ISC_TRUE;
have_lookup = true;
in_use = true;
addlookup(argv[0]);
} else {
set_nameserver(argv[0]);
check_ra = ISC_FALSE;
check_ra = false;
}
}
}
@@ -921,12 +923,6 @@ flush_lookup_list(void) {
ISC_SOCKCANCEL_ALL);
isc_socket_detach(&q->sock);
}
if (ISC_LINK_LINKED(&q->recvbuf, link))
ISC_LIST_DEQUEUE(q->recvlist, &q->recvbuf,
link);
if (ISC_LINK_LINKED(&q->lengthbuf, link))
ISC_LIST_DEQUEUE(q->lengthlist, &q->lengthbuf,
link);
isc_buffer_invalidate(&q->recvbuf);
isc_buffer_invalidate(&q->lengthbuf);
qp = q;
@@ -970,13 +966,13 @@ int
main(int argc, char **argv) {
isc_result_t result;
interactive = ISC_TF(isatty(0));
interactive = isatty(0);
ISC_LIST_INIT(lookup_list);
ISC_LIST_INIT(server_list);
ISC_LIST_INIT(search_list);
check_ra = ISC_TRUE;
check_ra = true;
/* setup dighost callbacks */
dighost_printmessage = printmessage;
@@ -990,7 +986,7 @@ main(int argc, char **argv) {
setup_libs();
progname = argv[0];
setup_system(ISC_FALSE, ISC_FALSE);
setup_system(false, false);
parse_args(argc, argv);
if (keyfile[0] != 0)
setup_file_key();
@@ -1004,7 +1000,7 @@ main(int argc, char **argv) {
else
result = isc_app_onrun(mctx, global_task, getinput, NULL);
check_result(result, "isc_app_onrun");
in_use = ISC_TF(!in_use);
in_use = !in_use;
(void)isc_app_run();
+16
View File
@@ -478,6 +478,22 @@ nslookup -query=hinfo -timeout=10
</para>
</refsection>
<refsection><info><title>IDN SUPPORT</title></info>
<para>
If <command>nslookup</command> has been built with IDN (internationalized
domain name) support, it can accept and display non-ASCII domain names.
<command>nslookup</command> appropriately converts character encoding of
domain name before sending a request to DNS server or displaying a
reply from the server.
If you'd like to turn off the IDN support for some reason, define
the <envar>IDN_DISABLE</envar> environment variable.
The IDN support is disabled if the variable is set when
<command>nslookup</command> runs or when the standard output is not
a tty.
</para>
</refsection>
<refsection><info><title>FILES</title></info>
<para><filename>/etc/resolv.conf</filename>
+19 -2
View File
@@ -362,14 +362,31 @@ nslookup -query=hinfo -timeout=10
</div>
<div class="refsection">
<a name="id-1.11"></a><h2>FILES</h2>
<a name="id-1.11"></a><h2>IDN SUPPORT</h2>
<p>
If <span class="command"><strong>nslookup</strong></span> has been built with IDN (internationalized
domain name) support, it can accept and display non-ASCII domain names.
<span class="command"><strong>nslookup</strong></span> appropriately converts character encoding of
domain name before sending a request to DNS server or displaying a
reply from the server.
If you'd like to turn off the IDN support for some reason, define
the <code class="envar">IDN_DISABLE</code> environment variable.
The IDN support is disabled if the variable is set when
<span class="command"><strong>nslookup</strong></span> runs or when the standard output is not
a tty.
</p>
</div>
<div class="refsection">
<a name="id-1.12"></a><h2>FILES</h2>
<p><code class="filename">/etc/resolv.conf</code>
</p>
</div>
<div class="refsection">
<a name="id-1.12"></a><h2>SEE ALSO</h2>
<a name="id-1.13"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry">
<span class="refentrytitle">dig</span>(1)
+2 -2
View File
@@ -68,7 +68,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dighost.lib;libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;@IDN_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dighost.lib;libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;@IDN_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
@@ -98,7 +98,7 @@
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dighost.lib;libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;@IDN_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dighost.lib;libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;@IDN_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+2 -2
View File
@@ -68,7 +68,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dighost.lib;@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dighost.lib;@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
@@ -98,7 +98,7 @@
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dighost.lib;@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dighost.lib;@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+2 -2
View File
@@ -68,7 +68,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@READLINE_LIBD@@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@@READLINE_LIBD@@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
@@ -98,7 +98,7 @@
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@READLINE_LIB@@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@@READLINE_LIB@@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+4 -4
View File
@@ -115,12 +115,12 @@ installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
install:: ${TARGETS} installdirs
for t in ${TARGETS}; do ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} $$t ${DESTDIR}${sbindir}; done
for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8; done
for t in ${TARGETS}; do ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} $$t ${DESTDIR}${sbindir} || exit 1; done
for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8 || exit 1; done
uninstall::
for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m ; done
for t in ${TARGETS}; do ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/$$t ; done
for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m || exit 1; done
for t in ${TARGETS}; do ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/$$t || exit 1; done
clean distclean::
rm -f ${TARGETS}
+49 -47
View File
@@ -19,6 +19,8 @@
#include <config.h>
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/buffer.h>
@@ -60,7 +62,7 @@
#include "dnssectool.h"
#ifndef PATH_MAX
#define PATH_MAX 1024 /* AIX, WIN32, and others don't define this. */
#define PATH_MAX 1024 /* WIN32, and others don't define this. */
#endif
const char *program = "dnssec-cds";
@@ -84,7 +86,7 @@ static dns_rdataclass_t rdclass = dns_rdataclass_in;
* List of digest types used by ds_from_cdnskey(), filled in by add_dtype()
* from -a arguments. The size of the array is an arbitrary limit.
*/
static isc_uint8_t dtype[8];
static uint8_t dtype[8];
static const char *startstr = NULL; /* from which we derive notbefore */
static isc_stdtime_t notbefore = 0; /* restrict sig inception times */
@@ -127,7 +129,7 @@ static int nkey; /* number of child zone DNSKEY records */
typedef struct keyinfo {
dns_rdata_t rdata;
dst_key_t *dst;
isc_uint8_t algo;
uint8_t algo;
dns_keytag_t tag;
} keyinfo_t;
@@ -161,8 +163,8 @@ verbose_time(int level, const char *msg, isc_stdtime_t time) {
if (verbose < 3) {
vbprintf(level, "%s %s\n", msg, timestr);
} else {
vbprintf(level, "%s %s (%lld)\n",
msg, timestr, (long long)time);
vbprintf(level, "%s %s (%" PRIu32 ")\n",
msg, timestr, time);
}
}
@@ -258,7 +260,7 @@ load_db(const char *filename, dns_db_t **dbp, dns_dbnode_t **nodep) {
isc_result_totext(result));
}
result = dns_db_findnode(*dbp, name, ISC_FALSE, nodep);
result = dns_db_findnode(*dbp, name, false, nodep);
if (result != ISC_R_SUCCESS) {
fatal("can't find %s node in %s", namestr, filename);
}
@@ -312,7 +314,7 @@ get_dsset_name(char *filename, size_t size,
}
isc_buffer_putstr(&buf, prefix);
result = dns_name_tofilenametext(name, ISC_FALSE, &buf);
result = dns_name_tofilenametext(name, false, &buf);
check_result(result, "dns_name_tofilenametext()");
if (isc_buffer_availablelength(&buf) == 0) {
fatal("%s: pathname too long", path);
@@ -400,7 +402,7 @@ formatset(dns_rdataset_t *rdataset) {
static void
write_parent_set(const char *path, const char *inplace,
isc_boolean_t nsupdate, dns_rdataset_t *rdataset)
bool nsupdate, dns_rdataset_t *rdataset)
{
isc_result_t result;
isc_buffer_t *buf = NULL;
@@ -467,7 +469,7 @@ typedef enum { LOOSE, TIGHT } strictness_t;
/*
* Find out if any (C)DS record matches a particular (C)DNSKEY.
*/
static isc_boolean_t
static bool
match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
{
isc_result_t result;
@@ -481,7 +483,7 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
dns_rdata_t dsrdata = DNS_RDATA_INIT;
dns_rdata_t newdsrdata = DNS_RDATA_INIT;
dns_rdatatype_t keytype;
isc_boolean_t c;
bool c;
dns_rdataset_current(dsset, &dsrdata);
result = dns_rdata_tostruct(&dsrdata, &ds, NULL);
@@ -511,13 +513,13 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
vbprintf(1, "found matching %s %d %d %d\n",
c ? "CDS" : "DS",
ds.key_tag, ds.algorithm, ds.digest_type);
return (ISC_TRUE);
return (true);
} else if (strictness == TIGHT) {
vbprintf(0, "key does not match %s %d %d %d "
"when it looks like it should\n",
c ? "CDS" : "DS",
ds.key_tag, ds.algorithm, ds.digest_type);
return (ISC_FALSE);
return (false);
}
}
@@ -528,7 +530,7 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
? "CDNSKEY" : "DNSKEY",
ki->tag, ki->algo);
return (ISC_FALSE);
return (false);
}
/*
@@ -617,12 +619,12 @@ free_keytable(keyinfo_t **keytable_p) {
* otherwise the key algorithm. This is used by the signature coverage
* check functions below.
*/
static isc_uint8_t *
static uint8_t *
matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
dns_rdataset_t *sigset)
{
isc_result_t result;
isc_uint8_t *algo;
uint8_t *algo;
int i;
algo = isc_mem_get(mctx, nkey);
@@ -668,7 +670,7 @@ matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
}
result = dns_dnssec_verify(name, rdataset, ki->dst,
ISC_FALSE, 0, mctx,
false, 0, mctx,
&sigrdata, NULL);
if (result != ISC_R_SUCCESS &&
@@ -704,13 +706,13 @@ matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
* Consume the result of matching_sigs(). When checking records
* fetched from the child zone, any working signature is enough.
*/
static isc_boolean_t
signed_loose(isc_uint8_t *algo) {
isc_boolean_t ok = ISC_FALSE;
static bool
signed_loose(uint8_t *algo) {
bool ok = false;
int i;
for (i = 0; i < nkey; i++) {
if (algo[i] != 0) {
ok = ISC_TRUE;
ok = true;
}
}
isc_mem_put(mctx, algo, nkey);
@@ -723,10 +725,10 @@ signed_loose(isc_uint8_t *algo) {
* key algorithm in the DS RRset must have a signature in the DNSKEY
* RRset.
*/
static isc_boolean_t
signed_strict(dns_rdataset_t *dsset, isc_uint8_t *algo) {
static bool
signed_strict(dns_rdataset_t *dsset, uint8_t *algo) {
isc_result_t result;
isc_boolean_t all_ok = ISC_TRUE;
bool all_ok = true;
for (result = dns_rdataset_first(dsset);
result == ISC_R_SUCCESS;
@@ -734,23 +736,23 @@ signed_strict(dns_rdataset_t *dsset, isc_uint8_t *algo) {
{
dns_rdata_t dsrdata = DNS_RDATA_INIT;
dns_rdata_ds_t ds;
isc_boolean_t ds_ok;
bool ds_ok;
int i;
dns_rdataset_current(dsset, &dsrdata);
result = dns_rdata_tostruct(&dsrdata, &ds, NULL);
check_result(result, "dns_rdata_tostruct(DS)");
ds_ok = ISC_FALSE;
ds_ok = false;
for (i = 0; i < nkey; i++) {
if (algo[i] == ds.algorithm) {
ds_ok = ISC_TRUE;
ds_ok = true;
}
}
if (!ds_ok) {
vbprintf(0, "missing signature for algorithm %d "
"(key %d)\n", ds.algorithm, ds.key_tag);
all_ok = ISC_FALSE;
all_ok = false;
}
}
@@ -848,14 +850,14 @@ ds_from_cdnskey(dns_rdatalist_t *dslist, isc_buffer_t *buf,
*/
static int
cmp_dtype(const void *ap, const void *bp) {
int a = *(const isc_uint8_t *)ap;
int b = *(const isc_uint8_t *)bp;
int a = *(const uint8_t *)ap;
int b = *(const uint8_t *)bp;
return (a - b);
}
static void
add_dtype(const char *dn) {
isc_uint8_t dt;
uint8_t dt;
unsigned i, n;
dt = strtodsdigest(dn);
@@ -872,7 +874,7 @@ add_dtype(const char *dn) {
static void
make_new_ds_set(ds_maker_func_t *ds_from_rdata,
isc_uint32_t ttl, dns_rdataset_t *rdset)
uint32_t ttl, dns_rdataset_t *rdset)
{
unsigned int size = 16;
for (;;) {
@@ -934,14 +936,14 @@ rdata_cmp(const void *rdata1, const void *rdata2) {
* Ensure that every key identified by the DS RRset has the same set of
* digest types.
*/
static isc_boolean_t
static bool
consistent_digests(dns_rdataset_t *dsset) {
isc_result_t result;
dns_rdata_t *arrdata;
dns_rdata_ds_t *ds;
dns_keytag_t key_tag;
isc_uint8_t algorithm;
isc_boolean_t match;
uint8_t algorithm;
bool match;
int i, j, n, d;
/*
@@ -995,7 +997,7 @@ consistent_digests(dns_rdataset_t *dsset) {
/*
* Check subsequent keys match the first one
*/
match = ISC_TRUE;
match = true;
while (i < n) {
key_tag = ds[i].key_tag;
algorithm = ds[i].algorithm;
@@ -1004,7 +1006,7 @@ consistent_digests(dns_rdataset_t *dsset) {
ds[i+j].algorithm != algorithm ||
ds[i+j].digest_type != ds[j].digest_type)
{
match = ISC_FALSE;
match = false;
}
}
i += d;
@@ -1039,7 +1041,7 @@ print_diff(const char *cmd, dns_rdataset_t *rdataset) {
}
static void
update_diff(const char *cmd, isc_uint32_t ttl,
update_diff(const char *cmd, uint32_t ttl,
dns_rdataset_t *addset, dns_rdataset_t *delset)
{
isc_result_t result;
@@ -1047,7 +1049,7 @@ update_diff(const char *cmd, isc_uint32_t ttl,
dns_dbnode_t *node;
dns_dbversion_t *ver;
dns_rdataset_t diffset;
isc_uint32_t save;
uint32_t save;
db = NULL;
result = dns_db_create(mctx, "rbt", name, dns_dbtype_zone,
@@ -1059,7 +1061,7 @@ update_diff(const char *cmd, isc_uint32_t ttl,
check_result(result, "dns_db_newversion()");
node = NULL;
result = dns_db_findnode(db, name, ISC_TRUE, &node);
result = dns_db_findnode(db, name, true, &node);
check_result(result, "dns_db_findnode()");
dns_rdataset_init(&diffset);
@@ -1083,12 +1085,12 @@ update_diff(const char *cmd, isc_uint32_t ttl,
}
dns_db_detachnode(db, &node);
dns_db_closeversion(db, &ver, ISC_FALSE);
dns_db_closeversion(db, &ver, false);
dns_db_detach(&db);
}
static void
nsdiff(isc_uint32_t ttl, dns_rdataset_t *oldset, dns_rdataset_t *newset) {
nsdiff(uint32_t ttl, dns_rdataset_t *oldset, dns_rdataset_t *newset) {
if (ttl == 0) {
vbprintf(1, "warning: no TTL in nsupdate script\n");
}
@@ -1136,9 +1138,9 @@ main(int argc, char *argv[]) {
const char *ds_path = NULL;
const char *inplace = NULL;
isc_result_t result;
isc_boolean_t prefer_cdnskey = ISC_FALSE;
isc_boolean_t nsupdate = ISC_FALSE;
isc_uint32_t ttl = 0;
bool prefer_cdnskey = false;
bool nsupdate = false;
uint32_t ttl = 0;
int ch;
char *endp;
@@ -1152,7 +1154,7 @@ main(int argc, char *argv[]) {
#endif
dns_result_register();
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
#define OPTIONS "a:c:Dd:f:i:ms:T:uv:V"
while ((ch = isc_commandline_parse(argc, argv, OPTIONS)) != -1) {
@@ -1164,7 +1166,7 @@ main(int argc, char *argv[]) {
rdclass = strtoclass(isc_commandline_argument);
break;
case 'D':
prefer_cdnskey = ISC_TRUE;
prefer_cdnskey = true;
break;
case 'd':
ds_path = isc_commandline_argument;
@@ -1197,7 +1199,7 @@ main(int argc, char *argv[]) {
ttl = strtottl(isc_commandline_argument);
break;
case 'u':
nsupdate = ISC_TRUE;
nsupdate = true;
break;
case 'V':
/* Does not return. */
+23 -21
View File
@@ -13,6 +13,8 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/buffer.h>
@@ -48,7 +50,7 @@
#include "dnssectool.h"
#ifndef PATH_MAX
#define PATH_MAX 1024 /* AIX, WIN32, and others don't define this. */
#define PATH_MAX 1024 /* WIN32, and others don't define this. */
#endif
const char *program = "dnssec-dsfromkey";
@@ -58,8 +60,8 @@ static dns_rdataclass_t rdclass;
static dns_fixedname_t fixed;
static dns_name_t *name = NULL;
static isc_mem_t *mctx = NULL;
static isc_uint32_t ttl;
static isc_boolean_t emitttl = ISC_FALSE;
static uint32_t ttl;
static bool emitttl = false;
static isc_result_t
initname(char *setname) {
@@ -118,7 +120,7 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
isc_result_totext(result));
}
result = dns_db_findnode(db, name, ISC_FALSE, &node);
result = dns_db_findnode(db, name, false, &node);
if (result != ISC_R_SUCCESS)
fatal("can't find %s node in %s", setname, filename);
@@ -159,7 +161,7 @@ loadkeyset(char *dirname, dns_rdataset_t *rdataset) {
return (ISC_R_NOSPACE);
isc_buffer_putstr(&buf, "keyset-");
result = dns_name_tofilenametext(name, ISC_FALSE, &buf);
result = dns_name_tofilenametext(name, false, &buf);
check_result(result, "dns_name_tofilenametext()");
if (isc_buffer_availablelength(&buf) == 0)
return (ISC_R_NOSPACE);
@@ -233,8 +235,8 @@ logkey(dns_rdata_t *rdata)
}
static void
emit(unsigned int dtype, isc_boolean_t showall, char *lookaside,
isc_boolean_t cds, dns_rdata_t *rdata)
emit(unsigned int dtype, bool showall, char *lookaside,
bool cds, dns_rdata_t *rdata)
{
isc_result_t result;
unsigned char buf[DNS_DS_BUFFERSIZE];
@@ -263,7 +265,7 @@ emit(unsigned int dtype, isc_boolean_t showall, char *lookaside,
if (result != ISC_R_SUCCESS)
fatal("can't build record");
result = dns_name_totext(name, ISC_FALSE, &nameb);
result = dns_name_totext(name, false, &nameb);
if (result != ISC_R_SUCCESS)
fatal("can't print name");
@@ -352,10 +354,10 @@ main(int argc, char **argv) {
char *endp;
int ch;
unsigned int dtype = DNS_DSDIGEST_SHA1;
isc_boolean_t cds = ISC_FALSE;
isc_boolean_t both = ISC_TRUE;
isc_boolean_t usekeyset = ISC_FALSE;
isc_boolean_t showall = ISC_FALSE;
bool cds = false;
bool both = true;
bool usekeyset = false;
bool showall = false;
isc_result_t result;
isc_log_t *log = NULL;
dns_rdataset_t rdataset;
@@ -375,31 +377,31 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
#define OPTIONS "12Aa:Cc:d:Ff:K:l:sT:v:hV"
while ((ch = isc_commandline_parse(argc, argv, OPTIONS)) != -1) {
switch (ch) {
case '1':
dtype = DNS_DSDIGEST_SHA1;
both = ISC_FALSE;
both = false;
break;
case '2':
dtype = DNS_DSDIGEST_SHA256;
both = ISC_FALSE;
both = false;
break;
case 'A':
showall = ISC_TRUE;
showall = true;
break;
case 'a':
dtype = strtodsdigest(isc_commandline_argument);
both = ISC_FALSE;
both = false;
break;
case 'C':
if (lookaside != NULL)
fatal("lookaside and CDS are mutually"
" exclusive");
cds = ISC_TRUE;
cds = true;
break;
case 'c':
classname = isc_commandline_argument;
@@ -425,10 +427,10 @@ main(int argc, char **argv) {
fatal("lookaside must be a non-empty string");
break;
case 's':
usekeyset = ISC_TRUE;
usekeyset = true;
break;
case 'T':
emitttl = ISC_TRUE;
emitttl = true;
ttl = strtottl(isc_commandline_argument);
break;
case 'v':
@@ -466,7 +468,7 @@ main(int argc, char **argv) {
/* When not using -f, -A is implicit */
if (filename == NULL)
showall = ISC_TRUE;
showall = true;
if (argc < isc_commandline_index + 1 && filename == NULL)
fatal("the key file name was not specified");
+10 -9
View File
@@ -13,6 +13,7 @@
#include <config.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/buffer.h>
@@ -48,7 +49,7 @@
#include "dnssectool.h"
#ifndef PATH_MAX
#define PATH_MAX 1024 /* AIX, WIN32, and others don't define this. */
#define PATH_MAX 1024 /* WIN32, and others don't define this. */
#endif
const char *program = "dnssec-importkey";
@@ -58,13 +59,13 @@ static dns_rdataclass_t rdclass;
static dns_fixedname_t fixed;
static dns_name_t *name = NULL;
static isc_mem_t *mctx = NULL;
static isc_boolean_t setpub = ISC_FALSE, setdel = ISC_FALSE;
static isc_boolean_t setttl = ISC_FALSE;
static bool setpub = false, setdel = false;
static bool setttl = false;
static isc_stdtime_t pub = 0, del = 0;
static dns_ttl_t ttl = 0;
static isc_stdtime_t syncadd = 0, syncdel = 0;
static isc_boolean_t setsyncadd = ISC_FALSE;
static isc_boolean_t setsyncdel = ISC_FALSE;
static bool setsyncadd = false;
static bool setsyncdel = false;
static isc_result_t
initname(char *setname) {
@@ -124,7 +125,7 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
isc_result_totext(result));
}
result = dns_db_findnode(db, name, ISC_FALSE, &node);
result = dns_db_findnode(db, name, false, &node);
if (result != ISC_R_SUCCESS)
fatal("can't find %s node in %s", setname, filename);
@@ -226,7 +227,7 @@ emit(const char *dir, dns_rdata_t *rdata) {
dst_key_free(&tmp);
}
dst_key_setexternal(key, ISC_TRUE);
dst_key_setexternal(key, true);
if (setpub)
dst_key_settime(key, DST_TIME_PUBLISH, pub);
if (setdel)
@@ -315,7 +316,7 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
#define CMDLINE_FLAGS "D:f:hK:L:P:v:V"
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
@@ -346,7 +347,7 @@ main(int argc, char **argv) {
break;
case 'L':
ttl = strtottl(isc_commandline_argument);
setttl = ISC_TRUE;
setttl = true;
break;
case 'P':
/* -Psync ? */
+3 -3
View File
@@ -55,7 +55,7 @@ of the key is specified on the command line\&. This must match the name of the z
.RS 4
Selects the cryptographic algorithm\&. The value of
\fBalgorithm\fR
must be one of RSAMD5, RSASHA1, DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512, ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448\&.
must be one of RSAMD5, RSASHA1, NSEC3RSASHA1, RSASHA256, RSASHA512, ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448\&.
.sp
If no algorithm is specified, then RSASHA1 will be used by default, unless the
\fB\-3\fR
@@ -63,9 +63,9 @@ option is specified, in which case NSEC3RSASHA1 will be used instead\&. (If
\fB\-3\fR
is used and an algorithm is specified, that algorithm will be checked for compatibility with NSEC3\&.)
.sp
These values are case insensitive\&. In some cases, abbreviations are supported, such as ECDSA256 for ECDSAP256SHA256 and ECDSA384 for ECDSAP384SHA384\&. If RSASHA1 or DSA is specified along with the
These values are case insensitive\&. In some cases, abbreviations are supported, such as ECDSA256 for ECDSAP256SHA256 and ECDSA384 for ECDSAP384SHA384\&. If RSASHA1 is specified along with the
\fB\-3\fR
option, then NSEC3RSASHA1 or NSEC3DSA will be used instead\&.
option, then NSEC3RSASHA1 will be used instead\&.
.sp
As of BIND 9\&.12\&.0, this option is mandatory except when using the
\fB\-S\fR
+28 -30
View File
@@ -14,6 +14,8 @@
#include <config.h>
#include <ctype.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/buffer.h>
@@ -62,8 +64,8 @@ usage(void) {
fprintf(stderr, " name: owner of the key\n");
fprintf(stderr, "Other options:\n");
fprintf(stderr, " -a algorithm: \n"
" RSA | RSAMD5 | DH | DSA | RSASHA1 |\n"
" NSEC3DSA | NSEC3RSASHA1 |\n"
" RSA | RSAMD5 | DH | RSASHA1 |\n"
" NSEC3RSASHA1 |\n"
" RSASHA256 | RSASHA512 |\n"
" ECDSAP256SHA256 | ECDSAP384SHA384\n");
fprintf(stderr, " -3: use NSEC3-capable algorithm\n");
@@ -127,9 +129,9 @@ main(int argc, char **argv) {
dst_key_t *key = NULL;
dns_fixedname_t fname;
dns_name_t *name;
isc_uint16_t flags = 0, kskflag = 0, revflag = 0;
uint16_t flags = 0, kskflag = 0, revflag = 0;
dns_secalg_t alg;
isc_boolean_t oldstyle = ISC_FALSE;
bool oldstyle = false;
isc_mem_t *mctx = NULL;
int ch;
int protocol = -1, signatory = 0;
@@ -146,20 +148,20 @@ main(int argc, char **argv) {
isc_stdtime_t inactive = 0, deltime = 0;
isc_stdtime_t now;
int prepub = -1;
isc_boolean_t setpub = ISC_FALSE, setact = ISC_FALSE;
isc_boolean_t setrev = ISC_FALSE, setinact = ISC_FALSE;
isc_boolean_t setdel = ISC_FALSE, setttl = ISC_FALSE;
isc_boolean_t unsetpub = ISC_FALSE, unsetact = ISC_FALSE;
isc_boolean_t unsetrev = ISC_FALSE, unsetinact = ISC_FALSE;
isc_boolean_t unsetdel = ISC_FALSE;
isc_boolean_t genonly = ISC_FALSE;
isc_boolean_t use_nsec3 = ISC_FALSE;
isc_boolean_t avoid_collisions = ISC_TRUE;
isc_boolean_t exact;
bool setpub = false, setact = false;
bool setrev = false, setinact = false;
bool setdel = false, setttl = false;
bool unsetpub = false, unsetact = false;
bool unsetrev = false, unsetinact = false;
bool unsetdel = false;
bool genonly = false;
bool use_nsec3 = false;
bool avoid_collisions = true;
bool exact;
unsigned char c;
isc_stdtime_t syncadd = 0, syncdel = 0;
isc_boolean_t unsetsyncadd = ISC_FALSE, setsyncadd = ISC_FALSE;
isc_boolean_t unsetsyncdel = ISC_FALSE, setsyncdel = ISC_FALSE;
bool unsetsyncadd = false, setsyncadd = false;
bool unsetsyncdel = false, setsyncdel = false;
if (argc == 1)
usage();
@@ -171,7 +173,7 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
isc_stdtime_get(&now);
@@ -179,13 +181,13 @@ main(int argc, char **argv) {
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
switch (ch) {
case '3':
use_nsec3 = ISC_TRUE;
use_nsec3 = true;
break;
case 'a':
algname = isc_commandline_argument;
break;
case 'C':
oldstyle = ISC_TRUE;
oldstyle = true;
break;
case 'c':
classname = isc_commandline_argument;
@@ -215,7 +217,7 @@ main(int argc, char **argv) {
break;
case 'L':
ttl = strtottl(isc_commandline_argument);
setttl = ISC_TRUE;
setttl = true;
break;
case 'l':
label = isc_mem_strdup(mctx, isc_commandline_argument);
@@ -238,10 +240,10 @@ main(int argc, char **argv) {
fatal("-v must be followed by a number");
break;
case 'y':
avoid_collisions = ISC_FALSE;
avoid_collisions = false;
break;
case 'G':
genonly = ISC_TRUE;
genonly = true;
break;
case 'P':
/* -Psync ? */
@@ -400,13 +402,9 @@ main(int argc, char **argv) {
if (use_nsec3) {
switch (alg) {
case DST_ALG_DSA:
alg = DST_ALG_NSEC3DSA;
break;
case DST_ALG_RSASHA1:
alg = DST_ALG_NSEC3RSASHA1;
break;
case DST_ALG_NSEC3DSA:
case DST_ALG_NSEC3RSASHA1:
case DST_ALG_RSASHA256:
case DST_ALG_RSASHA512:
@@ -442,14 +440,14 @@ main(int argc, char **argv) {
"prepublication interval.");
if (!setpub && !setact) {
setpub = setact = ISC_TRUE;
setpub = setact = true;
publish = now;
activate = now + prepub;
} else if (setpub && !setact) {
setact = ISC_TRUE;
setact = true;
activate = publish + prepub;
} else if (setact && !setpub) {
setpub = ISC_TRUE;
setpub = true;
publish = activate - prepub;
}
@@ -532,7 +530,7 @@ main(int argc, char **argv) {
"You can use dnssec-settime -D to "
"change this.\n", program, keystr);
setpub = setact = ISC_TRUE;
setpub = setact = true;
}
if (nametype == NULL) {
+3 -3
View File
@@ -106,7 +106,7 @@
<para>
Selects the cryptographic algorithm. The value of
<option>algorithm</option> must be one of RSAMD5, RSASHA1,
DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512,
NSEC3RSASHA1, RSASHA256, RSASHA512,
ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448.
</para>
<para>
@@ -119,9 +119,9 @@
<para>
These values are case insensitive. In some cases, abbreviations
are supported, such as ECDSA256 for ECDSAP256SHA256 and
ECDSA384 for ECDSAP384SHA384. If RSASHA1 or DSA is specified
ECDSA384 for ECDSAP384SHA384. If RSASHA1 is specified
along with the <option>-3</option> option, then NSEC3RSASHA1
or NSEC3DSA will be used instead.
will be used instead.
</para>
<para>
As of BIND 9.12.0, this option is mandatory except when using
+3 -3
View File
@@ -90,7 +90,7 @@
<p>
Selects the cryptographic algorithm. The value of
<code class="option">algorithm</code> must be one of RSAMD5, RSASHA1,
DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512,
NSEC3RSASHA1, RSASHA256, RSASHA512,
ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448.
</p>
<p>
@@ -103,9 +103,9 @@
<p>
These values are case insensitive. In some cases, abbreviations
are supported, such as ECDSA256 for ECDSAP256SHA256 and
ECDSA384 for ECDSAP384SHA384. If RSASHA1 or DSA is specified
ECDSA384 for ECDSAP384SHA384. If RSASHA1 is specified
along with the <code class="option">-3</code> option, then NSEC3RSASHA1
or NSEC3DSA will be used instead.
will be used instead.
</p>
<p>
As of BIND 9.12.0, this option is mandatory except when using
+3 -3
View File
@@ -62,13 +62,13 @@ may be preferable to direct use of
.RS 4
Selects the cryptographic algorithm\&. For DNSSEC keys, the value of
\fBalgorithm\fR
must be one of RSAMD5, RSASHA1, DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512, ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448\&. For TKEY, the value must be DH (Diffie Hellman); specifying his value will automatically set the
must be one of RSAMD5, RSASHA1, NSEC3RSASHA1, RSASHA256, RSASHA512, ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448\&. For TKEY, the value must be DH (Diffie Hellman); specifying his value will automatically set the
\fB\-T KEY\fR
option as well\&.
.sp
These values are case insensitive\&. In some cases, abbreviations are supported, such as ECDSA256 for ECDSAP256SHA256 and ECDSA384 for ECDSAP384SHA384\&. If RSASHA1 or DSA is specified along with the
These values are case insensitive\&. In some cases, abbreviations are supported, such as ECDSA256 for ECDSAP256SHA256 and ECDSA384 for ECDSAP384SHA384\&. If RSASHA1 is specified along with the
\fB\-3\fR
option, then NSEC3RSASHA1 or NSEC3DSA will be used instead\&.
option, then NSEC3RSASHA1 will be used instead\&.
.sp
This parameter
\fImust\fR
+38 -62
View File
@@ -28,6 +28,8 @@
#include <config.h>
#include <ctype.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
@@ -77,8 +79,8 @@ usage(void) {
fprintf(stderr, "Options:\n");
fprintf(stderr, " -K <directory>: write keys into directory\n");
fprintf(stderr, " -a <algorithm>:\n");
fprintf(stderr, " RSA | RSAMD5 | DSA | RSASHA1 | NSEC3RSASHA1"
" | NSEC3DSA |\n");
fprintf(stderr, " RSA | RSAMD5 | RSASHA1 | NSEC3RSASHA1"
" |\n");
fprintf(stderr, " RSASHA256 | RSASHA512 |\n");
fprintf(stderr, " ECDSAP256SHA256 | ECDSAP384SHA384 |\n");
fprintf(stderr, " ED25519 | ED448 | DH\n");
@@ -90,10 +92,6 @@ usage(void) {
fprintf(stderr, " RSASHA256:\t[1024..%d]\n", MAX_RSA);
fprintf(stderr, " RSASHA512:\t[1024..%d]\n", MAX_RSA);
fprintf(stderr, " DH:\t\t[128..4096]\n");
fprintf(stderr, " DSA:\t\t[512..1024] and divisible by 64\n");
fprintf(stderr, " NSEC3DSA:\t[512..1024] and divisible "
"by 64\n");
fprintf(stderr, " ECCGOST:\tignored\n");
fprintf(stderr, " ECDSAP256SHA256:\tignored\n");
fprintf(stderr, " ECDSAP384SHA384:\tignored\n");
fprintf(stderr, " ED25519:\tignored\n");
@@ -159,11 +157,6 @@ usage(void) {
exit (-1);
}
static isc_boolean_t
dsa_size_ok(int size) {
return (ISC_TF(size >= 512 && size <= 1024 && size % 64 == 0));
}
static void
progress(int p)
{
@@ -198,10 +191,10 @@ main(int argc, char **argv) {
dst_key_t *key = NULL;
dns_fixedname_t fname;
dns_name_t *name;
isc_uint16_t flags = 0, kskflag = 0, revflag = 0;
uint16_t flags = 0, kskflag = 0, revflag = 0;
dns_secalg_t alg;
isc_boolean_t conflict = ISC_FALSE, null_key = ISC_FALSE;
isc_boolean_t oldstyle = ISC_FALSE;
bool conflict = false, null_key = false;
bool oldstyle = false;
isc_mem_t *mctx = NULL;
int ch, generator = 0, param = 0;
int protocol = -1, size = -1, signatory = 0;
@@ -218,24 +211,24 @@ main(int argc, char **argv) {
int options = DST_TYPE_PRIVATE | DST_TYPE_PUBLIC;
int dbits = 0;
dns_ttl_t ttl = 0;
isc_boolean_t use_nsec3 = ISC_FALSE;
bool use_nsec3 = false;
isc_stdtime_t publish = 0, activate = 0, revokekey = 0;
isc_stdtime_t inactive = 0, deltime = 0;
isc_stdtime_t now;
int prepub = -1;
isc_boolean_t setpub = ISC_FALSE, setact = ISC_FALSE;
isc_boolean_t setrev = ISC_FALSE, setinact = ISC_FALSE;
isc_boolean_t setdel = ISC_FALSE, setttl = ISC_FALSE;
isc_boolean_t unsetpub = ISC_FALSE, unsetact = ISC_FALSE;
isc_boolean_t unsetrev = ISC_FALSE, unsetinact = ISC_FALSE;
isc_boolean_t unsetdel = ISC_FALSE;
isc_boolean_t genonly = ISC_FALSE;
isc_boolean_t quiet = ISC_FALSE;
isc_boolean_t show_progress = ISC_FALSE;
bool setpub = false, setact = false;
bool setrev = false, setinact = false;
bool setdel = false, setttl = false;
bool unsetpub = false, unsetact = false;
bool unsetrev = false, unsetinact = false;
bool unsetdel = false;
bool genonly = false;
bool quiet = false;
bool show_progress = false;
unsigned char c;
isc_stdtime_t syncadd = 0, syncdel = 0;
isc_boolean_t setsyncadd = ISC_FALSE;
isc_boolean_t setsyncdel = ISC_FALSE;
bool setsyncadd = false;
bool setsyncdel = false;
if (argc == 1)
usage();
@@ -245,7 +238,7 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
/*
* Process memory debugging argument first.
@@ -270,7 +263,7 @@ main(int argc, char **argv) {
break;
}
}
isc_commandline_reset = ISC_TRUE;
isc_commandline_reset = true;
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
@@ -279,7 +272,7 @@ main(int argc, char **argv) {
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
switch (ch) {
case '3':
use_nsec3 = ISC_TRUE;
use_nsec3 = true;
break;
case 'a':
algname = isc_commandline_argument;
@@ -290,7 +283,7 @@ main(int argc, char **argv) {
fatal("-b requires a non-negative number");
break;
case 'C':
oldstyle = ISC_TRUE;
oldstyle = true;
break;
case 'c':
classname = isc_commandline_argument;
@@ -306,7 +299,7 @@ main(int argc, char **argv) {
case 'e':
fprintf(stderr,
"phased-out option -e "
"(was 'use (RSA) large exponent)\n");
"(was 'use (RSA) large exponent')\n");
break;
case 'f':
c = (unsigned char)(isc_commandline_argument[0]);
@@ -338,7 +331,7 @@ main(int argc, char **argv) {
break;
case 'L':
ttl = strtottl(isc_commandline_argument);
setttl = ISC_TRUE;
setttl = true;
break;
case 'n':
nametype = isc_commandline_argument;
@@ -352,7 +345,7 @@ main(int argc, char **argv) {
"[0..255]");
break;
case 'q':
quiet = ISC_TRUE;
quiet = true;
break;
case 'r':
fatal("The -r option has been deprecated.\n"
@@ -389,7 +382,7 @@ main(int argc, char **argv) {
/* already the default */
break;
case 'G':
genonly = ISC_TRUE;
genonly = true;
break;
case 'P':
/* -Psync ? */
@@ -483,7 +476,7 @@ main(int argc, char **argv) {
}
if (!isatty(0))
quiet = ISC_TRUE;
quiet = true;
ret = dst_lib_init(mctx, engine);
if (ret != ISC_R_SUCCESS)
@@ -540,17 +533,12 @@ main(int argc, char **argv) {
if (use_nsec3) {
switch (alg) {
case DST_ALG_DSA:
alg = DST_ALG_NSEC3DSA;
break;
case DST_ALG_RSASHA1:
alg = DST_ALG_NSEC3RSASHA1;
break;
case DST_ALG_NSEC3DSA:
case DST_ALG_NSEC3RSASHA1:
case DST_ALG_RSASHA256:
case DST_ALG_RSASHA512:
case DST_ALG_ECCGOST:
case DST_ALG_ECDSA256:
case DST_ALG_ECDSA384:
case DST_ALG_ED25519:
@@ -596,7 +584,6 @@ main(int argc, char **argv) {
" to %d\n", size);
}
break;
case DST_ALG_ECCGOST:
case DST_ALG_ECDSA256:
case DST_ALG_ECDSA384:
case DST_ALG_ED25519:
@@ -614,14 +601,14 @@ main(int argc, char **argv) {
"prepublication interval.");
if (!setpub && !setact) {
setpub = setact = ISC_TRUE;
setpub = setact = true;
publish = now;
activate = now + prepub;
} else if (setpub && !setact) {
setact = ISC_TRUE;
setact = true;
activate = publish + prepub;
} else if (setact && !setpub) {
setpub = ISC_TRUE;
setpub = true;
publish = activate - prepub;
}
@@ -707,7 +694,7 @@ main(int argc, char **argv) {
"You can use dnssec-settime -D to "
"change this.\n", program, keystr);
setpub = setact = ISC_TRUE;
setpub = setact = true;
}
switch (alg) {
@@ -726,14 +713,6 @@ main(int argc, char **argv) {
if (size != 0 && (size < 128 || size > 4096))
fatal("DH key size %d out of range", size);
break;
case DNS_KEYALG_DSA:
case DNS_KEYALG_NSEC3DSA:
if (size != 0 && !dsa_size_ok(size))
fatal("invalid DSS key size: %d", size);
break;
case DST_ALG_ECCGOST:
size = 256;
break;
case DST_ALG_ECDSA256:
size = 256;
break;
@@ -806,31 +785,28 @@ main(int argc, char **argv) {
case DNS_KEYALG_NSEC3RSASHA1:
case DNS_KEYALG_RSASHA256:
case DNS_KEYALG_RSASHA512:
show_progress = ISC_TRUE;
show_progress = true;
break;
case DNS_KEYALG_DH:
param = generator;
break;
case DNS_KEYALG_DSA:
case DNS_KEYALG_NSEC3DSA:
case DST_ALG_ECCGOST:
case DST_ALG_ECDSA256:
case DST_ALG_ECDSA384:
case DST_ALG_ED25519:
case DST_ALG_ED448:
show_progress = ISC_TRUE;
show_progress = true;
break;
}
if ((flags & DNS_KEYFLAG_TYPEMASK) == DNS_KEYTYPE_NOKEY)
null_key = ISC_TRUE;
null_key = true;
isc_buffer_init(&buf, filename, sizeof(filename) - 1);
do {
conflict = ISC_FALSE;
conflict = false;
if (!quiet && show_progress) {
fprintf(stderr, "Generating key pair.");
@@ -951,7 +927,7 @@ main(int argc, char **argv) {
* or another key being revoked.
*/
if (key_collision(key, name, directory, mctx, NULL)) {
conflict = ISC_TRUE;
conflict = true;
if (null_key) {
dst_key_free(&key);
break;
@@ -972,7 +948,7 @@ main(int argc, char **argv) {
dst_key_free(&key);
}
} while (conflict == ISC_TRUE);
} while (conflict == true);
if (conflict)
fatal("cannot generate a null key due to possible key ID "
+3 -3
View File
@@ -123,7 +123,7 @@
<para>
Selects the cryptographic algorithm. For DNSSEC keys, the value
of <option>algorithm</option> must be one of RSAMD5, RSASHA1,
DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512,
NSEC3RSASHA1, RSASHA256, RSASHA512,
ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448. For
TKEY, the value must be DH (Diffie Hellman); specifying
his value will automatically set the <option>-T KEY</option>
@@ -132,9 +132,9 @@
<para>
These values are case insensitive. In some cases, abbreviations
are supported, such as ECDSA256 for ECDSAP256SHA256 and
ECDSA384 for ECDSAP384SHA384. If RSASHA1 or DSA is specified
ECDSA384 for ECDSAP384SHA384. If RSASHA1 is specified
along with the <option>-3</option> option, then NSEC3RSASHA1
or NSEC3DSA will be used instead.
will be used instead.
</para>
<para>
This parameter <emphasis>must</emphasis> be specified except
+3 -3
View File
@@ -100,7 +100,7 @@
<p>
Selects the cryptographic algorithm. For DNSSEC keys, the value
of <code class="option">algorithm</code> must be one of RSAMD5, RSASHA1,
DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512,
NSEC3RSASHA1, RSASHA256, RSASHA512,
ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448. For
TKEY, the value must be DH (Diffie Hellman); specifying
his value will automatically set the <code class="option">-T KEY</code>
@@ -109,9 +109,9 @@
<p>
These values are case insensitive. In some cases, abbreviations
are supported, such as ECDSA256 for ECDSAP256SHA256 and
ECDSA384 for ECDSAP384SHA384. If RSASHA1 or DSA is specified
ECDSA384 for ECDSAP384SHA384. If RSASHA1 is specified
along with the <code class="option">-3</code> option, then NSEC3RSASHA1
or NSEC3DSA will be used instead.
will be used instead.
</p>
<p>
This parameter <span class="emphasis"><em>must</em></span> be specified except
+10 -8
View File
@@ -13,6 +13,8 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
@@ -80,11 +82,11 @@ main(int argc, char **argv) {
char *endp;
int ch;
dst_key_t *key = NULL;
isc_uint32_t flags;
uint32_t flags;
isc_buffer_t buf;
isc_boolean_t force = ISC_FALSE;
isc_boolean_t removefile = ISC_FALSE;
isc_boolean_t id = ISC_FALSE;
bool force = false;
bool removefile = false;
bool id = false;
if (argc == 1)
usage();
@@ -98,7 +100,7 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv, "E:fK:rRhv:V")) != -1) {
switch (ch) {
@@ -106,7 +108,7 @@ main(int argc, char **argv) {
engine = isc_commandline_argument;
break;
case 'f':
force = ISC_TRUE;
force = true;
break;
case 'K':
/*
@@ -120,10 +122,10 @@ main(int argc, char **argv) {
}
break;
case 'r':
removefile = ISC_TRUE;
removefile = true;
break;
case 'R':
id = ISC_TRUE;
id = true;
break;
case 'v':
verbose = strtol(isc_commandline_argument, &endp, 0);
+51 -49
View File
@@ -13,6 +13,8 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
@@ -102,7 +104,7 @@ usage(void) {
}
static void
printtime(dst_key_t *key, int type, const char *tag, isc_boolean_t epoch,
printtime(dst_key_t *key, int type, const char *tag, bool epoch,
FILE *stream)
{
isc_result_t result;
@@ -141,29 +143,29 @@ main(int argc, char **argv) {
dns_name_t *name = NULL;
dns_secalg_t alg = 0;
unsigned int size = 0;
isc_uint16_t flags = 0;
uint16_t flags = 0;
int prepub = -1;
dns_ttl_t ttl = 0;
isc_stdtime_t now;
isc_stdtime_t pub = 0, act = 0, rev = 0, inact = 0, del = 0;
isc_stdtime_t prevact = 0, previnact = 0, prevdel = 0;
isc_boolean_t setpub = ISC_FALSE, setact = ISC_FALSE;
isc_boolean_t setrev = ISC_FALSE, setinact = ISC_FALSE;
isc_boolean_t setdel = ISC_FALSE, setttl = ISC_FALSE;
isc_boolean_t unsetpub = ISC_FALSE, unsetact = ISC_FALSE;
isc_boolean_t unsetrev = ISC_FALSE, unsetinact = ISC_FALSE;
isc_boolean_t unsetdel = ISC_FALSE;
isc_boolean_t printcreate = ISC_FALSE, printpub = ISC_FALSE;
isc_boolean_t printact = ISC_FALSE, printrev = ISC_FALSE;
isc_boolean_t printinact = ISC_FALSE, printdel = ISC_FALSE;
isc_boolean_t force = ISC_FALSE;
isc_boolean_t epoch = ISC_FALSE;
isc_boolean_t changed = ISC_FALSE;
bool setpub = false, setact = false;
bool setrev = false, setinact = false;
bool setdel = false, setttl = false;
bool unsetpub = false, unsetact = false;
bool unsetrev = false, unsetinact = false;
bool unsetdel = false;
bool printcreate = false, printpub = false;
bool printact = false, printrev = false;
bool printinact = false, printdel = false;
bool force = false;
bool epoch = false;
bool changed = false;
isc_log_t *log = NULL;
isc_stdtime_t syncadd = 0, syncdel = 0;
isc_boolean_t unsetsyncadd = ISC_FALSE, setsyncadd = ISC_FALSE;
isc_boolean_t unsetsyncdel = ISC_FALSE, setsyncdel = ISC_FALSE;
isc_boolean_t printsyncadd = ISC_FALSE, printsyncdel = ISC_FALSE;
bool unsetsyncadd = false, setsyncadd = false;
bool unsetsyncdel = false, setsyncdel = false;
bool printsyncadd = false, printsyncdel = false;
if (argc == 1)
usage();
@@ -179,7 +181,7 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
isc_stdtime_get(&now);
@@ -190,51 +192,51 @@ main(int argc, char **argv) {
engine = isc_commandline_argument;
break;
case 'f':
force = ISC_TRUE;
force = true;
break;
case 'p':
p = isc_commandline_argument;
if (!strcasecmp(p, "all")) {
printcreate = ISC_TRUE;
printpub = ISC_TRUE;
printact = ISC_TRUE;
printrev = ISC_TRUE;
printinact = ISC_TRUE;
printdel = ISC_TRUE;
printsyncadd = ISC_TRUE;
printsyncdel = ISC_TRUE;
printcreate = true;
printpub = true;
printact = true;
printrev = true;
printinact = true;
printdel = true;
printsyncadd = true;
printsyncdel = true;
break;
}
do {
switch (*p++) {
case 'C':
printcreate = ISC_TRUE;
printcreate = true;
break;
case 'P':
if (!strncmp(p, "sync", 4)) {
p += 4;
printsyncadd = ISC_TRUE;
printsyncadd = true;
break;
}
printpub = ISC_TRUE;
printpub = true;
break;
case 'A':
printact = ISC_TRUE;
printact = true;
break;
case 'R':
printrev = ISC_TRUE;
printrev = true;
break;
case 'I':
printinact = ISC_TRUE;
printinact = true;
break;
case 'D':
if (!strncmp(p, "sync", 4)) {
p += 4;
printsyncdel = ISC_TRUE;
printsyncdel = true;
break;
}
printdel = ISC_TRUE;
printdel = true;
break;
case ' ':
break;
@@ -245,7 +247,7 @@ main(int argc, char **argv) {
} while (*p != '\0');
break;
case 'u':
epoch = ISC_TRUE;
epoch = true;
break;
case 'K':
/*
@@ -261,7 +263,7 @@ main(int argc, char **argv) {
break;
case 'L':
ttl = strtottl(isc_commandline_argument);
setttl = ISC_TRUE;
setttl = true;
break;
case 'v':
verbose = strtol(isc_commandline_argument, &endp, 0);
@@ -275,7 +277,7 @@ main(int argc, char **argv) {
fatal("-P sync specified more than "
"once");
changed = ISC_TRUE;
changed = true;
syncadd = strtotime(isc_commandline_argument,
now, now, &setsyncadd);
unsetsyncadd = !setsyncadd;
@@ -285,7 +287,7 @@ main(int argc, char **argv) {
if (setpub || unsetpub)
fatal("-P specified more than once");
changed = ISC_TRUE;
changed = true;
pub = strtotime(isc_commandline_argument,
now, now, &setpub);
unsetpub = !setpub;
@@ -294,7 +296,7 @@ main(int argc, char **argv) {
if (setact || unsetact)
fatal("-A specified more than once");
changed = ISC_TRUE;
changed = true;
act = strtotime(isc_commandline_argument,
now, now, &setact);
unsetact = !setact;
@@ -303,7 +305,7 @@ main(int argc, char **argv) {
if (setrev || unsetrev)
fatal("-R specified more than once");
changed = ISC_TRUE;
changed = true;
rev = strtotime(isc_commandline_argument,
now, now, &setrev);
unsetrev = !setrev;
@@ -312,7 +314,7 @@ main(int argc, char **argv) {
if (setinact || unsetinact)
fatal("-I specified more than once");
changed = ISC_TRUE;
changed = true;
inact = strtotime(isc_commandline_argument,
now, now, &setinact);
unsetinact = !setinact;
@@ -324,7 +326,7 @@ main(int argc, char **argv) {
fatal("-D sync specified more than "
"once");
changed = ISC_TRUE;
changed = true;
syncdel = strtotime(isc_commandline_argument,
now, now, &setsyncdel);
unsetsyncdel = !setsyncdel;
@@ -335,7 +337,7 @@ main(int argc, char **argv) {
if (setdel || unsetdel)
fatal("-D specified more than once");
changed = ISC_TRUE;
changed = true;
del = strtotime(isc_commandline_argument,
now, now, &setdel);
unsetdel = !setdel;
@@ -446,7 +448,7 @@ main(int argc, char **argv) {
"before it is scheduled to be "
"inactive.\n", program);
changed = setpub = setact = ISC_TRUE;
changed = setpub = setact = true;
} else {
if (prepub < 0)
prepub = 0;
@@ -458,10 +460,10 @@ main(int argc, char **argv) {
"prepublication interval.");
if (setpub && !setact) {
setact = ISC_TRUE;
setact = true;
act = pub + prepub;
} else if (setact && !setpub) {
setpub = ISC_TRUE;
setpub = true;
pub = act - prepub;
}
@@ -592,11 +594,11 @@ main(int argc, char **argv) {
if (force && !changed) {
dst_key_settime(key, DST_TIME_PUBLISH, now);
dst_key_settime(key, DST_TIME_ACTIVATE, now);
changed = ISC_TRUE;
changed = true;
}
if (!changed && setttl)
changed = ISC_TRUE;
changed = true;
/*
* Print out time values, if -p was used.
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -13,6 +13,7 @@
#include <config.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
@@ -31,7 +32,6 @@
#include <isc/rwlock.h>
#include <isc/serial.h>
#include <isc/stdio.h>
#include <isc/stdlib.h>
#include <isc/string.h>
#include <isc/time.h>
#include <isc/util.h>
@@ -78,8 +78,8 @@ static dns_db_t *gdb; /* The database */
static dns_dbversion_t *gversion; /* The database version */
static dns_rdataclass_t gclass; /* The class */
static dns_name_t *gorigin; /* The database origin */
static isc_boolean_t ignore_kskflag = ISC_FALSE;
static isc_boolean_t keyset_kskonly = ISC_FALSE;
static bool ignore_kskflag = false;
static bool keyset_kskonly = false;
/*%
* Load the zone file from disk
@@ -198,7 +198,7 @@ main(int argc, char *argv[]) {
break;
}
}
isc_commandline_reset = ISC_TRUE;
isc_commandline_reset = true;
check_result(isc_app_start(), "isc_app_start");
result = isc_mem_create(0, 0, &mctx);
@@ -210,7 +210,7 @@ main(int argc, char *argv[]) {
#endif
dns_result_register();
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
switch (ch) {
@@ -241,11 +241,11 @@ main(int argc, char *argv[]) {
break;
case 'x':
keyset_kskonly = ISC_TRUE;
keyset_kskonly = true;
break;
case 'z':
ignore_kskflag = ISC_TRUE;
ignore_kskflag = true;
break;
case '?':
@@ -319,7 +319,7 @@ main(int argc, char *argv[]) {
result = dns_zoneverify_dnssec(NULL, gdb, gversion, gorigin, NULL,
mctx, ignore_kskflag, keyset_kskonly);
dns_db_closeversion(gdb, &gversion, ISC_FALSE);
dns_db_closeversion(gdb, &gversion, false);
dns_db_detach(&gdb);
cleanup_logging(&log);
+24 -22
View File
@@ -17,6 +17,8 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#ifdef _WIN32
@@ -221,10 +223,10 @@ time_units(isc_stdtime_t offset, char *suffix, const char *str) {
return(0); /* silence compiler warning */
}
static inline isc_boolean_t
static inline bool
isnone(const char *str) {
return (ISC_TF((strcasecmp(str, "none") == 0) ||
(strcasecmp(str, "never") == 0)));
return ((strcasecmp(str, "none") == 0) ||
(strcasecmp(str, "never") == 0));
}
dns_ttl_t
@@ -244,10 +246,10 @@ strtottl(const char *str) {
}
isc_stdtime_t
strtotime(const char *str, isc_int64_t now, isc_int64_t base,
isc_boolean_t *setp)
strtotime(const char *str, int64_t now, int64_t base,
bool *setp)
{
isc_int64_t val, offset;
int64_t val, offset;
isc_result_t result;
const char *orig = str;
char *endp;
@@ -255,12 +257,12 @@ strtotime(const char *str, isc_int64_t now, isc_int64_t base,
if (isnone(str)) {
if (setp != NULL)
*setp = ISC_FALSE;
*setp = false;
return ((isc_stdtime_t) 0);
}
if (setp != NULL)
*setp = ISC_TRUE;
*setp = true;
if ((str[0] == '0' || str[0] == '-') && str[1] == '\0')
return ((isc_stdtime_t) 0);
@@ -397,23 +399,23 @@ set_keyversion(dst_key_t *key) {
}
}
isc_boolean_t
bool
key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
isc_mem_t *mctx, isc_boolean_t *exact)
isc_mem_t *mctx, bool *exact)
{
isc_result_t result;
isc_boolean_t conflict = ISC_FALSE;
bool conflict = false;
dns_dnsseckeylist_t matchkeys;
dns_dnsseckey_t *key = NULL;
isc_uint16_t id, oldid;
isc_uint32_t rid, roldid;
uint16_t id, oldid;
uint32_t rid, roldid;
dns_secalg_t alg;
char filename[ISC_DIR_NAMEMAX];
char filename[NAME_MAX];
isc_buffer_t fileb;
isc_stdtime_t now;
if (exact != NULL)
*exact = ISC_FALSE;
*exact = false;
id = dst_key_id(dstkey);
rid = dst_key_rid(dstkey);
@@ -429,7 +431,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
result = dst_key_buildfilename(dstkey, DST_TYPE_PRIVATE,
dir, &fileb);
if (result != ISC_R_SUCCESS)
return (ISC_TRUE);
return (true);
return (isc_file_exists(filename));
}
@@ -437,7 +439,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
isc_stdtime_get(&now);
result = dns_dnssec_findmatchingkeys(name, dir, now, mctx, &matchkeys);
if (result == ISC_R_NOTFOUND)
return (ISC_FALSE);
return (false);
while (!ISC_LIST_EMPTY(matchkeys) && !conflict) {
key = ISC_LIST_HEAD(matchkeys);
@@ -448,7 +450,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
roldid = dst_key_rid(key->key);
if (oldid == rid || roldid == id || id == oldid) {
conflict = ISC_TRUE;
conflict = true;
if (id != oldid) {
if (verbose > 1)
fprintf(stderr, "Key ID %d could "
@@ -456,7 +458,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
id, oldid);
} else {
if (exact != NULL)
*exact = ISC_TRUE;
*exact = true;
if (verbose > 1)
fprintf(stderr, "Key ID %d exists\n",
id);
@@ -478,7 +480,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
return (conflict);
}
isc_boolean_t
bool
isoptarg(const char *arg, char **argv, void(*usage)(void)) {
if (!strcasecmp(isc_commandline_argument, arg)) {
if (argv[isc_commandline_index] == NULL) {
@@ -490,9 +492,9 @@ isoptarg(const char *arg, char **argv, void(*usage)(void)) {
isc_commandline_argument = argv[isc_commandline_index];
/* skip to next arguement */
isc_commandline_index++;
return (ISC_TRUE);
return (true);
}
return (ISC_FALSE);
return (false);
}
#ifdef _WIN32
+8 -5
View File
@@ -13,6 +13,9 @@
#ifndef DNSSECTOOL_H
#define DNSSECTOOL_H 1
#include <inttypes.h>
#include <stdbool.h>
#include <isc/log.h>
#include <isc/stdtime.h>
#include <dns/rdatastruct.h>
@@ -49,8 +52,8 @@ cleanup_logging(isc_log_t **logp);
dns_ttl_t strtottl(const char *str);
isc_stdtime_t
strtotime(const char *str, isc_int64_t now, isc_int64_t base,
isc_boolean_t *setp);
strtotime(const char *str, int64_t now, int64_t base,
bool *setp);
unsigned int
strtodsdigest(const char *str);
@@ -67,11 +70,11 @@ check_keyversion(dst_key_t *key, char *keystr);
void
set_keyversion(dst_key_t *key);
isc_boolean_t
bool
key_collision(dst_key_t *key, dns_name_t *name, const char *dir,
isc_mem_t *mctx, isc_boolean_t *exact);
isc_mem_t *mctx, bool *exact);
isc_boolean_t
bool
isoptarg(const char *arg, char **argv, void (*usage)(void));
#ifdef _WIN32
+2 -2
View File
@@ -70,7 +70,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
@IF PYTHON
<PostBuildEvent>
@@ -113,7 +113,7 @@ set PYTHONPATH=.
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
@IF PYTHON
<PostBuildEvent>
+2 -2
View File
@@ -70,7 +70,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
@@ -100,7 +100,7 @@
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+2 -2
View File
@@ -70,7 +70,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
@@ -100,7 +100,7 @@
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+2 -2
View File
@@ -69,7 +69,7 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
@@ -99,7 +99,7 @@
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
+2 -2
View File
@@ -70,7 +70,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
@@ -100,7 +100,7 @@
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+2 -2
View File
@@ -69,7 +69,7 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
@@ -99,7 +99,7 @@
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
+2 -2
View File
@@ -70,7 +70,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
@@ -100,7 +100,7 @@
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+2 -2
View File
@@ -69,7 +69,7 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
@@ -99,7 +99,7 @@
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
+48
View File
@@ -198,6 +198,25 @@
background-color: #99ddff;
}
table.zones {
border: 1px solid grey;
width: 500px;
}
table.zones th {
text-align: center;
border: 1px solid grey;
}
table.zones td {
text-align: center;
font-family: monospace;
}
table.zones td:nth-child(1) {
text-align: right;
}
table.zones td:nth-child(4) {
text-align: right;
}
.totals {
background-color: rgb(1,169,206);
color: #ffffff;
@@ -705,6 +724,35 @@
</table>
<br/>
</xsl:if>
<xsl:for-each select="views/view">
<xsl:if test="zones/zone">
<h3>Zones for View <xsl:value-of select="@name"/></h3>
<table class="zones">
<tr>
<th>Name</th>
<th>Class</th>
<th>Type</th>
<th>Serial</th>
</tr>
<xsl:for-each select="zones/zone">
<tr>
<td>
<xsl:value-of select="@name"/>
</td>
<td>
<xsl:value-of select="@rdataclass"/>
</td>
<td>
<xsl:value-of select="type"/>
</td>
<td>
<xsl:value-of select="serial"/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:if>
</xsl:for-each>
<xsl:if test="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
<h2>Received QTYPES per view/zone</h2>
<xsl:for-each select="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
+48
View File
@@ -203,6 +203,25 @@ static char xslmsg[] =
" background-color: #99ddff;\n"
" }\n"
"\n"
" table.zones {\n"
" border: 1px solid grey;\n"
" width: 500px;\n"
" }\n"
" table.zones th {\n"
" text-align: center;\n"
" border: 1px solid grey;\n"
" }\n"
" table.zones td {\n"
" text-align: center;\n"
" font-family: monospace;\n"
" }\n"
" table.zones td:nth-child(1) {\n"
" text-align: right;\n"
" }\n"
" table.zones td:nth-child(4) {\n"
" text-align: right;\n"
" }\n"
"\n"
" .totals {\n"
" background-color: rgb(1,169,206);\n"
" color: #ffffff;\n"
@@ -710,6 +729,35 @@ static char xslmsg[] =
" </table>\n"
" <br/>\n"
" </xsl:if>\n"
" <xsl:for-each select=\"views/view\">\n"
" <xsl:if test=\"zones/zone\">\n"
" <h3>Zones for View <xsl:value-of select=\"@name\"/></h3>\n"
" <table class=\"zones\">\n"
" <tr>\n"
" <th>Name</th>\n"
" <th>Class</th>\n"
" <th>Type</th>\n"
" <th>Serial</th>\n"
" </tr>\n"
" <xsl:for-each select=\"zones/zone\">\n"
" <tr>\n"
" <td>\n"
" <xsl:value-of select=\"@name\"/>\n"
" </td>\n"
" <td>\n"
" <xsl:value-of select=\"@rdataclass\"/>\n"
" </td>\n"
" <td>\n"
" <xsl:value-of select=\"type\"/>\n"
" </td>\n"
" <td>\n"
" <xsl:value-of select=\"serial\"/>\n"
" </td>\n"
" </tr>\n"
" </xsl:for-each>\n"
" </table>\n"
" </xsl:if>\n"
" </xsl:for-each>\n"
" <xsl:if test=\"views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]\">\n"
" <h2>Received QTYPES per view/zone</h2>\n"
" <xsl:for-each select=\"views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]\">\n"
+44 -21
View File
@@ -13,6 +13,7 @@
#include <config.h>
#include <inttypes.h>
#include <stdlib.h>
#include <isc/buffer.h>
@@ -173,6 +174,8 @@ options {\n\
max-recursion-queries 75;\n\
max-stale-ttl 604800; /* 1 week */\n\
message-compression yes;\n\
min-ncache-ttl 0; /* 0 hours */\n\
min-cache-ttl 0; /* 0 seconds */\n\
# min-roots <obsolete>;\n\
minimal-any false;\n\
minimal-responses no-auth-recursive;\n\
@@ -300,6 +303,21 @@ view \"_bind\" chaos {\n\
MANAGED_KEYS
"# END MANAGED KEYS\n\
\n\
masters " DEFAULT_IANA_ROOT_ZONE_MASTERS " {\n\
2001:500:84::b; # b.root-servers.net\n\
2001:500:2f::f; # f.root-servers.net\n\
2001:7fd::1; # k.root-servers.net\n\
2620:0:2830:202::132; # xfr.cjr.dns.icann.org\n\
2620:0:2d0:202::132; # xfr.lax.dns.icann.org\n\
192.228.79.201; # b.root-servers.net\n\
192.33.4.12; # c.root-servers.net\n\
192.5.5.241; # f.root-servers.net\n\
192.112.36.4; # g.root-servers.net\n\
193.0.14.129; # k.root-servers.net\n\
192.0.47.132; # xfr.cjr.dns.icann.org\n\
192.0.32.132; # xfr.lax.dns.icann.org\n\
};\n\
";
isc_result_t
@@ -431,6 +449,8 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) {
strcasecmp(str, "slave") == 0)
{
ztype = dns_zone_slave;
} else if (strcasecmp(str, "mirror") == 0) {
ztype = dns_zone_mirror;
} else if (strcasecmp(str, "stub") == 0) {
ztype = dns_zone_stub;
} else if (strcasecmp(str, "static-stub") == 0) {
@@ -439,6 +459,7 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) {
ztype = dns_zone_redirect;
} else {
INSIST(0);
ISC_UNREACHABLE();
}
return (ztype);
}
@@ -447,7 +468,7 @@ isc_result_t
named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
in_port_t defport, isc_mem_t *mctx,
isc_sockaddr_t **addrsp, isc_dscp_t **dscpsp,
isc_uint32_t *countp)
uint32_t *countp)
{
int count, i = 0;
const cfg_obj_t *addrlist;
@@ -467,8 +488,8 @@ named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
portobj = cfg_tuple_get(list, "port");
if (cfg_obj_isuint32(portobj)) {
isc_uint32_t val = cfg_obj_asuint32(portobj);
if (val > ISC_UINT16_MAX) {
uint32_t val = cfg_obj_asuint32(portobj);
if (val > UINT16_MAX) {
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR,
"port '%u' out of range", val);
return (ISC_R_RANGE);
@@ -538,7 +559,7 @@ named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
void
named_config_putiplist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
isc_dscp_t **dscpsp, isc_uint32_t count)
isc_dscp_t **dscpsp, uint32_t count)
{
INSIST(addrsp != NULL && *addrsp != NULL);
INSIST(dscpsp == NULL || *dscpsp != NULL);
@@ -552,9 +573,9 @@ named_config_putiplist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
}
}
static isc_result_t
get_masters_def(const cfg_obj_t *cctx, const char *name,
const cfg_obj_t **ret)
isc_result_t
named_config_getmastersdef(const cfg_obj_t *cctx, const char *name,
const cfg_obj_t **ret)
{
isc_result_t result;
const cfg_obj_t *masters = NULL;
@@ -584,9 +605,9 @@ isc_result_t
named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
isc_mem_t *mctx, dns_ipkeylist_t *ipkl)
{
isc_uint32_t addrcount = 0, dscpcount = 0, keycount = 0, i = 0;
isc_uint32_t listcount = 0, l = 0, j;
isc_uint32_t stackcount = 0, pushed = 0;
uint32_t addrcount = 0, dscpcount = 0, keycount = 0, i = 0;
uint32_t listcount = 0, l = 0, j;
uint32_t stackcount = 0, pushed = 0;
isc_result_t result;
const cfg_listelt_t *element;
const cfg_obj_t *addrlist;
@@ -630,8 +651,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
dscpobj = cfg_tuple_get(list, "dscp");
if (cfg_obj_isuint32(portobj)) {
isc_uint32_t val = cfg_obj_asuint32(portobj);
if (val > ISC_UINT16_MAX) {
uint32_t val = cfg_obj_asuint32(portobj);
if (val > UINT16_MAX) {
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR,
"port '%u' out of range", val);
result = ISC_R_RANGE;
@@ -675,7 +696,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
/* Grow lists? */
if (listcount == l) {
void * tmp;
isc_uint32_t newlen = listcount + 16;
uint32_t newlen = listcount + 16;
size_t newsize, oldsize;
newsize = newlen * sizeof(*lists);
@@ -696,7 +717,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
break;
if (j < l)
continue;
tresult = get_masters_def(config, listname, &list);
tresult = named_config_getmastersdef(config, listname,
&list);
if (tresult == ISC_R_NOTFOUND) {
cfg_obj_log(addr, named_g_lctx, ISC_LOG_ERROR,
"masters \"%s\" not found", listname);
@@ -710,7 +732,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
/* Grow stack? */
if (stackcount == pushed) {
void * tmp;
isc_uint32_t newlen = stackcount + 16;
uint32_t newlen = stackcount + 16;
size_t newsize, oldsize;
newsize = newlen * sizeof(*stack);
@@ -738,7 +760,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
if (i == addrcount) {
void * tmp;
isc_uint32_t newlen = addrcount + 16;
uint32_t newlen = addrcount + 16;
size_t newsize, oldsize;
newsize = newlen * sizeof(isc_sockaddr_t);
@@ -911,7 +933,7 @@ named_config_getport(const cfg_obj_t *config, in_port_t *portp) {
result = named_config_get(maps, "port", &portobj);
INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_asuint32(portobj) >= ISC_UINT16_MAX) {
if (cfg_obj_asuint32(portobj) >= UINT16_MAX) {
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR,
"port '%u' out of range",
cfg_obj_asuint32(portobj));
@@ -951,7 +973,7 @@ struct keyalgorithms {
enum { hmacnone, hmacmd5, hmacsha1, hmacsha224,
hmacsha256, hmacsha384, hmacsha512 } hmac;
unsigned int type;
isc_uint16_t size;
uint16_t size;
} algorithms[] = {
{ "hmac-md5", hmacmd5, DST_ALG_HMACMD5, 128 },
{ "hmac-md5.sig-alg.reg.int", hmacmd5, DST_ALG_HMACMD5, 0 },
@@ -966,18 +988,18 @@ struct keyalgorithms {
isc_result_t
named_config_getkeyalgorithm(const char *str, const dns_name_t **name,
isc_uint16_t *digestbits)
uint16_t *digestbits)
{
return (named_config_getkeyalgorithm2(str, name, NULL, digestbits));
}
isc_result_t
named_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
unsigned int *typep, isc_uint16_t *digestbits)
unsigned int *typep, uint16_t *digestbits)
{
int i;
size_t len = 0;
isc_uint16_t bits;
uint16_t bits;
isc_result_t result;
for (i = 0; algorithms[i].str != NULL; i++) {
@@ -1010,6 +1032,7 @@ named_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
case hmacsha512: *name = dns_tsig_hmacsha512_name; break;
default:
INSIST(0);
ISC_UNREACHABLE();
}
}
if (typep != NULL)
+10 -9
View File
@@ -14,6 +14,7 @@
#include <config.h>
#include <stdbool.h>
#include <isc/app.h>
#include <isc/event.h>
@@ -59,9 +60,9 @@ getcommand(isc_lex_t *lex, char **cmdp) {
return (ISC_R_SUCCESS);
}
static inline isc_boolean_t
static inline bool
command_compare(const char *str, const char *command) {
return ISC_TF(strcasecmp(str, command) == 0);
return (strcasecmp(str, command) == 0);
}
/*%
@@ -69,7 +70,7 @@ command_compare(const char *str, const char *command) {
* when a control channel message is received.
*/
isc_result_t
named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
named_control_docommand(isccc_sexpr_t *message, bool readonly,
isc_buffer_t **text)
{
isccc_sexpr_t *data;
@@ -184,7 +185,7 @@ named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
*/
#endif
/* Do not flush master files */
named_server_flushonshutdown(named_g_server, ISC_FALSE);
named_server_flushonshutdown(named_g_server, false);
named_os_shutdownmsg(cmdline, *text);
isc_app_shutdown();
result = ISC_R_SUCCESS;
@@ -201,7 +202,7 @@ named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
if (named_smf_got_instance == 1 && named_smf_chroot == 0)
named_smf_want_disable = 1;
#endif
named_server_flushonshutdown(named_g_server, ISC_TRUE);
named_server_flushonshutdown(named_g_server, true);
named_os_shutdownmsg(cmdline, *text);
isc_app_shutdown();
result = ISC_R_SUCCESS;
@@ -223,9 +224,9 @@ named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
} else if (command_compare(command, NAMED_COMMAND_FLUSH)) {
result = named_server_flushcache(named_g_server, lex);
} else if (command_compare(command, NAMED_COMMAND_FLUSHNAME)) {
result = named_server_flushnode(named_g_server, lex, ISC_FALSE);
result = named_server_flushnode(named_g_server, lex, false);
} else if (command_compare(command, NAMED_COMMAND_FLUSHTREE)) {
result = named_server_flushnode(named_g_server, lex, ISC_TRUE);
result = named_server_flushnode(named_g_server, lex, true);
} else if (command_compare(command, NAMED_COMMAND_STATUS)) {
result = named_server_status(named_g_server, text);
} else if (command_compare(command, NAMED_COMMAND_TSIGLIST)) {
@@ -233,11 +234,11 @@ named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
} else if (command_compare(command, NAMED_COMMAND_TSIGDELETE)) {
result = named_server_tsigdelete(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_FREEZE)) {
result = named_server_freeze(named_g_server, ISC_TRUE, lex,
result = named_server_freeze(named_g_server, true, lex,
text);
} else if (command_compare(command, NAMED_COMMAND_UNFREEZE) ||
command_compare(command, NAMED_COMMAND_THAW)) {
result = named_server_freeze(named_g_server, ISC_FALSE, lex,
result = named_server_freeze(named_g_server, false, lex,
text);
} else if (command_compare(command, NAMED_COMMAND_SCAN)) {
result = ISC_R_SUCCESS;
+36 -37
View File
@@ -13,6 +13,9 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/event.h>
@@ -65,7 +68,7 @@ typedef ISC_LIST(controllistener_t) controllistenerlist_t;
struct controlkey {
char * keyname;
isc_uint32_t algorithm;
uint32_t algorithm;
isc_region_t secret;
ISC_LINK(controlkey_t) link;
};
@@ -73,12 +76,12 @@ struct controlkey {
struct controlconnection {
isc_socket_t * sock;
isccc_ccmsg_t ccmsg;
isc_boolean_t ccmsg_valid;
isc_boolean_t sending;
bool ccmsg_valid;
bool sending;
isc_timer_t * timer;
isc_buffer_t * buffer;
controllistener_t * listener;
isc_uint32_t nonce;
uint32_t nonce;
ISC_LINK(controlconnection_t) link;
};
@@ -89,22 +92,22 @@ struct controllistener {
isc_sockaddr_t address;
isc_socket_t * sock;
dns_acl_t * acl;
isc_boolean_t listening;
isc_boolean_t exiting;
bool listening;
bool exiting;
controlkeylist_t keys;
controlconnectionlist_t connections;
isc_sockettype_t type;
isc_uint32_t perm;
isc_uint32_t owner;
isc_uint32_t group;
isc_boolean_t readonly;
uint32_t perm;
uint32_t owner;
uint32_t group;
bool readonly;
ISC_LINK(controllistener_t) link;
};
struct named_controls {
named_server_t *server;
controllistenerlist_t listeners;
isc_boolean_t shuttingdown;
bool shuttingdown;
isccc_symtab_t *symtab;
};
@@ -202,8 +205,8 @@ shutdown_listener(controllistener_t *listener) {
NAMED_LOGMODULE_CONTROL, ISC_LOG_NOTICE,
"stopping command channel on %s", socktext);
if (listener->type == isc_sockettype_unix)
isc_socket_cleanunix(&listener->address, ISC_TRUE);
listener->exiting = ISC_TRUE;
isc_socket_cleanunix(&listener->address, true);
listener->exiting = true;
}
for (conn = ISC_LIST_HEAD(listener->connections);
@@ -221,7 +224,7 @@ shutdown_listener(controllistener_t *listener) {
maybe_free_listener(listener);
}
static isc_boolean_t
static bool
address_ok(isc_sockaddr_t *sockaddr, dns_acl_t *acl) {
dns_aclenv_t *env =
ns_interfacemgr_getaclenv(named_g_server->interfacemgr);
@@ -232,11 +235,7 @@ address_ok(isc_sockaddr_t *sockaddr, dns_acl_t *acl) {
isc_netaddr_fromsockaddr(&netaddr, sockaddr);
result = dns_acl_match(&netaddr, NULL, acl, env, &match, NULL);
if (result != ISC_R_SUCCESS || match <= 0) {
return (ISC_FALSE);
} else {
return (ISC_TRUE);
}
return (result == ISC_R_SUCCESS && match > 0);
}
static isc_result_t
@@ -250,7 +249,7 @@ control_accept(controllistener_t *listener) {
"isc_socket_accept() failed: %s",
isc_result_totext(result));
else
listener->listening = ISC_TRUE;
listener->listening = true;
return (result);
}
@@ -283,7 +282,7 @@ control_senddone(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
conn->sending = ISC_FALSE;
conn->sending = false;
if (sevent->result != ISC_R_SUCCESS &&
sevent->result != ISC_R_CANCELED)
@@ -329,7 +328,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
controlkey_t *key = NULL;
isccc_sexpr_t *request = NULL;
isccc_sexpr_t *response = NULL;
isc_uint32_t algorithm;
uint32_t algorithm;
isccc_region_t secret;
isc_stdtime_t now;
isc_buffer_t b;
@@ -340,7 +339,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
isccc_sexpr_t *_ctrl = NULL;
isccc_time_t sent;
isccc_time_t exp;
isc_uint32_t nonce;
uint32_t nonce;
isccc_sexpr_t *data = NULL;
REQUIRE(event->ev_type == ISCCC_EVENT_CCMSG);
@@ -520,7 +519,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
result = isc_socket_send(conn->sock, &r, task, control_senddone, conn);
if (result != ISC_R_SUCCESS)
goto cleanup_response;
conn->sending = ISC_TRUE;
conn->sending = true;
isc_mem_put(listener->mctx, secret.rstart, REGION_SIZE(secret));
isccc_sexpr_free(&request);
@@ -540,7 +539,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
cleanup:
isc_socket_detach(&conn->sock);
isccc_ccmsg_invalidate(&conn->ccmsg);
conn->ccmsg_valid = ISC_FALSE;
conn->ccmsg_valid = false;
maybe_free_connection(conn);
maybe_free_listener(listener);
}
@@ -573,8 +572,8 @@ newconnection(controllistener_t *listener, isc_socket_t *sock) {
/* Set a 32 KiB upper limit on incoming message. */
isccc_ccmsg_setmaxsize(&conn->ccmsg, 32768);
conn->ccmsg_valid = ISC_TRUE;
conn->sending = ISC_FALSE;
conn->ccmsg_valid = true;
conn->sending = false;
conn->buffer = NULL;
conn->timer = NULL;
isc_interval_set(&interval, 60, 0);
@@ -621,7 +620,7 @@ control_newconn(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
listener->listening = ISC_FALSE;
listener->listening = false;
if (nevent->result != ISC_R_SUCCESS) {
if (nevent->result == ISC_R_CANCELED) {
@@ -685,7 +684,7 @@ controls_shutdown(named_controls_t *controls) {
void
named_controls_shutdown(named_controls_t *controls) {
controls_shutdown(controls);
controls->shuttingdown = ISC_TRUE;
controls->shuttingdown = true;
}
static isc_result_t
@@ -1091,7 +1090,7 @@ update_listener(named_controls_t *cp, controllistener_t **listenerp,
socktext, isc_result_totext(result));
if (result == ISC_R_SUCCESS && type == isc_sockettype_unix) {
isc_uint32_t perm, owner, group;
uint32_t perm, owner, group;
perm = cfg_obj_asuint32(cfg_tuple_get(control, "perm"));
owner = cfg_obj_asuint32(cfg_tuple_get(control, "owner"));
group = cfg_obj_asuint32(cfg_tuple_get(control, "group"));
@@ -1138,14 +1137,14 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
listener->task = cp->server->task;
listener->address = *addr;
listener->sock = NULL;
listener->listening = ISC_FALSE;
listener->exiting = ISC_FALSE;
listener->listening = false;
listener->exiting = false;
listener->acl = NULL;
listener->type = type;
listener->perm = 0;
listener->owner = 0;
listener->group = 0;
listener->readonly = ISC_FALSE;
listener->readonly = false;
ISC_LINK_INIT(listener, link);
ISC_LIST_INIT(listener->keys);
ISC_LIST_INIT(listener->connections);
@@ -1208,7 +1207,7 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
}
if (result == ISC_R_SUCCESS && type == isc_sockettype_unix)
isc_socket_cleanunix(&listener->address, ISC_FALSE);
isc_socket_cleanunix(&listener->address, false);
if (result == ISC_R_SUCCESS)
result = isc_socket_create(named_g_socketmgr,
@@ -1219,7 +1218,7 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
#ifndef ISC_ALLOW_MAPPED
if (result == ISC_R_SUCCESS)
isc_socket_ipv6only(listener->sock, ISC_TRUE);
isc_socket_ipv6only(listener->sock, true);
#endif
if (result == ISC_R_SUCCESS)
@@ -1250,7 +1249,7 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
} else {
if (listener != NULL) {
listener->exiting = ISC_TRUE;
listener->exiting = true;
free_listener(listener);
}
@@ -1510,7 +1509,7 @@ named_controls_create(named_server_t *server, named_controls_t **ctrlsp) {
return (ISC_R_NOMEMORY);
controls->server = server;
ISC_LIST_INIT(controls->listeners);
controls->shuttingdown = ISC_FALSE;
controls->shuttingdown = false;
controls->symtab = NULL;
result = isccc_cc_createsymtab(&controls->symtab);
if (result != ISC_R_SUCCESS) {
+30 -25
View File
@@ -9,7 +9,10 @@
* information regarding copyright ownership.
*/
#include "config.h"
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <named/fuzz.h>
@@ -33,10 +36,6 @@
#include <unistd.h>
#include <pthread.h>
#ifndef __AFL_LOOP
#error To use American Fuzzy Lop you have to set CC to afl-clang-fast!!!
#endif
/*
* We are using pthreads directly because we might be using it with
* unthreaded version of BIND, where all thread functions are
@@ -44,7 +43,7 @@
*/
static pthread_cond_t cond;
static pthread_mutex_t mutex;
static isc_boolean_t ready;
static bool ready;
/*
* In "client:" mode, this thread reads fuzzed query messages from AFL
@@ -58,7 +57,6 @@ fuzz_thread_client(void *arg) {
char *port;
struct sockaddr_in servaddr;
int sockfd;
int loop;
void *buf;
UNUSED(arg);
@@ -100,14 +98,18 @@ fuzz_thread_client(void *arg) {
* Processing fuzzed packets 100,000 times before shutting down
* the app.
*/
for (loop = 0; loop < 100000; loop++) {
#ifdef __AFL_LOOP
for (int loop = 0; loop < 100000; loop++) {
#else
{
#endif
ssize_t length;
ssize_t sent;
length = read(0, buf, 65536);
if (length <= 0) {
usleep(1000000);
continue;
goto next;
}
/*
@@ -122,17 +124,17 @@ fuzz_thread_client(void *arg) {
free(buf);
close(sockfd);
named_server_flushonshutdown(named_g_server,
ISC_FALSE);
false);
isc_app_shutdown();
return (NULL);
}
raise(SIGSTOP);
continue;
goto next;
}
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
ready = ISC_FALSE;
ready = false;
sent = sendto(sockfd, buf, length, 0,
(struct sockaddr *) &servaddr, sizeof(servaddr));
@@ -148,12 +150,13 @@ fuzz_thread_client(void *arg) {
pthread_cond_wait(&cond, &mutex);
RUNTIME_CHECK(pthread_mutex_unlock(&mutex) == 0);
next: ;
}
free(buf);
close(sockfd);
named_server_flushonshutdown(named_g_server, ISC_FALSE);
named_server_flushonshutdown(named_g_server, false);
isc_app_shutdown();
return (NULL);
@@ -200,7 +203,7 @@ fuzz_thread_resolver(void *arg) {
* have to be updated. 0x8d, 0xf6 at the start is the ID field
* which will be made to match the query.
*/
const isc_uint8_t dnskey_wf[] = {
const uint8_t dnskey_wf[] = {
0x8d, 0xf6, 0x84, 0x00, 0x00, 0x01, 0x00, 0x02,
0x00, 0x00, 0x00, 0x01, 0x07, 0x65, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x00, 0x00, 0x30, 0x00,
@@ -282,12 +285,12 @@ fuzz_thread_resolver(void *arg) {
int sockfd;
int listenfd;
int loop;
isc_uint16_t qtype;
uint16_t qtype;
char *buf, *rbuf;
char *nameptr;
unsigned int i;
isc_uint8_t llen;
isc_uint64_t seed;
uint8_t llen;
uint64_t seed;
UNUSED(arg);
@@ -385,7 +388,7 @@ fuzz_thread_resolver(void *arg) {
close(sockfd);
close(listenfd);
named_server_flushonshutdown(named_g_server,
ISC_FALSE);
false);
isc_app_shutdown();
return (NULL);
}
@@ -399,7 +402,7 @@ fuzz_thread_resolver(void *arg) {
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
ready = ISC_FALSE;
ready = false;
/* Use a unique query ID. */
seed = 1664525 * seed + 1013904223;
@@ -549,7 +552,7 @@ fuzz_thread_resolver(void *arg) {
* "example."
*/
if ((nameptr - buf) < (length - 2)) {
isc_uint8_t hb, lb;
uint8_t hb, lb;
hb = *nameptr++;
lb = *nameptr++;
qtype = (hb << 8) | lb;
@@ -580,9 +583,10 @@ fuzz_thread_resolver(void *arg) {
free(rbuf);
close(sockfd);
close(listenfd);
named_server_flushonshutdown(named_g_server, ISC_FALSE);
named_server_flushonshutdown(named_g_server, false);
isc_app_shutdown();
#ifdef __AFL_LOOP
/*
* This is here just for the signature, that's how AFL detects
* if it's a 'persistent mode' binary. It has to occur somewhere
@@ -591,6 +595,7 @@ fuzz_thread_resolver(void *arg) {
* in persistent mode if it's present.
*/
__AFL_LOOP(0);
#endif
return (NULL);
}
@@ -687,7 +692,7 @@ fuzz_thread_tcp(void *arg) {
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
ready = ISC_FALSE;
ready = false;
yes = 1;
sockfd = socket(AF_INET, SOCK_STREAM, 0);
@@ -718,7 +723,7 @@ fuzz_thread_tcp(void *arg) {
free(buf);
close(sockfd);
named_server_flushonshutdown(named_g_server, ISC_FALSE);
named_server_flushonshutdown(named_g_server, false);
isc_app_shutdown();
return (NULL);
@@ -735,7 +740,7 @@ void
named_fuzz_notify(void) {
#ifdef ENABLE_AFL
if (getenv("AFL_CMIN")) {
named_server_flushonshutdown(named_g_server, ISC_FALSE);
named_server_flushonshutdown(named_g_server, false);
isc_app_shutdown();
return;
}
@@ -744,7 +749,7 @@ named_fuzz_notify(void) {
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
ready = ISC_TRUE;
ready = true;
RUNTIME_CHECK(pthread_cond_signal(&cond) == 0);
RUNTIME_CHECK(pthread_mutex_unlock(&mutex) == 0);
+12 -4
View File
@@ -15,11 +15,15 @@
/*! \file */
#include <inttypes.h>
#include <isccfg/cfg.h>
#include <dns/types.h>
#include <dns/zone.h>
#define DEFAULT_IANA_ROOT_ZONE_MASTERS "_default_iana_root_zone_masters"
isc_result_t
named_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf);
@@ -49,11 +53,15 @@ isc_result_t
named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
in_port_t defport, isc_mem_t *mctx,
isc_sockaddr_t **addrsp, isc_dscp_t **dscpsp,
isc_uint32_t *countp);
uint32_t *countp);
void
named_config_putiplist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
isc_dscp_t **dscpsp, isc_uint32_t count);
isc_dscp_t **dscpsp, uint32_t count);
isc_result_t
named_config_getmastersdef(const cfg_obj_t *cctx, const char *name,
const cfg_obj_t **ret);
isc_result_t
named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
@@ -64,10 +72,10 @@ named_config_getport(const cfg_obj_t *config, in_port_t *portp);
isc_result_t
named_config_getkeyalgorithm(const char *str, const dns_name_t **name,
isc_uint16_t *digestbits);
uint16_t *digestbits);
isc_result_t
named_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
unsigned int *typep, isc_uint16_t *digestbits);
unsigned int *typep, uint16_t *digestbits);
isc_result_t
named_config_getdscp(const cfg_obj_t *config, isc_dscp_t *dscpp);
+3 -1
View File
@@ -17,6 +17,8 @@
* The name server command channel.
*/
#include <stdbool.h>
#include <isccc/types.h>
#include <isccfg/aclconf.h>
@@ -101,7 +103,7 @@ named_controls_shutdown(named_controls_t *controls);
*/
isc_result_t
named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
named_control_docommand(isccc_sexpr_t *message, bool readonly,
isc_buffer_t **text);
#endif /* NAMED_CONTROL_H */
+11 -9
View File
@@ -14,6 +14,8 @@
/*! \file */
#include <stdbool.h>
#include <isc/rwlock.h>
#include <isc/log.h>
#include <isc/net.h>
@@ -51,7 +53,7 @@ EXTERN dns_dispatchmgr_t * named_g_dispatchmgr INIT(NULL);
EXTERN unsigned int named_g_cpus_detected INIT(1);
#ifdef ENABLE_AFL
EXTERN isc_boolean_t named_g_run_done INIT(ISC_FALSE);
EXTERN bool named_g_run_done INIT(false);
#endif
/*
* XXXRTH We're going to want multiple timer managers eventually. One
@@ -94,7 +96,7 @@ EXTERN const char * named_g_keyfile INIT(NAMED_SYSCONFDIR
EXTERN dns_tsigkey_t * named_g_sessionkey INIT(NULL);
EXTERN dns_name_t named_g_sessionkeyname;
EXTERN isc_boolean_t named_g_conffileset INIT(ISC_FALSE);
EXTERN bool named_g_conffileset INIT(false);
EXTERN cfg_aclconfctx_t * named_g_aclconfctx INIT(NULL);
/*
@@ -108,11 +110,11 @@ EXTERN isc_resourcevalue_t named_g_initopenfiles INIT(0);
/*
* Misc.
*/
EXTERN isc_boolean_t named_g_coreok INIT(ISC_TRUE);
EXTERN bool named_g_coreok INIT(true);
EXTERN const char * named_g_chrootdir INIT(NULL);
EXTERN isc_boolean_t named_g_foreground INIT(ISC_FALSE);
EXTERN isc_boolean_t named_g_logstderr INIT(ISC_FALSE);
EXTERN isc_boolean_t named_g_nosyslog INIT(ISC_FALSE);
EXTERN bool named_g_foreground INIT(false);
EXTERN bool named_g_logstderr INIT(false);
EXTERN bool named_g_nosyslog INIT(false);
EXTERN const char * named_g_logfile INIT(NULL);
EXTERN const char * named_g_defaultsessionkeyfile
@@ -121,7 +123,7 @@ EXTERN const char * named_g_defaultsessionkeyfile
EXTERN const char * named_g_defaultlockfile INIT(NAMED_LOCALSTATEDIR
"/run/named/"
"named.lock");
EXTERN isc_boolean_t named_g_forcelock INIT(ISC_FALSE);
EXTERN bool named_g_forcelock INIT(false);
#if NAMED_RUN_PID_DIR
EXTERN const char * named_g_defaultpidfile INIT(NAMED_LOCALSTATEDIR
@@ -146,8 +148,8 @@ EXTERN const char * named_g_engine INIT(NULL);
EXTERN isc_time_t named_g_boottime;
EXTERN isc_time_t named_g_configtime;
EXTERN isc_boolean_t named_g_memstatistics INIT(ISC_FALSE);
EXTERN isc_boolean_t named_g_keepstderr INIT(ISC_FALSE);
EXTERN bool named_g_memstatistics INIT(false);
EXTERN bool named_g_keepstderr INIT(false);
EXTERN unsigned int named_g_tat_interval INIT(24*3600);
+1 -1
View File
@@ -34,7 +34,7 @@
#define NAMED_LOGMODULE_CONTROL (&named_g_modules[2])
isc_result_t
named_log_init(isc_boolean_t safe);
named_log_init(bool safe);
/*%
* Initialize the logging system and set up an initial default
* logging default configuration that will be used until the
+14 -11
View File
@@ -14,6 +14,9 @@
/*! \file */
#include <inttypes.h>
#include <stdbool.h>
#include <isc/log.h>
#include <isc/magic.h>
#include <isc/quota.h>
@@ -53,9 +56,9 @@ struct named_server {
char * secrootsfile; /*%< Secroots file name */
char * bindkeysfile; /*%< bind.keys file name */
char * recfile; /*%< Recursive file name */
isc_boolean_t version_set; /*%< User has set version */
bool version_set; /*%< User has set version */
char * version; /*%< User-specified version */
isc_boolean_t hostname_set; /*%< User has set hostname */
bool hostname_set; /*%< User has set hostname */
char * hostname; /*%< User-specified hostname */
/* Server data structures. */
@@ -70,13 +73,13 @@ struct named_server {
isc_timer_t * pps_timer;
isc_timer_t * tat_timer;
isc_uint32_t interface_interval;
isc_uint32_t heartbeat_interval;
uint32_t interface_interval;
uint32_t heartbeat_interval;
isc_mutex_t reload_event_lock;
isc_event_t * reload_event;
isc_boolean_t flushonshutdown;
bool flushonshutdown;
named_cachelist_t cachelist; /*%< Possibly shared caches */
isc_stats_t * zonestats; /*% Zone management stats */
@@ -93,8 +96,8 @@ struct named_server {
char *session_keyfile;
dns_name_t *session_keyname;
unsigned int session_keyalg;
isc_uint16_t session_keybits;
isc_boolean_t interface_auto;
uint16_t session_keybits;
bool interface_auto;
unsigned char secret[32]; /*%< Server Cookie Secret */
ns_cookiealg_t cookiealg;
@@ -137,7 +140,7 @@ named_server_scan_interfaces(named_server_t *server);
*/
void
named_server_flushonshutdown(named_server_t *server, isc_boolean_t flush);
named_server_flushonshutdown(named_server_t *server, bool flush);
/*%<
* Inform the server that the zones should be flushed to disk on shutdown.
*/
@@ -234,7 +237,7 @@ named_server_flushcache(named_server_t *server, isc_lex_t *lex);
*/
isc_result_t
named_server_flushnode(named_server_t *server, isc_lex_t *lex,
isc_boolean_t tree);
bool tree);
/*%
* Report the server's status.
@@ -259,7 +262,7 @@ named_server_tsigdelete(named_server_t *server, isc_lex_t *lex,
* Enable or disable updates for a zone.
*/
isc_result_t
named_server_freeze(named_server_t *server, isc_boolean_t freeze,
named_server_freeze(named_server_t *server, bool freeze,
isc_lex_t *lex, isc_buffer_t **text);
/*%
@@ -339,7 +342,7 @@ named_server_zonestatus(named_server_t *server, isc_lex_t *lex,
*/
isc_result_t
named_server_nta(named_server_t *server, isc_lex_t *lex,
isc_boolean_t readonly, isc_buffer_t **text);
bool readonly, isc_buffer_t **text);
/*%
* Generates a test sequence that is only for use in system tests. The
+5 -3
View File
@@ -14,6 +14,8 @@
/*! \file */
#include <stdbool.h>
#include <isc/lang.h>
#include <isc/types.h>
@@ -41,13 +43,13 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
* \li 'zone' to be initialized.
*/
isc_boolean_t
bool
named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig);
/*%<
* If 'zone' can be safely reconfigured according to the configuration
* data in 'zconfig', return ISC_TRUE. If the configuration data is so
* data in 'zconfig', return true. If the configuration data is so
* different from the current zone state that the zone needs to be destroyed
* and recreated, return ISC_FALSE.
* and recreated, return false.
*/
isc_result_t
+1 -1
View File
@@ -50,7 +50,7 @@ static isc_logmodule_t modules[] = {
};
isc_result_t
named_log_init(isc_boolean_t safe) {
named_log_init(bool safe) {
isc_result_t result;
isc_logconfig_t *lcfg = NULL;
+10 -6
View File
@@ -13,6 +13,9 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <isc/file.h>
#include <isc/offset.h>
#include <isc/print.h>
@@ -136,10 +139,10 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
cfg_tuple_get(fileobj, "versions");
const cfg_obj_t *suffixobj =
cfg_tuple_get(fileobj, "suffix");
isc_int32_t versions = ISC_LOG_ROLLNEVER;
int32_t versions = ISC_LOG_ROLLNEVER;
isc_log_rollsuffix_t suffix = isc_log_rollsuffix_increment;
isc_offset_t size = 0;
isc_uint64_t maxoffset;
uint64_t maxoffset;
/*
* isc_offset_t is a signed integer type, so the maximum
@@ -154,6 +157,7 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
break;
default:
INSIST(0);
ISC_UNREACHABLE();
}
type = ISC_LOG_TOFILE;
@@ -302,8 +306,8 @@ named_logconfig(isc_logconfig_t *logconfig, const cfg_obj_t *logstmt) {
const cfg_obj_t *channels = NULL;
const cfg_obj_t *categories = NULL;
const cfg_listelt_t *element;
isc_boolean_t default_set = ISC_FALSE;
isc_boolean_t unmatched_set = ISC_FALSE;
bool default_set = false;
bool unmatched_set = false;
const cfg_obj_t *catname;
if (logconfig != NULL)
@@ -328,12 +332,12 @@ named_logconfig(isc_logconfig_t *logconfig, const cfg_obj_t *logstmt) {
if (!default_set) {
catname = cfg_tuple_get(category, "name");
if (strcmp(cfg_obj_asstring(catname), "default") == 0)
default_set = ISC_TRUE;
default_set = true;
}
if (!unmatched_set) {
catname = cfg_tuple_get(category, "name");
if (strcmp(cfg_obj_asstring(catname), "unmatched") == 0)
unmatched_set = ISC_TRUE;
unmatched_set = true;
}
}
+111 -117
View File
@@ -14,6 +14,8 @@
#include <config.h>
#include <ctype.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
@@ -107,9 +109,9 @@ LIBDNS_EXTERNAL_DATA extern unsigned int dns_zone_mkey_hour;
LIBDNS_EXTERNAL_DATA extern unsigned int dns_zone_mkey_day;
LIBDNS_EXTERNAL_DATA extern unsigned int dns_zone_mkey_month;
static isc_boolean_t want_stats = ISC_FALSE;
static char program_name[ISC_DIR_NAMEMAX] = "named";
static char absolute_conffile[ISC_DIR_PATHMAX];
static bool want_stats = false;
static char program_name[NAME_MAX] = "named";
static char absolute_conffile[PATH_MAX];
static char saved_command_line[512];
static char version[512];
static unsigned int maxsocks = 0;
@@ -118,22 +120,25 @@ static int maxudp = 0;
/*
* -T options:
*/
static isc_boolean_t clienttest = ISC_FALSE;
static isc_boolean_t dropedns = ISC_FALSE;
static isc_boolean_t noedns = ISC_FALSE;
static isc_boolean_t nosoa = ISC_FALSE;
static isc_boolean_t noaa = ISC_FALSE;
static bool clienttest = false;
static bool dropedns = false;
static bool ednsformerr = false;
static bool ednsnotimp = false;
static bool ednsrefused = false;
static bool fixedlocal = false;
static bool noaa = false;
static bool noedns = false;
static bool nonearest = false;
static bool nosoa = false;
static bool notcp = false;
static bool sigvalinsecs = false;
static unsigned int delay = 0;
static isc_boolean_t nonearest = ISC_FALSE;
static isc_boolean_t notcp = ISC_FALSE;
static isc_boolean_t fixedlocal = ISC_FALSE;
static isc_boolean_t sigvalinsecs = ISC_FALSE;
/*
* -4 and -6
*/
static isc_boolean_t disable6 = ISC_FALSE;
static isc_boolean_t disable4 = ISC_FALSE;
static bool disable6 = false;
static bool disable4 = false;
void
named_main_earlywarning(const char *format, ...) {
@@ -336,7 +341,7 @@ save_command_line(int argc, char *argv[]) {
char *dst;
char *eob;
const char truncated[] = "...";
isc_boolean_t quoted = ISC_FALSE;
bool quoted = false;
dst = saved_command_line;
eob = saved_command_line + sizeof(saved_command_line);
@@ -356,10 +361,10 @@ save_command_line(int argc, char *argv[]) {
*src == '-' || *src == '_' ||
*src == '.' || *src == '/') {
*dst++ = *src++;
quoted = ISC_FALSE;
quoted = false;
} else {
*dst++ = '\\';
quoted = ISC_TRUE;
quoted = true;
}
}
}
@@ -390,25 +395,25 @@ parse_int(char *arg, const char *desc) {
static struct flag_def {
const char *name;
unsigned int value;
isc_boolean_t negate;
bool negate;
} mem_debug_flags[] = {
{ "none", 0, ISC_FALSE },
{ "trace", ISC_MEM_DEBUGTRACE, ISC_FALSE },
{ "record", ISC_MEM_DEBUGRECORD, ISC_FALSE },
{ "usage", ISC_MEM_DEBUGUSAGE, ISC_FALSE },
{ "size", ISC_MEM_DEBUGSIZE, ISC_FALSE },
{ "mctx", ISC_MEM_DEBUGCTX, ISC_FALSE },
{ NULL, 0, ISC_FALSE }
{ "none", 0, false },
{ "trace", ISC_MEM_DEBUGTRACE, false },
{ "record", ISC_MEM_DEBUGRECORD, false },
{ "usage", ISC_MEM_DEBUGUSAGE, false },
{ "size", ISC_MEM_DEBUGSIZE, false },
{ "mctx", ISC_MEM_DEBUGCTX, false },
{ NULL, 0, false }
}, mem_context_flags[] = {
{ "external", ISC_MEMFLAG_INTERNAL, ISC_TRUE },
{ "fill", ISC_MEMFLAG_FILL, ISC_FALSE },
{ "nofill", ISC_MEMFLAG_FILL, ISC_TRUE },
{ NULL, 0, ISC_FALSE }
{ "external", ISC_MEMFLAG_INTERNAL, true },
{ "fill", ISC_MEMFLAG_FILL, false },
{ "nofill", ISC_MEMFLAG_FILL, true },
{ NULL, 0, false }
};
static void
set_flags(const char *arg, struct flag_def *defs, unsigned int *ret) {
isc_boolean_t clear = ISC_FALSE;
bool clear = false;
for (;;) {
const struct flag_def *def;
@@ -421,7 +426,7 @@ set_flags(const char *arg, struct flag_def *defs, unsigned int *ret) {
if (arglen == (int)strlen(def->name) &&
memcmp(arg, def->name, arglen) == 0) {
if (def->value == 0)
clear = ISC_TRUE;
clear = true;
if (def->negate)
*ret &= ~(def->value);
else
@@ -479,29 +484,35 @@ parse_T_opt(char *option) {
* expected and assert otherwise.
*/
if (!strcmp(option, "clienttest")) {
clienttest = ISC_TRUE;
clienttest = true;
} else if (!strncmp(option, "delay=", 6)) {
delay = atoi(option + 6);
} else if (!strcmp(option, "dropedns")) {
dropedns = ISC_TRUE;
dropedns = true;
} else if (!strncmp(option, "dscp=", 5)) {
isc_dscp_check_value = atoi(option + 5);
} else if (!strcmp(option, "ednsformerr")) {
ednsformerr = true;
} else if (!strcmp(option, "ednsnotimp")) {
ednsnotimp = true;
} else if (!strcmp(option, "ednsrefused")) {
ednsrefused = true;
} else if (!strcmp(option, "fixedlocal")) {
fixedlocal = ISC_TRUE;
fixedlocal = true;
} else if (!strcmp(option, "keepstderr")) {
named_g_keepstderr = ISC_TRUE;
named_g_keepstderr = true;
} else if (!strcmp(option, "noaa")) {
noaa = ISC_TRUE;
noaa = true;
} else if (!strcmp(option, "noedns")) {
noedns = ISC_TRUE;
noedns = true;
} else if (!strcmp(option, "nonearest")) {
nonearest = ISC_TRUE;
nonearest = true;
} else if (!strcmp(option, "nosoa")) {
nosoa = ISC_TRUE;
nosoa = true;
} else if (!strcmp(option, "nosyslog")) {
named_g_nosyslog = ISC_TRUE;
named_g_nosyslog = true;
} else if (!strcmp(option, "notcp")) {
notcp = ISC_TRUE;
notcp = true;
} else if (!strcmp(option, "maxudp512")) {
maxudp = 512;
} else if (!strcmp(option, "maxudp1460")) {
@@ -541,11 +552,11 @@ parse_T_opt(char *option) {
named_main_earlyfatal("bad mkeytimer");
}
} else if (!strcmp(option, "sigvalinsecs")) {
sigvalinsecs = ISC_TRUE;
sigvalinsecs = true;
} else if (!strncmp(option, "tat=", 4)) {
named_g_tat_interval = atoi(option + 4);
} else {
fprintf(stderr, "unknown -T flag '%s\n", option);
fprintf(stderr, "unknown -T flag '%s'\n", option);
}
}
@@ -561,7 +572,7 @@ parse_command_line(int argc, char *argv[]) {
* NAMED_MAIN_ARGS is defined in main.h, so that it can be used
* both by named and by ntservice hooks.
*/
isc_commandline_errprint = ISC_FALSE;
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv,
NAMED_MAIN_ARGS)) != -1)
{
@@ -574,7 +585,7 @@ parse_command_line(int argc, char *argv[]) {
named_main_earlyfatal("IPv4 not supported "
"by OS");
isc_net_disableipv6();
disable6 = ISC_TRUE;
disable6 = true;
break;
case '6':
if (disable6)
@@ -584,14 +595,14 @@ parse_command_line(int argc, char *argv[]) {
named_main_earlyfatal("IPv6 not supported "
"by OS");
isc_net_disableipv4();
disable4 = ISC_TRUE;
disable4 = true;
break;
case 'A':
parse_fuzz_arg();
break;
case 'c':
named_g_conffile = isc_commandline_argument;
named_g_conffileset = ISC_TRUE;
named_g_conffileset = true;
break;
case 'd':
named_g_debuglevel = parse_int(isc_commandline_argument,
@@ -604,11 +615,11 @@ parse_command_line(int argc, char *argv[]) {
named_g_engine = isc_commandline_argument;
break;
case 'f':
named_g_foreground = ISC_TRUE;
named_g_foreground = true;
break;
case 'g':
named_g_foreground = ISC_TRUE;
named_g_logstderr = ISC_TRUE;
named_g_foreground = true;
named_g_logstderr = true;
break;
case 'L':
named_g_logfile = isc_commandline_argument;
@@ -637,7 +648,7 @@ parse_command_line(int argc, char *argv[]) {
break;
case 's':
/* XXXRTH temporary syntax */
want_stats = ISC_TRUE;
want_stats = true;
break;
case 'S':
maxsocks = parse_int(isc_commandline_argument,
@@ -718,17 +729,13 @@ parse_command_line(int argc, char *argv[]) {
printf("linked to zlib version: %s\n",
zlibVersion());
#endif
#ifdef ISC_PLATFORM_USETHREADS
printf("threads support is enabled\n");
#else
printf("threads support is disabled\n");
#endif
exit(0);
case 'x':
/* Obsolete. No longer in use. Ignore. */
break;
case 'X':
named_g_forcelock = ISC_TRUE;
named_g_forcelock = true;
if (strcasecmp(isc_commandline_argument, "none") != 0)
named_g_defaultlockfile =
isc_commandline_argument;
@@ -774,7 +781,6 @@ create_managers(void) {
INSIST(named_g_cpus_detected > 0);
#ifdef ISC_PLATFORM_USETHREADS
if (named_g_cpus == 0)
named_g_cpus = named_g_cpus_detected;
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
@@ -783,29 +789,21 @@ create_managers(void) {
named_g_cpus_detected,
named_g_cpus_detected == 1 ? "" : "s",
named_g_cpus, named_g_cpus == 1 ? "" : "s");
#else
named_g_cpus = 1;
#endif
#ifdef WIN32
named_g_udpdisp = 1;
#else
if (named_g_udpdisp == 0) {
if (named_g_cpus_detected == 1)
named_g_udpdisp = 1;
else
named_g_udpdisp = named_g_cpus_detected - 1;
named_g_udpdisp = named_g_cpus_detected;
}
if (named_g_udpdisp > named_g_cpus)
named_g_udpdisp = named_g_cpus;
#endif
#ifdef ISC_PLATFORM_USETHREADS
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"using %u UDP listener%s per interface",
named_g_udpdisp, named_g_udpdisp == 1 ? "" : "s");
#endif
result = isc_taskmgr_create(named_g_mctx, named_g_cpus, 0,
result = isc_taskmgr_create(named_g_mctx, named_g_cpus,
&named_g_taskmgr);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
@@ -823,14 +821,14 @@ create_managers(void) {
}
result = isc_socketmgr_create2(named_g_mctx, &named_g_socketmgr,
maxsocks);
maxsocks, named_g_cpus);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_socketmgr_create() failed: %s",
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
}
isc__socketmgr_maxudp(named_g_socketmgr, maxudp);
isc_socketmgr_maxudp(named_g_socketmgr, maxudp);
result = isc_socketmgr_getmaxsockets(named_g_socketmgr, &socks);
if (result == ISC_R_SUCCESS) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
@@ -915,12 +913,10 @@ setup(void) {
isc_mem_free(named_g_mctx, instance);
#endif /* HAVE_LIBSCF */
#ifdef ISC_PLATFORM_USETHREADS
/*
* Check for the number of cpu's before named_os_chroot().
*/
named_g_cpus_detected = isc_os_ncpus();
#endif
named_os_chroot(named_g_chrootdir);
@@ -934,7 +930,7 @@ setup(void) {
*/
named_os_minprivs();
result = named_log_init(ISC_TF(named_g_username != NULL));
result = named_log_init(named_g_username != NULL);
if (result != ISC_R_SUCCESS)
named_main_earlyfatal("named_log_init() failed: %s",
isc_result_totext(result));
@@ -1004,7 +1000,6 @@ setup(void) {
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"compiled by Solaris Studio %x", __SUNPRO_C);
#endif
#ifdef OPENSSL
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"compiled with OpenSSL version: %s",
@@ -1021,7 +1016,6 @@ setup(void) {
"linked to OpenSSL version: %s",
SSLeay_version(SSLEAY_VERSION));
#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
#endif
#ifdef HAVE_LIBXML2
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
@@ -1047,16 +1041,6 @@ setup(void) {
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"linked to zlib version: %s", zlibVersion());
#endif
#ifdef ISC_PLATFORM_USETHREADS
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"threads support is enabled");
#else
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"threads support is disabled");
#endif
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"----------------------------------------------------");
@@ -1081,14 +1065,20 @@ setup(void) {
/*
* Get the initial resource limits.
*/
(void)isc_resource_getlimit(isc_resource_stacksize,
&named_g_initstacksize);
(void)isc_resource_getlimit(isc_resource_datasize,
&named_g_initdatasize);
(void)isc_resource_getlimit(isc_resource_coresize,
&named_g_initcoresize);
(void)isc_resource_getlimit(isc_resource_openfiles,
&named_g_initopenfiles);
#ifndef WIN32
RUNTIME_CHECK(isc_resource_getlimit(isc_resource_stacksize,
&named_g_initstacksize)
== ISC_R_SUCCESS);
RUNTIME_CHECK(isc_resource_getlimit(isc_resource_datasize,
&named_g_initdatasize)
== ISC_R_SUCCESS);
RUNTIME_CHECK(isc_resource_getlimit(isc_resource_coresize,
&named_g_initcoresize)
== ISC_R_SUCCESS);
#endif
RUNTIME_CHECK(isc_resource_getlimit(isc_resource_openfiles,
&named_g_initopenfiles)
== ISC_R_SUCCESS);
/*
* System resources cannot effectively be tuned on some systems.
@@ -1096,14 +1086,15 @@ setup(void) {
*/
old_openfiles = named_g_initopenfiles;
named_os_adjustnofile();
(void)isc_resource_getlimit(isc_resource_openfiles,
&named_g_initopenfiles);
RUNTIME_CHECK(isc_resource_getlimit(isc_resource_openfiles,
&named_g_initopenfiles)
== ISC_R_SUCCESS);
if (old_openfiles != named_g_initopenfiles) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"adjusted limit on open files from "
"%" ISC_PRINT_QUADFORMAT "u to "
"%" ISC_PRINT_QUADFORMAT "u",
"%" PRIu64 " to "
"%" PRIu64,
old_openfiles, named_g_initopenfiles);
}
@@ -1170,27 +1161,33 @@ setup(void) {
* Modify server context according to command line options
*/
if (clienttest)
ns_server_setoption(sctx, NS_SERVER_CLIENTTEST, ISC_TRUE);
if (dropedns)
ns_server_setoption(sctx, NS_SERVER_DROPEDNS, ISC_TRUE);
if (noedns)
ns_server_setoption(sctx, NS_SERVER_NOEDNS, ISC_TRUE);
if (nosoa)
ns_server_setoption(sctx, NS_SERVER_NOSOA, ISC_TRUE);
if (noaa)
ns_server_setoption(sctx, NS_SERVER_NOAA, ISC_TRUE);
if (nonearest)
ns_server_setoption(sctx, NS_SERVER_NONEAREST, ISC_TRUE);
if (notcp)
ns_server_setoption(sctx, NS_SERVER_NOTCP, ISC_TRUE);
if (fixedlocal)
ns_server_setoption(sctx, NS_SERVER_FIXEDLOCAL, ISC_TRUE);
ns_server_setoption(sctx, NS_SERVER_CLIENTTEST, true);
if (disable4)
ns_server_setoption(sctx, NS_SERVER_DISABLE4, ISC_TRUE);
ns_server_setoption(sctx, NS_SERVER_DISABLE4, true);
if (disable6)
ns_server_setoption(sctx, NS_SERVER_DISABLE6, ISC_TRUE);
ns_server_setoption(sctx, NS_SERVER_DISABLE6, true);
if (dropedns)
ns_server_setoption(sctx, NS_SERVER_DROPEDNS, true);
if (ednsformerr) /* STD13 server */
ns_server_setoption(sctx, NS_SERVER_EDNSFORMERR, true);
if (ednsnotimp)
ns_server_setoption(sctx, NS_SERVER_EDNSNOTIMP, true);
if (ednsrefused)
ns_server_setoption(sctx, NS_SERVER_EDNSREFUSED, true);
if (fixedlocal)
ns_server_setoption(sctx, NS_SERVER_FIXEDLOCAL, true);
if (noaa)
ns_server_setoption(sctx, NS_SERVER_NOAA, true);
if (noedns)
ns_server_setoption(sctx, NS_SERVER_NOEDNS, true);
if (nonearest)
ns_server_setoption(sctx, NS_SERVER_NONEAREST, true);
if (nosoa)
ns_server_setoption(sctx, NS_SERVER_NOSOA, true);
if (notcp)
ns_server_setoption(sctx, NS_SERVER_NOTCP, true);
if (sigvalinsecs)
ns_server_setoption(sctx, NS_SERVER_SIGVALINSECS, ISC_TRUE);
ns_server_setoption(sctx, NS_SERVER_SIGVALINSECS, true);
named_g_server->sctx->delay = delay;
}
@@ -1342,9 +1339,6 @@ main(int argc, char *argv[]) {
if (result != ISC_R_SUCCESS)
named_main_earlyfatal("program name too long");
if (result != ISC_R_SUCCESS)
named_main_earlyfatal("failed to build internal symbol table");
isc_assertion_setcallback(assertion_failed);
isc_error_setfatal(library_fatal_error);
isc_error_setunexpected(library_unexpected_error);
+41 -40
View File
@@ -10,12 +10,12 @@
.\" Title: named.conf
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 2018-05-29
.\" Date: 2018-10-23
.\" Manual: BIND9
.\" Source: ISC
.\" Language: English
.\"
.TH "NAMED\&.CONF" "5" "2018\-05\-29" "ISC" "BIND9"
.TH "NAMED\&.CONF" "5" "2018\-10\-23" "ISC" "BIND9"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -199,6 +199,7 @@ options {
] [ dscp \fIinteger\fR ];
alt\-transfer\-source\-v6 ( \fIipv6_address\fR | * ) [ port ( \fIinteger\fR |
* ) ] [ dscp \fIinteger\fR ];
answer\-cookie \fIboolean\fR;
attach\-cache \fIstring\fR;
auth\-nxdomain \fIboolean\fR; // default changed
auto\-dnssec ( allow | maintain | off );
@@ -231,9 +232,9 @@ options {
coresize ( default | unlimited | \fIsizeval\fR );
datasize ( default | unlimited | \fIsizeval\fR );
deny\-answer\-addresses { \fIaddress_match_element\fR; \&.\&.\&. } [
except\-from { \fIquoted_string\fR; \&.\&.\&. } ];
deny\-answer\-aliases { \fIquoted_string\fR; \&.\&.\&. } [ except\-from {
\fIquoted_string\fR; \&.\&.\&. } ];
except\-from { \fIstring\fR; \&.\&.\&. } ];
deny\-answer\-aliases { \fIstring\fR; \&.\&.\&. } [ except\-from { \fIstring\fR; \&.\&.\&.
} ];
dialup ( notify | notify\-passive | passive | refresh | \fIboolean\fR );
directory \fIquoted_string\fR;
disable\-algorithms \fIstring\fR { \fIstring\fR;
@@ -264,14 +265,12 @@ options {
dnssec\-secure\-to\-insecure \fIboolean\fR;
dnssec\-update\-mode ( maintain | no\-resign );
dnssec\-validation ( yes | no | auto );
dnstap { ( all | auth | client | forwarder |
resolver ) [ ( query | response ) ]; \&.\&.\&. };
dnstap\-identity ( \fIquoted_string\fR | none |
hostname );
dnstap\-output ( file | unix ) \fIquoted_string\fR [
size ( unlimited | \fIsize\fR ) ] [ versions (
unlimited | \fIinteger\fR ) ] [ suffix ( increment
| timestamp ) ];
dnstap { ( all | auth | client | forwarder | resolver | update ) [
( query | response ) ]; \&.\&.\&. };
dnstap\-identity ( \fIquoted_string\fR | none | hostname );
dnstap\-output ( file | unix ) \fIquoted_string\fR [ size ( unlimited |
\fIsize\fR ) ] [ versions ( unlimited | \fIinteger\fR ) ] [ suffix (
increment | timestamp ) ];
dnstap\-version ( \fIquoted_string\fR | none );
dscp \fIinteger\fR;
dual\-stack\-servers [ port \fIinteger\fR ] { ( \fIquoted_string\fR [ port
@@ -345,6 +344,8 @@ options {
memstatistics \fIboolean\fR;
memstatistics\-file \fIquoted_string\fR;
message\-compression \fIboolean\fR;
min\-cache\-ttl \fIttlval\fR;
min\-ncache\-ttl \fIttlval\fR;
min\-refresh\-time \fIinteger\fR;
min\-retry\-time \fIinteger\fR;
minimal\-any \fIboolean\fR;
@@ -369,7 +370,7 @@ options {
preferred\-glue \fIstring\fR;
prefetch \fIinteger\fR [ \fIinteger\fR ];
provide\-ixfr \fIboolean\fR;
qname\-minimization ( strict | relaxed | disabled );
qname\-minimization ( strict | relaxed | disabled | off );
query\-source ( ( [ address ] ( \fIipv4_address\fR | * ) [ port (
\fIinteger\fR | * ) ] ) | ( [ [ address ] ( \fIipv4_address\fR | * ) ]
port ( \fIinteger\fR | * ) ) ) [ dscp \fIinteger\fR ];
@@ -420,7 +421,7 @@ options {
nsip\-enable \fIboolean\fR ] [ nsdname\-enable \fIboolean\fR ] [
dnsrps\-enable \fIboolean\fR ] [ dnsrps\-options { \fIunspecified\-text\fR
} ];
root\-delegation\-only [ exclude { \fIquoted_string\fR; \&.\&.\&. } ];
root\-delegation\-only [ exclude { \fIstring\fR; \&.\&.\&. } ];
root\-key\-sentinel \fIboolean\fR;
rrset\-order { [ class \fIstring\fR ] [ type \fIstring\fR ] [ name
\fIquoted_string\fR ] \fIstring\fR \fIstring\fR; \&.\&.\&. };
@@ -470,6 +471,7 @@ options {
use\-v4\-udp\-ports { \fIportrange\fR; \&.\&.\&. };
use\-v6\-udp\-ports { \fIportrange\fR; \&.\&.\&. };
v6\-bias \fIinteger\fR;
validate\-except { \fIstring\fR; \&.\&.\&. };
version ( \fIquoted_string\fR | none );
zero\-no\-soa\-ttl \fIboolean\fR;
zero\-no\-soa\-ttl\-cache \fIboolean\fR;
@@ -597,9 +599,9 @@ view \fIstring\fR [ \fIclass\fR ] {
cleaning\-interval \fIinteger\fR;
clients\-per\-query \fIinteger\fR;
deny\-answer\-addresses { \fIaddress_match_element\fR; \&.\&.\&. } [
except\-from { \fIquoted_string\fR; \&.\&.\&. } ];
deny\-answer\-aliases { \fIquoted_string\fR; \&.\&.\&. } [ except\-from {
\fIquoted_string\fR; \&.\&.\&. } ];
except\-from { \fIstring\fR; \&.\&.\&. } ];
deny\-answer\-aliases { \fIstring\fR; \&.\&.\&. } [ except\-from { \fIstring\fR; \&.\&.\&.
} ];
dialup ( notify | notify\-passive | passive | refresh | \fIboolean\fR );
disable\-algorithms \fIstring\fR { \fIstring\fR;
\&.\&.\&. };
@@ -633,8 +635,8 @@ view \fIstring\fR [ \fIclass\fR ] {
dnssec\-secure\-to\-insecure \fIboolean\fR;
dnssec\-update\-mode ( maintain | no\-resign );
dnssec\-validation ( yes | no | auto );
dnstap { ( all | auth | client | forwarder |
resolver ) [ ( query | response ) ]; \&.\&.\&. };
dnstap { ( all | auth | client | forwarder | resolver | update ) [
( query | response ) ]; \&.\&.\&. };
dual\-stack\-servers [ port \fIinteger\fR ] { ( \fIquoted_string\fR [ port
\fIinteger\fR ] [ dscp \fIinteger\fR ] | \fIipv4_address\fR [ port
\fIinteger\fR ] [ dscp \fIinteger\fR ] | \fIipv6_address\fR [ port
@@ -712,7 +714,7 @@ view \fIstring\fR [ \fIclass\fR ] {
preferred\-glue \fIstring\fR;
prefetch \fIinteger\fR [ \fIinteger\fR ];
provide\-ixfr \fIboolean\fR;
qname\-minimization ( strict | relaxed | disabled );
qname\-minimization ( strict | relaxed | disabled | off );
query\-source ( ( [ address ] ( \fIipv4_address\fR | * ) [ port (
\fIinteger\fR | * ) ] ) | ( [ [ address ] ( \fIipv4_address\fR | * ) ]
port ( \fIinteger\fR | * ) ) ) [ dscp \fIinteger\fR ];
@@ -758,7 +760,7 @@ view \fIstring\fR [ \fIclass\fR ] {
nsip\-enable \fIboolean\fR ] [ nsdname\-enable \fIboolean\fR ] [
dnsrps\-enable \fIboolean\fR ] [ dnsrps\-options { \fIunspecified\-text\fR
} ];
root\-delegation\-only [ exclude { \fIquoted_string\fR; \&.\&.\&. } ];
root\-delegation\-only [ exclude { \fIstring\fR; \&.\&.\&. } ];
root\-key\-sentinel \fIboolean\fR;
rrset\-order { [ class \fIstring\fR ] [ type \fIstring\fR ] [ name
\fIquoted_string\fR ] \fIstring\fR \fIstring\fR; \&.\&.\&. };
@@ -820,6 +822,7 @@ view \fIstring\fR [ \fIclass\fR ] {
update\-check\-ksk \fIboolean\fR;
use\-alt\-transfer\-source \fIboolean\fR;
v6\-bias \fIinteger\fR;
validate\-except { \fIstring\fR; \&.\&.\&. };
zero\-no\-soa\-ttl \fIboolean\fR;
zero\-no\-soa\-ttl\-cache \fIboolean\fR;
zone \fIstring\fR [ \fIclass\fR ] {
@@ -884,7 +887,6 @@ view \fIstring\fR [ \fIclass\fR ] {
max\-zone\-ttl ( unlimited | \fIttlval\fR );
min\-refresh\-time \fIinteger\fR;
min\-retry\-time \fIinteger\fR;
mirror \fIboolean\fR;
multi\-master \fIboolean\fR;
notify ( explicit | master\-only | \fIboolean\fR );
notify\-delay \fIinteger\fR;
@@ -899,9 +901,8 @@ view \fIstring\fR [ \fIclass\fR ] {
request\-expire \fIboolean\fR;
request\-ixfr \fIboolean\fR;
serial\-update\-method ( date | increment | unixtime );
server\-addresses { ( \fIipv4_address\fR | \fIipv6_address\fR ) [
port \fIinteger\fR ]; \&.\&.\&. };
server\-names { \fIquoted_string\fR; \&.\&.\&. };
server\-addresses { ( \fIipv4_address\fR | \fIipv6_address\fR ); \&.\&.\&. };
server\-names { \fIstring\fR; \&.\&.\&. };
sig\-signing\-nodes \fIinteger\fR;
sig\-signing\-signatures \fIinteger\fR;
sig\-signing\-type \fIinteger\fR;
@@ -911,15 +912,15 @@ view \fIstring\fR [ \fIclass\fR ] {
transfer\-source\-v6 ( \fIipv6_address\fR | * ) [ port (
\fIinteger\fR | * ) ] [ dscp \fIinteger\fR ];
try\-tcp\-refresh \fIboolean\fR;
type ( primary | master | secondary | slave |
type ( primary | master | secondary | slave | mirror |
delegation\-only | forward | hint | redirect |
static\-stub | stub );
update\-check\-ksk \fIboolean\fR;
update\-policy ( local | { ( deny | grant ) \fIstring\fR (
6to4\-self | external | krb5\-self | krb5\-subdomain |
ms\-self | ms\-subdomain | name | self | selfsub |
selfwild | subdomain | tcp\-self | wildcard | zonesub )
[ \fIstring\fR ] \fIrrtypelist\fR; \&.\&.\&. };
6to4\-self | external | krb5\-self | krb5\-selfsub |
krb5\-subdomain | ms\-self | ms\-selfsub | ms\-subdomain |
name | self | selfsub | selfwild | subdomain | tcp\-self
| wildcard | zonesub ) [ \fIstring\fR ] \fIrrtypelist\fR; \&.\&.\&. };
use\-alt\-transfer\-source \fIboolean\fR;
zero\-no\-soa\-ttl \fIboolean\fR;
zone\-statistics ( full | terse | none | \fIboolean\fR );
@@ -994,7 +995,6 @@ zone \fIstring\fR [ \fIclass\fR ] {
max\-zone\-ttl ( unlimited | \fIttlval\fR );
min\-refresh\-time \fIinteger\fR;
min\-retry\-time \fIinteger\fR;
mirror \fIboolean\fR;
multi\-master \fIboolean\fR;
notify ( explicit | master\-only | \fIboolean\fR );
notify\-delay \fIinteger\fR;
@@ -1007,9 +1007,8 @@ zone \fIstring\fR [ \fIclass\fR ] {
request\-expire \fIboolean\fR;
request\-ixfr \fIboolean\fR;
serial\-update\-method ( date | increment | unixtime );
server\-addresses { ( \fIipv4_address\fR | \fIipv6_address\fR ) [ port
\fIinteger\fR ]; \&.\&.\&. };
server\-names { \fIquoted_string\fR; \&.\&.\&. };
server\-addresses { ( \fIipv4_address\fR | \fIipv6_address\fR ); \&.\&.\&. };
server\-names { \fIstring\fR; \&.\&.\&. };
sig\-signing\-nodes \fIinteger\fR;
sig\-signing\-signatures \fIinteger\fR;
sig\-signing\-type \fIinteger\fR;
@@ -1019,13 +1018,15 @@ zone \fIstring\fR [ \fIclass\fR ] {
transfer\-source\-v6 ( \fIipv6_address\fR | * ) [ port ( \fIinteger\fR | * )
] [ dscp \fIinteger\fR ];
try\-tcp\-refresh \fIboolean\fR;
type ( primary | master | secondary | slave | delegation\-only |
forward | hint | redirect | static\-stub | stub );
type ( primary | master | secondary | slave | mirror |
delegation\-only | forward | hint | redirect | static\-stub |
stub );
update\-check\-ksk \fIboolean\fR;
update\-policy ( local | { ( deny | grant ) \fIstring\fR ( 6to4\-self |
external | krb5\-self | krb5\-subdomain | ms\-self | ms\-subdomain
| name | self | selfsub | selfwild | subdomain | tcp\-self |
wildcard | zonesub ) [ \fIstring\fR ] \fIrrtypelist\fR; \&.\&.\&. };
external | krb5\-self | krb5\-selfsub | krb5\-subdomain | ms\-self
| ms\-selfsub | ms\-subdomain | name | self | selfsub | selfwild
| subdomain | tcp\-self | wildcard | zonesub ) [ \fIstring\fR ]
\fIrrtypelist\fR; \&.\&.\&. };
use\-alt\-transfer\-source \fIboolean\fR;
zero\-no\-soa\-ttl \fIboolean\fR;
zone\-statistics ( full | terse | none | \fIboolean\fR );
+40 -39
View File
@@ -13,7 +13,7 @@
<refentry xmlns:db="http://docbook.org/ns/docbook" version="5.0" xml:id="man.named.conf">
<info>
<date>2018-05-29</date>
<date>2018-10-23</date>
</info>
<refentryinfo>
<corpname>ISC</corpname>
@@ -192,6 +192,7 @@ options {
] [ dscp <replaceable>integer</replaceable> ];
alt-transfer-source-v6 ( <replaceable>ipv6_address</replaceable> | * ) [ port ( <replaceable>integer</replaceable> |
* ) ] [ dscp <replaceable>integer</replaceable> ];
answer-cookie <replaceable>boolean</replaceable>;
attach-cache <replaceable>string</replaceable>;
auth-nxdomain <replaceable>boolean</replaceable>; // default changed
auto-dnssec ( allow | maintain | off );
@@ -224,9 +225,9 @@ options {
coresize ( default | unlimited | <replaceable>sizeval</replaceable> );
datasize ( default | unlimited | <replaceable>sizeval</replaceable> );
deny-answer-addresses { <replaceable>address_match_element</replaceable>; ... } [
except-from { <replaceable>quoted_string</replaceable>; ... } ];
deny-answer-aliases { <replaceable>quoted_string</replaceable>; ... } [ except-from {
<replaceable>quoted_string</replaceable>; ... } ];
except-from { <replaceable>string</replaceable>; ... } ];
deny-answer-aliases { <replaceable>string</replaceable>; ... } [ except-from { <replaceable>string</replaceable>; ...
} ];
dialup ( notify | notify-passive | passive | refresh | <replaceable>boolean</replaceable> );
directory <replaceable>quoted_string</replaceable>;
disable-algorithms <replaceable>string</replaceable> { <replaceable>string</replaceable>;
@@ -257,14 +258,12 @@ options {
dnssec-secure-to-insecure <replaceable>boolean</replaceable>;
dnssec-update-mode ( maintain | no-resign );
dnssec-validation ( yes | no | auto );
dnstap { ( all | auth | client | forwarder |
resolver ) [ ( query | response ) ]; ... };
dnstap-identity ( <replaceable>quoted_string</replaceable> | none |
hostname );
dnstap-output ( file | unix ) <replaceable>quoted_string</replaceable> [
size ( unlimited | <replaceable>size</replaceable> ) ] [ versions (
unlimited | <replaceable>integer</replaceable> ) ] [ suffix ( increment
| timestamp ) ];
dnstap { ( all | auth | client | forwarder | resolver | update ) [
( query | response ) ]; ... };
dnstap-identity ( <replaceable>quoted_string</replaceable> | none | hostname );
dnstap-output ( file | unix ) <replaceable>quoted_string</replaceable> [ size ( unlimited |
<replaceable>size</replaceable> ) ] [ versions ( unlimited | <replaceable>integer</replaceable> ) ] [ suffix (
increment | timestamp ) ];
dnstap-version ( <replaceable>quoted_string</replaceable> | none );
dscp <replaceable>integer</replaceable>;
dual-stack-servers [ port <replaceable>integer</replaceable> ] { ( <replaceable>quoted_string</replaceable> [ port
@@ -338,6 +337,8 @@ options {
memstatistics <replaceable>boolean</replaceable>;
memstatistics-file <replaceable>quoted_string</replaceable>;
message-compression <replaceable>boolean</replaceable>;
min-cache-ttl <replaceable>ttlval</replaceable>;
min-ncache-ttl <replaceable>ttlval</replaceable>;
min-refresh-time <replaceable>integer</replaceable>;
min-retry-time <replaceable>integer</replaceable>;
minimal-any <replaceable>boolean</replaceable>;
@@ -362,7 +363,7 @@ options {
preferred-glue <replaceable>string</replaceable>;
prefetch <replaceable>integer</replaceable> [ <replaceable>integer</replaceable> ];
provide-ixfr <replaceable>boolean</replaceable>;
qname-minimization ( strict | relaxed | disabled );
qname-minimization ( strict | relaxed | disabled | off );
query-source ( ( [ address ] ( <replaceable>ipv4_address</replaceable> | * ) [ port (
<replaceable>integer</replaceable> | * ) ] ) | ( [ [ address ] ( <replaceable>ipv4_address</replaceable> | * ) ]
port ( <replaceable>integer</replaceable> | * ) ) ) [ dscp <replaceable>integer</replaceable> ];
@@ -413,7 +414,7 @@ options {
nsip-enable <replaceable>boolean</replaceable> ] [ nsdname-enable <replaceable>boolean</replaceable> ] [
dnsrps-enable <replaceable>boolean</replaceable> ] [ dnsrps-options { <replaceable>unspecified-text</replaceable>
} ];
root-delegation-only [ exclude { <replaceable>quoted_string</replaceable>; ... } ];
root-delegation-only [ exclude { <replaceable>string</replaceable>; ... } ];
root-key-sentinel <replaceable>boolean</replaceable>;
rrset-order { [ class <replaceable>string</replaceable> ] [ type <replaceable>string</replaceable> ] [ name
<replaceable>quoted_string</replaceable> ] <replaceable>string</replaceable> <replaceable>string</replaceable>; ... };
@@ -463,6 +464,7 @@ options {
use-v4-udp-ports { <replaceable>portrange</replaceable>; ... };
use-v6-udp-ports { <replaceable>portrange</replaceable>; ... };
v6-bias <replaceable>integer</replaceable>;
validate-except { <replaceable>string</replaceable>; ... };
version ( <replaceable>quoted_string</replaceable> | none );
zero-no-soa-ttl <replaceable>boolean</replaceable>;
zero-no-soa-ttl-cache <replaceable>boolean</replaceable>;
@@ -574,9 +576,9 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
cleaning-interval <replaceable>integer</replaceable>;
clients-per-query <replaceable>integer</replaceable>;
deny-answer-addresses { <replaceable>address_match_element</replaceable>; ... } [
except-from { <replaceable>quoted_string</replaceable>; ... } ];
deny-answer-aliases { <replaceable>quoted_string</replaceable>; ... } [ except-from {
<replaceable>quoted_string</replaceable>; ... } ];
except-from { <replaceable>string</replaceable>; ... } ];
deny-answer-aliases { <replaceable>string</replaceable>; ... } [ except-from { <replaceable>string</replaceable>; ...
} ];
dialup ( notify | notify-passive | passive | refresh | <replaceable>boolean</replaceable> );
disable-algorithms <replaceable>string</replaceable> { <replaceable>string</replaceable>;
... };
@@ -610,8 +612,8 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
dnssec-secure-to-insecure <replaceable>boolean</replaceable>;
dnssec-update-mode ( maintain | no-resign );
dnssec-validation ( yes | no | auto );
dnstap { ( all | auth | client | forwarder |
resolver ) [ ( query | response ) ]; ... };
dnstap { ( all | auth | client | forwarder | resolver | update ) [
( query | response ) ]; ... };
dual-stack-servers [ port <replaceable>integer</replaceable> ] { ( <replaceable>quoted_string</replaceable> [ port
<replaceable>integer</replaceable> ] [ dscp <replaceable>integer</replaceable> ] | <replaceable>ipv4_address</replaceable> [ port
<replaceable>integer</replaceable> ] [ dscp <replaceable>integer</replaceable> ] | <replaceable>ipv6_address</replaceable> [ port
@@ -689,7 +691,7 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
preferred-glue <replaceable>string</replaceable>;
prefetch <replaceable>integer</replaceable> [ <replaceable>integer</replaceable> ];
provide-ixfr <replaceable>boolean</replaceable>;
qname-minimization ( strict | relaxed | disabled );
qname-minimization ( strict | relaxed | disabled | off );
query-source ( ( [ address ] ( <replaceable>ipv4_address</replaceable> | * ) [ port (
<replaceable>integer</replaceable> | * ) ] ) | ( [ [ address ] ( <replaceable>ipv4_address</replaceable> | * ) ]
port ( <replaceable>integer</replaceable> | * ) ) ) [ dscp <replaceable>integer</replaceable> ];
@@ -735,7 +737,7 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
nsip-enable <replaceable>boolean</replaceable> ] [ nsdname-enable <replaceable>boolean</replaceable> ] [
dnsrps-enable <replaceable>boolean</replaceable> ] [ dnsrps-options { <replaceable>unspecified-text</replaceable>
} ];
root-delegation-only [ exclude { <replaceable>quoted_string</replaceable>; ... } ];
root-delegation-only [ exclude { <replaceable>string</replaceable>; ... } ];
root-key-sentinel <replaceable>boolean</replaceable>;
rrset-order { [ class <replaceable>string</replaceable> ] [ type <replaceable>string</replaceable> ] [ name
<replaceable>quoted_string</replaceable> ] <replaceable>string</replaceable> <replaceable>string</replaceable>; ... };
@@ -797,6 +799,7 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
update-check-ksk <replaceable>boolean</replaceable>;
use-alt-transfer-source <replaceable>boolean</replaceable>;
v6-bias <replaceable>integer</replaceable>;
validate-except { <replaceable>string</replaceable>; ... };
zero-no-soa-ttl <replaceable>boolean</replaceable>;
zero-no-soa-ttl-cache <replaceable>boolean</replaceable>;
zone <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
@@ -861,7 +864,6 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
max-zone-ttl ( unlimited | <replaceable>ttlval</replaceable> );
min-refresh-time <replaceable>integer</replaceable>;
min-retry-time <replaceable>integer</replaceable>;
mirror <replaceable>boolean</replaceable>;
multi-master <replaceable>boolean</replaceable>;
notify ( explicit | master-only | <replaceable>boolean</replaceable> );
notify-delay <replaceable>integer</replaceable>;
@@ -876,9 +878,8 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
request-expire <replaceable>boolean</replaceable>;
request-ixfr <replaceable>boolean</replaceable>;
serial-update-method ( date | increment | unixtime );
server-addresses { ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> ) [
port <replaceable>integer</replaceable> ]; ... };
server-names { <replaceable>quoted_string</replaceable>; ... };
server-addresses { ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> ); ... };
server-names { <replaceable>string</replaceable>; ... };
sig-signing-nodes <replaceable>integer</replaceable>;
sig-signing-signatures <replaceable>integer</replaceable>;
sig-signing-type <replaceable>integer</replaceable>;
@@ -888,15 +889,15 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
transfer-source-v6 ( <replaceable>ipv6_address</replaceable> | * ) [ port (
<replaceable>integer</replaceable> | * ) ] [ dscp <replaceable>integer</replaceable> ];
try-tcp-refresh <replaceable>boolean</replaceable>;
type ( primary | master | secondary | slave |
type ( primary | master | secondary | slave | mirror |
delegation-only | forward | hint | redirect |
static-stub | stub );
update-check-ksk <replaceable>boolean</replaceable>;
update-policy ( local | { ( deny | grant ) <replaceable>string</replaceable> (
6to4-self | external | krb5-self | krb5-subdomain |
ms-self | ms-subdomain | name | self | selfsub |
selfwild | subdomain | tcp-self | wildcard | zonesub )
[ <replaceable>string</replaceable> ] <replaceable>rrtypelist</replaceable>; ... };
6to4-self | external | krb5-self | krb5-selfsub |
krb5-subdomain | ms-self | ms-selfsub | ms-subdomain |
name | self | selfsub | selfwild | subdomain | tcp-self
| wildcard | zonesub ) [ <replaceable>string</replaceable> ] <replaceable>rrtypelist</replaceable>; ... };
use-alt-transfer-source <replaceable>boolean</replaceable>;
zero-no-soa-ttl <replaceable>boolean</replaceable>;
zone-statistics ( full | terse | none | <replaceable>boolean</replaceable> );
@@ -967,7 +968,6 @@ zone <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
max-zone-ttl ( unlimited | <replaceable>ttlval</replaceable> );
min-refresh-time <replaceable>integer</replaceable>;
min-retry-time <replaceable>integer</replaceable>;
mirror <replaceable>boolean</replaceable>;
multi-master <replaceable>boolean</replaceable>;
notify ( explicit | master-only | <replaceable>boolean</replaceable> );
notify-delay <replaceable>integer</replaceable>;
@@ -980,9 +980,8 @@ zone <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
request-expire <replaceable>boolean</replaceable>;
request-ixfr <replaceable>boolean</replaceable>;
serial-update-method ( date | increment | unixtime );
server-addresses { ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> ) [ port
<replaceable>integer</replaceable> ]; ... };
server-names { <replaceable>quoted_string</replaceable>; ... };
server-addresses { ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> ); ... };
server-names { <replaceable>string</replaceable>; ... };
sig-signing-nodes <replaceable>integer</replaceable>;
sig-signing-signatures <replaceable>integer</replaceable>;
sig-signing-type <replaceable>integer</replaceable>;
@@ -992,13 +991,15 @@ zone <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
transfer-source-v6 ( <replaceable>ipv6_address</replaceable> | * ) [ port ( <replaceable>integer</replaceable> | * )
] [ dscp <replaceable>integer</replaceable> ];
try-tcp-refresh <replaceable>boolean</replaceable>;
type ( primary | master | secondary | slave | delegation-only |
forward | hint | redirect | static-stub | stub );
type ( primary | master | secondary | slave | mirror |
delegation-only | forward | hint | redirect | static-stub |
stub );
update-check-ksk <replaceable>boolean</replaceable>;
update-policy ( local | { ( deny | grant ) <replaceable>string</replaceable> ( 6to4-self |
external | krb5-self | krb5-subdomain | ms-self | ms-subdomain
| name | self | selfsub | selfwild | subdomain | tcp-self |
wildcard | zonesub ) [ <replaceable>string</replaceable> ] <replaceable>rrtypelist</replaceable>; ... };
external | krb5-self | krb5-selfsub | krb5-subdomain | ms-self
| ms-selfsub | ms-subdomain | name | self | selfsub | selfwild
| subdomain | tcp-self | wildcard | zonesub ) [ <replaceable>string</replaceable> ]
<replaceable>rrtypelist</replaceable>; ... };
use-alt-transfer-source <replaceable>boolean</replaceable>;
zero-no-soa-ttl <replaceable>boolean</replaceable>;
zone-statistics ( full | terse | none | <replaceable>boolean</replaceable> );
+39 -38
View File
@@ -180,6 +180,7 @@ options
    ] [ dscp <em class="replaceable"><code>integer</code></em> ];<br>
alt-transfer-source-v6 ( <em class="replaceable"><code>ipv6_address</code></em> | * ) [ port ( <em class="replaceable"><code>integer</code></em> |<br>
    * ) ] [ dscp <em class="replaceable"><code>integer</code></em> ];<br>
answer-cookie <em class="replaceable"><code>boolean</code></em>;<br>
attach-cache <em class="replaceable"><code>string</code></em>;<br>
auth-nxdomain <em class="replaceable"><code>boolean</code></em>; // default changed<br>
auto-dnssec ( allow | maintain | off );<br>
@@ -212,9 +213,9 @@ options
coresize ( default | unlimited | <em class="replaceable"><code>sizeval</code></em> );<br>
datasize ( default | unlimited | <em class="replaceable"><code>sizeval</code></em> );<br>
deny-answer-addresses { <em class="replaceable"><code>address_match_element</code></em>; ... } [<br>
    except-from { <em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
deny-answer-aliases { <em class="replaceable"><code>quoted_string</code></em>; ... } [ except-from {<br>
    <em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
    except-from { <em class="replaceable"><code>string</code></em>; ... } ];<br>
deny-answer-aliases { <em class="replaceable"><code>string</code></em>; ... } [ except-from { <em class="replaceable"><code>string</code></em>; ...<br>
    } ];<br>
dialup ( notify | notify-passive | passive | refresh | <em class="replaceable"><code>boolean</code></em> );<br>
directory <em class="replaceable"><code>quoted_string</code></em>;<br>
disable-algorithms <em class="replaceable"><code>string</code></em> { <em class="replaceable"><code>string</code></em>;<br>
@@ -245,14 +246,12 @@ options
dnssec-secure-to-insecure <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-update-mode ( maintain | no-resign );<br>
dnssec-validation ( yes | no | auto );<br>
dnstap { ( all | auth | client | forwarder |<br>
    resolver ) [ ( query | response ) ]; ... };<br>
dnstap-identity ( <em class="replaceable"><code>quoted_string</code></em> | none |<br>
    hostname );<br>
dnstap-output ( file | unix ) <em class="replaceable"><code>quoted_string</code></em> [<br>
    size ( unlimited | <em class="replaceable"><code>size</code></em> ) ] [ versions (<br>
    unlimited | <em class="replaceable"><code>integer</code></em> ) ] [ suffix ( increment<br>
    | timestamp ) ];<br>
dnstap { ( all | auth | client | forwarder | resolver | update ) [<br>
    ( query | response ) ]; ... };<br>
dnstap-identity ( <em class="replaceable"><code>quoted_string</code></em> | none | hostname );<br>
dnstap-output ( file | unix ) <em class="replaceable"><code>quoted_string</code></em> [ size ( unlimited |<br>
    <em class="replaceable"><code>size</code></em> ) ] [ versions ( unlimited | <em class="replaceable"><code>integer</code></em> ) ] [ suffix (<br>
    increment | timestamp ) ];<br>
dnstap-version ( <em class="replaceable"><code>quoted_string</code></em> | none );<br>
dscp <em class="replaceable"><code>integer</code></em>;<br>
dual-stack-servers [ port <em class="replaceable"><code>integer</code></em> ] { ( <em class="replaceable"><code>quoted_string</code></em> [ port<br>
@@ -326,6 +325,8 @@ options
memstatistics <em class="replaceable"><code>boolean</code></em>;<br>
memstatistics-file <em class="replaceable"><code>quoted_string</code></em>;<br>
message-compression <em class="replaceable"><code>boolean</code></em>;<br>
min-cache-ttl <em class="replaceable"><code>ttlval</code></em>;<br>
min-ncache-ttl <em class="replaceable"><code>ttlval</code></em>;<br>
min-refresh-time <em class="replaceable"><code>integer</code></em>;<br>
min-retry-time <em class="replaceable"><code>integer</code></em>;<br>
minimal-any <em class="replaceable"><code>boolean</code></em>;<br>
@@ -350,7 +351,7 @@ options
preferred-glue <em class="replaceable"><code>string</code></em>;<br>
prefetch <em class="replaceable"><code>integer</code></em> [ <em class="replaceable"><code>integer</code></em> ];<br>
provide-ixfr <em class="replaceable"><code>boolean</code></em>;<br>
qname-minimization ( strict | relaxed | disabled );<br>
qname-minimization ( strict | relaxed | disabled | off );<br>
query-source ( ( [ address ] ( <em class="replaceable"><code>ipv4_address</code></em> | * ) [ port (<br>
    <em class="replaceable"><code>integer</code></em> | * ) ] ) | ( [ [ address ] ( <em class="replaceable"><code>ipv4_address</code></em> | * ) ]<br>
    port ( <em class="replaceable"><code>integer</code></em> | * ) ) ) [ dscp <em class="replaceable"><code>integer</code></em> ];<br>
@@ -401,7 +402,7 @@ options
    nsip-enable <em class="replaceable"><code>boolean</code></em> ] [ nsdname-enable <em class="replaceable"><code>boolean</code></em> ] [<br>
    dnsrps-enable <em class="replaceable"><code>boolean</code></em> ] [ dnsrps-options { <em class="replaceable"><code>unspecified-text</code></em><br>
    } ];<br>
root-delegation-only [ exclude { <em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
root-delegation-only [ exclude { <em class="replaceable"><code>string</code></em>; ... } ];<br>
root-key-sentinel <em class="replaceable"><code>boolean</code></em>;<br>
rrset-order { [ class <em class="replaceable"><code>string</code></em> ] [ type <em class="replaceable"><code>string</code></em> ] [ name<br>
    <em class="replaceable"><code>quoted_string</code></em> ] <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>string</code></em>; ... };<br>
@@ -451,6 +452,7 @@ options
use-v4-udp-ports { <em class="replaceable"><code>portrange</code></em>; ... };<br>
use-v6-udp-ports { <em class="replaceable"><code>portrange</code></em>; ... };<br>
v6-bias <em class="replaceable"><code>integer</code></em>;<br>
validate-except { <em class="replaceable"><code>string</code></em>; ... };<br>
version ( <em class="replaceable"><code>quoted_string</code></em> | none );<br>
zero-no-soa-ttl <em class="replaceable"><code>boolean</code></em>;<br>
zero-no-soa-ttl-cache <em class="replaceable"><code>boolean</code></em>;<br>
@@ -566,9 +568,9 @@ view
cleaning-interval <em class="replaceable"><code>integer</code></em>;<br>
clients-per-query <em class="replaceable"><code>integer</code></em>;<br>
deny-answer-addresses { <em class="replaceable"><code>address_match_element</code></em>; ... } [<br>
    except-from { <em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
deny-answer-aliases { <em class="replaceable"><code>quoted_string</code></em>; ... } [ except-from {<br>
    <em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
    except-from { <em class="replaceable"><code>string</code></em>; ... } ];<br>
deny-answer-aliases { <em class="replaceable"><code>string</code></em>; ... } [ except-from { <em class="replaceable"><code>string</code></em>; ...<br>
    } ];<br>
dialup ( notify | notify-passive | passive | refresh | <em class="replaceable"><code>boolean</code></em> );<br>
disable-algorithms <em class="replaceable"><code>string</code></em> { <em class="replaceable"><code>string</code></em>;<br>
    ... };<br>
@@ -602,8 +604,8 @@ view
dnssec-secure-to-insecure <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-update-mode ( maintain | no-resign );<br>
dnssec-validation ( yes | no | auto );<br>
dnstap { ( all | auth | client | forwarder |<br>
    resolver ) [ ( query | response ) ]; ... };<br>
dnstap { ( all | auth | client | forwarder | resolver | update ) [<br>
    ( query | response ) ]; ... };<br>
dual-stack-servers [ port <em class="replaceable"><code>integer</code></em> ] { ( <em class="replaceable"><code>quoted_string</code></em> [ port<br>
    <em class="replaceable"><code>integer</code></em> ] [ dscp <em class="replaceable"><code>integer</code></em> ] | <em class="replaceable"><code>ipv4_address</code></em> [ port<br>
    <em class="replaceable"><code>integer</code></em> ] [ dscp <em class="replaceable"><code>integer</code></em> ] | <em class="replaceable"><code>ipv6_address</code></em> [ port<br>
@@ -681,7 +683,7 @@ view
preferred-glue <em class="replaceable"><code>string</code></em>;<br>
prefetch <em class="replaceable"><code>integer</code></em> [ <em class="replaceable"><code>integer</code></em> ];<br>
provide-ixfr <em class="replaceable"><code>boolean</code></em>;<br>
qname-minimization ( strict | relaxed | disabled );<br>
qname-minimization ( strict | relaxed | disabled | off );<br>
query-source ( ( [ address ] ( <em class="replaceable"><code>ipv4_address</code></em> | * ) [ port (<br>
    <em class="replaceable"><code>integer</code></em> | * ) ] ) | ( [ [ address ] ( <em class="replaceable"><code>ipv4_address</code></em> | * ) ]<br>
    port ( <em class="replaceable"><code>integer</code></em> | * ) ) ) [ dscp <em class="replaceable"><code>integer</code></em> ];<br>
@@ -727,7 +729,7 @@ view
    nsip-enable <em class="replaceable"><code>boolean</code></em> ] [ nsdname-enable <em class="replaceable"><code>boolean</code></em> ] [<br>
    dnsrps-enable <em class="replaceable"><code>boolean</code></em> ] [ dnsrps-options { <em class="replaceable"><code>unspecified-text</code></em><br>
    } ];<br>
root-delegation-only [ exclude { <em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
root-delegation-only [ exclude { <em class="replaceable"><code>string</code></em>; ... } ];<br>
root-key-sentinel <em class="replaceable"><code>boolean</code></em>;<br>
rrset-order { [ class <em class="replaceable"><code>string</code></em> ] [ type <em class="replaceable"><code>string</code></em> ] [ name<br>
    <em class="replaceable"><code>quoted_string</code></em> ] <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>string</code></em>; ... };<br>
@@ -789,6 +791,7 @@ view
update-check-ksk <em class="replaceable"><code>boolean</code></em>;<br>
use-alt-transfer-source <em class="replaceable"><code>boolean</code></em>;<br>
v6-bias <em class="replaceable"><code>integer</code></em>;<br>
validate-except { <em class="replaceable"><code>string</code></em>; ... };<br>
zero-no-soa-ttl <em class="replaceable"><code>boolean</code></em>;<br>
zero-no-soa-ttl-cache <em class="replaceable"><code>boolean</code></em>;<br>
zone <em class="replaceable"><code>string</code></em> [ <em class="replaceable"><code>class</code></em> ] {<br>
@@ -853,7 +856,6 @@ view
max-zone-ttl ( unlimited | <em class="replaceable"><code>ttlval</code></em> );<br>
min-refresh-time <em class="replaceable"><code>integer</code></em>;<br>
min-retry-time <em class="replaceable"><code>integer</code></em>;<br>
mirror <em class="replaceable"><code>boolean</code></em>;<br>
multi-master <em class="replaceable"><code>boolean</code></em>;<br>
notify ( explicit | master-only | <em class="replaceable"><code>boolean</code></em> );<br>
notify-delay <em class="replaceable"><code>integer</code></em>;<br>
@@ -868,9 +870,8 @@ view
request-expire <em class="replaceable"><code>boolean</code></em>;<br>
request-ixfr <em class="replaceable"><code>boolean</code></em>;<br>
serial-update-method ( date | increment | unixtime );<br>
server-addresses { ( <em class="replaceable"><code>ipv4_address</code></em> | <em class="replaceable"><code>ipv6_address</code></em> ) [<br>
    port <em class="replaceable"><code>integer</code></em> ]; ... };<br>
server-names { <em class="replaceable"><code>quoted_string</code></em>; ... };<br>
server-addresses { ( <em class="replaceable"><code>ipv4_address</code></em> | <em class="replaceable"><code>ipv6_address</code></em> ); ... };<br>
server-names { <em class="replaceable"><code>string</code></em>; ... };<br>
sig-signing-nodes <em class="replaceable"><code>integer</code></em>;<br>
sig-signing-signatures <em class="replaceable"><code>integer</code></em>;<br>
sig-signing-type <em class="replaceable"><code>integer</code></em>;<br>
@@ -880,15 +881,15 @@ view
transfer-source-v6 ( <em class="replaceable"><code>ipv6_address</code></em> | * ) [ port (<br>
    <em class="replaceable"><code>integer</code></em> | * ) ] [ dscp <em class="replaceable"><code>integer</code></em> ];<br>
try-tcp-refresh <em class="replaceable"><code>boolean</code></em>;<br>
type ( primary | master | secondary | slave |<br>
type ( primary | master | secondary | slave | mirror |<br>
    delegation-only | forward | hint | redirect |<br>
    static-stub | stub );<br>
update-check-ksk <em class="replaceable"><code>boolean</code></em>;<br>
update-policy ( local | { ( deny | grant ) <em class="replaceable"><code>string</code></em> (<br>
    6to4-self | external | krb5-self | krb5-subdomain |<br>
    ms-self | ms-subdomain | name | self | selfsub |<br>
    selfwild | subdomain | tcp-self | wildcard | zonesub )<br>
    [ <em class="replaceable"><code>string</code></em> ] <em class="replaceable"><code>rrtypelist</code></em>; ... };<br>
    6to4-self | external | krb5-self | krb5-selfsub |<br>
    krb5-subdomain | ms-self | ms-selfsub | ms-subdomain |<br>
    name | self | selfsub | selfwild | subdomain | tcp-self<br>
    | wildcard | zonesub ) [ <em class="replaceable"><code>string</code></em> ] <em class="replaceable"><code>rrtypelist</code></em>; ... };<br>
use-alt-transfer-source <em class="replaceable"><code>boolean</code></em>;<br>
zero-no-soa-ttl <em class="replaceable"><code>boolean</code></em>;<br>
zone-statistics ( full | terse | none | <em class="replaceable"><code>boolean</code></em> );<br>
@@ -960,7 +961,6 @@ zone
max-zone-ttl ( unlimited | <em class="replaceable"><code>ttlval</code></em> );<br>
min-refresh-time <em class="replaceable"><code>integer</code></em>;<br>
min-retry-time <em class="replaceable"><code>integer</code></em>;<br>
mirror <em class="replaceable"><code>boolean</code></em>;<br>
multi-master <em class="replaceable"><code>boolean</code></em>;<br>
notify ( explicit | master-only | <em class="replaceable"><code>boolean</code></em> );<br>
notify-delay <em class="replaceable"><code>integer</code></em>;<br>
@@ -973,9 +973,8 @@ zone
request-expire <em class="replaceable"><code>boolean</code></em>;<br>
request-ixfr <em class="replaceable"><code>boolean</code></em>;<br>
serial-update-method ( date | increment | unixtime );<br>
server-addresses { ( <em class="replaceable"><code>ipv4_address</code></em> | <em class="replaceable"><code>ipv6_address</code></em> ) [ port<br>
    <em class="replaceable"><code>integer</code></em> ]; ... };<br>
server-names { <em class="replaceable"><code>quoted_string</code></em>; ... };<br>
server-addresses { ( <em class="replaceable"><code>ipv4_address</code></em> | <em class="replaceable"><code>ipv6_address</code></em> ); ... };<br>
server-names { <em class="replaceable"><code>string</code></em>; ... };<br>
sig-signing-nodes <em class="replaceable"><code>integer</code></em>;<br>
sig-signing-signatures <em class="replaceable"><code>integer</code></em>;<br>
sig-signing-type <em class="replaceable"><code>integer</code></em>;<br>
@@ -985,13 +984,15 @@ zone
transfer-source-v6 ( <em class="replaceable"><code>ipv6_address</code></em> | * ) [ port ( <em class="replaceable"><code>integer</code></em> | * )<br>
    ] [ dscp <em class="replaceable"><code>integer</code></em> ];<br>
try-tcp-refresh <em class="replaceable"><code>boolean</code></em>;<br>
type ( primary | master | secondary | slave | delegation-only |<br>
    forward | hint | redirect | static-stub | stub );<br>
type ( primary | master | secondary | slave | mirror |<br>
    delegation-only | forward | hint | redirect | static-stub |<br>
    stub );<br>
update-check-ksk <em class="replaceable"><code>boolean</code></em>;<br>
update-policy ( local | { ( deny | grant ) <em class="replaceable"><code>string</code></em> ( 6to4-self |<br>
    external | krb5-self | krb5-subdomain | ms-self | ms-subdomain<br>
    | name | self | selfsub | selfwild | subdomain | tcp-self |<br>
    wildcard | zonesub ) [ <em class="replaceable"><code>string</code></em> ] <em class="replaceable"><code>rrtypelist</code></em>; ... };<br>
    external | krb5-self | krb5-selfsub | krb5-subdomain | ms-self<br>
    | ms-selfsub | ms-subdomain | name | self | selfsub | selfwild<br>
    | subdomain | tcp-self | wildcard | zonesub ) [ <em class="replaceable"><code>string</code></em> ]<br>
    <em class="replaceable"><code>rrtypelist</code></em>; ... };<br>
use-alt-transfer-source <em class="replaceable"><code>boolean</code></em>;<br>
zero-no-soa-ttl <em class="replaceable"><code>boolean</code></em>;<br>
zone-statistics ( full | terse | none | <em class="replaceable"><code>boolean</code></em> );<br>
+989 -680
View File
File diff suppressed because it is too large Load Diff
+76 -76
View File
@@ -13,6 +13,9 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <isc/buffer.h>
#include <isc/httpd.h>
#include <isc/json.h>
@@ -67,7 +70,7 @@ stats_dumparg {
void *arg; /* type dependent argument */
int ncounters; /* for general statistics */
int *counterindices; /* for general statistics */
isc_uint64_t *countervalues; /* for general statistics */
uint64_t *countervalues; /* for general statistics */
isc_result_t result;
} stats_dumparg_t;
@@ -91,6 +94,7 @@ user_zonetype( dns_zone_t *zone ) {
{ dns_zone_none, "none" },
{ dns_zone_master, "master" },
{ dns_zone_slave, "slave" },
{ dns_zone_mirror, "mirror" },
{ dns_zone_stub, "stub" },
{ dns_zone_staticstub, "static-stub" },
{ dns_zone_key, "key" },
@@ -1048,7 +1052,7 @@ init_desc(void) {
* Dump callback functions.
*/
static void
generalstat_dump(isc_statscounter_t counter, isc_uint64_t val, void *arg) {
generalstat_dump(isc_statscounter_t counter, uint64_t val, void *arg) {
stats_dumparg_t *dumparg = arg;
REQUIRE(counter < dumparg->ncounters);
@@ -1058,10 +1062,10 @@ generalstat_dump(isc_statscounter_t counter, isc_uint64_t val, void *arg) {
static isc_result_t
dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
const char *category, const char **desc, int ncounters,
int *indices, isc_uint64_t *values, int options)
int *indices, uint64_t *values, int options)
{
int i, idx;
isc_uint64_t value;
uint64_t value;
stats_dumparg_t dumparg;
FILE *fp;
#ifdef HAVE_LIBXML2
@@ -1106,7 +1110,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
switch (dumparg.type) {
case isc_statsformat_file:
fp = arg;
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
fprintf(fp, "%20" PRIu64 " %s\n",
value, desc[idx]);
break;
case isc_statsformat_xml:
@@ -1134,7 +1138,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
ISC_XMLCHAR
"counter"));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" ISC_PRINT_QUADFORMAT "u", value));
"%" PRIu64, value));
TRY0(xmlTextWriterEndElement(writer));
/* </counter> */
@@ -1151,7 +1155,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
ISC_XMLCHAR
desc[idx]));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" ISC_PRINT_QUADFORMAT "u", value));
"%" PRIu64, value));
TRY0(xmlTextWriterEndElement(writer));
/* counter */
}
@@ -1179,7 +1183,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
}
static void
rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
char typebuf[64];
const char *typestr;
stats_dumparg_t *dumparg = arg;
@@ -1203,7 +1207,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
switch (dumparg->type) {
case isc_statsformat_file:
fp = dumparg->arg;
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, typestr);
fprintf(fp, "%20" PRIu64 " %s\n", val, typestr);
break;
case isc_statsformat_xml:
#ifdef HAVE_LIBXML2
@@ -1215,7 +1219,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
ISC_XMLCHAR typestr));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" ISC_PRINT_QUADFORMAT "u",
"%" PRIu64,
val));
TRY0(xmlTextWriterEndElement(writer)); /* type */
@@ -1243,13 +1247,13 @@ rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
}
static void
rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
stats_dumparg_t *dumparg = arg;
FILE *fp;
char typebuf[64];
const char *typestr;
isc_boolean_t nxrrset = ISC_FALSE;
isc_boolean_t stale = ISC_FALSE;
bool nxrrset = false;
bool stale = false;
#ifdef HAVE_LIBXML2
xmlTextWriterPtr writer;
int xmlrc;
@@ -1273,16 +1277,16 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
if ((DNS_RDATASTATSTYPE_ATTR(type) & DNS_RDATASTATSTYPE_ATTR_NXRRSET)
!= 0)
nxrrset = ISC_TRUE;
nxrrset = true;
if ((DNS_RDATASTATSTYPE_ATTR(type) & DNS_RDATASTATSTYPE_ATTR_STALE)
!= 0)
stale = ISC_TRUE;
stale = true;
switch (dumparg->type) {
case isc_statsformat_file:
fp = dumparg->arg;
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s%s%s\n", val,
fprintf(fp, "%20" PRIu64 " %s%s%s\n", val,
stale ? "#" : "", nxrrset ? "!" : "", typestr);
break;
case isc_statsformat_xml:
@@ -1298,7 +1302,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counter"));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" ISC_PRINT_QUADFORMAT "u",
"%" PRIu64,
val));
TRY0(xmlTextWriterEndElement(writer)); /* counter */
@@ -1329,7 +1333,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
}
static void
opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
FILE *fp;
isc_buffer_t b;
char codebuf[64];
@@ -1349,7 +1353,7 @@ opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
switch (dumparg->type) {
case isc_statsformat_file:
fp = dumparg->arg;
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, codebuf);
fprintf(fp, "%20" PRIu64 " %s\n", val, codebuf);
break;
case isc_statsformat_xml:
#ifdef HAVE_LIBXML2
@@ -1358,7 +1362,7 @@ opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
ISC_XMLCHAR codebuf ));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" ISC_PRINT_QUADFORMAT "u",
"%" PRIu64,
val));
TRY0(xmlTextWriterEndElement(writer)); /* counter */
#endif
@@ -1386,7 +1390,7 @@ opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
}
static void
rcodestat_dump(dns_rcode_t code, isc_uint64_t val, void *arg) {
rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
FILE *fp;
isc_buffer_t b;
char codebuf[64];
@@ -1406,7 +1410,7 @@ rcodestat_dump(dns_rcode_t code, isc_uint64_t val, void *arg) {
switch (dumparg->type) {
case isc_statsformat_file:
fp = dumparg->arg;
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, codebuf);
fprintf(fp, "%20" PRIu64 " %s\n", val, codebuf);
break;
case isc_statsformat_xml:
#ifdef HAVE_LIBXML2
@@ -1415,7 +1419,7 @@ rcodestat_dump(dns_rcode_t code, isc_uint64_t val, void *arg) {
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
ISC_XMLCHAR codebuf ));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" ISC_PRINT_QUADFORMAT "u",
"%" PRIu64,
val));
TRY0(xmlTextWriterEndElement(writer)); /* counter */
#endif
@@ -1460,7 +1464,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
isc_result_t result;
char buf[1024 + 32]; /* sufficiently large for zone name and class */
dns_rdataclass_t rdclass;
isc_uint32_t serial;
uint32_t serial;
xmlTextWriterPtr writer = arg;
dns_zonestat_level_t statlevel;
int xmlrc;
@@ -1504,8 +1508,8 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
isc_stats_t *zonestats;
isc_stats_t *gluecachestats;
dns_stats_t *rcvquerystats;
isc_uint64_t nsstat_values[ns_statscounter_max];
isc_uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
uint64_t nsstat_values[ns_statscounter_max];
uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
zonestats = dns_zone_getrequeststats(zone);
if (zonestats != NULL) {
@@ -1578,7 +1582,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
}
static isc_result_t
generatexml(named_server_t *server, isc_uint32_t flags,
generatexml(named_server_t *server, uint32_t flags,
int *buflen, xmlChar **buf)
{
char boottime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
@@ -1591,17 +1595,17 @@ generatexml(named_server_t *server, isc_uint32_t flags,
dns_view_t *view;
stats_dumparg_t dumparg;
dns_stats_t *cacherrstats;
isc_uint64_t nsstat_values[ns_statscounter_max];
isc_uint64_t resstat_values[dns_resstatscounter_max];
isc_uint64_t adbstat_values[dns_adbstats_max];
isc_uint64_t zonestat_values[dns_zonestatscounter_max];
isc_uint64_t sockstat_values[isc_sockstatscounter_max];
isc_uint64_t udpinsizestat_values[dns_sizecounter_in_max];
isc_uint64_t udpoutsizestat_values[dns_sizecounter_out_max];
isc_uint64_t tcpinsizestat_values[dns_sizecounter_in_max];
isc_uint64_t tcpoutsizestat_values[dns_sizecounter_out_max];
uint64_t nsstat_values[ns_statscounter_max];
uint64_t resstat_values[dns_resstatscounter_max];
uint64_t adbstat_values[dns_adbstats_max];
uint64_t zonestat_values[dns_zonestatscounter_max];
uint64_t sockstat_values[isc_sockstatscounter_max];
uint64_t udpinsizestat_values[dns_sizecounter_in_max];
uint64_t udpoutsizestat_values[dns_sizecounter_out_max];
uint64_t tcpinsizestat_values[dns_sizecounter_in_max];
uint64_t tcpoutsizestat_values[dns_sizecounter_out_max];
#ifdef HAVE_DNSTAP
isc_uint64_t dnstapstat_values[dns_dnstapcounter_max];
uint64_t dnstapstat_values[dns_dnstapcounter_max];
#endif
isc_result_t result;
@@ -1915,7 +1919,7 @@ generatexml(named_server_t *server, isc_uint32_t flags,
if ((flags & STATS_XML_ZONES) != 0) {
TRY0(xmlTextWriterStartElement(writer,
ISC_XMLCHAR "zones"));
result = dns_zt_apply(view->zonetable, ISC_TRUE,
result = dns_zt_apply(view->zonetable, true,
NULL, zone_xmlrender, writer);
if (result != ISC_R_SUCCESS)
goto error;
@@ -2053,7 +2057,7 @@ wrap_xmlfree(isc_buffer_t *buffer, void *arg) {
}
static isc_result_t
render_xml(isc_uint32_t flags, const char *url, isc_httpdurl_t *urlinfo,
render_xml(uint32_t flags, const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
@@ -2228,7 +2232,7 @@ wrap_jsonfree(isc_buffer_t *buffer, void *arg) {
static json_object *
addzone(char *name, char *classname, const char *ztype,
isc_uint32_t serial, isc_boolean_t add_serial)
uint32_t serial, bool add_serial)
{
json_object *node = json_object_new_object();
@@ -2255,7 +2259,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
char *zone_name_only = NULL;
char *class_only = NULL;
dns_rdataclass_t rdclass;
isc_uint32_t serial;
uint32_t serial;
json_object *zonearray = (json_object *) arg;
json_object *zoneobj = NULL;
dns_zonestat_level_t statlevel;
@@ -2273,10 +2277,10 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
if (dns_zone_getserial(zone, &serial) != ISC_R_SUCCESS)
zoneobj = addzone(zone_name_only, class_only,
user_zonetype(zone), 0, ISC_FALSE);
user_zonetype(zone), 0, false);
else
zoneobj = addzone(zone_name_only, class_only,
user_zonetype(zone), serial, ISC_TRUE);
user_zonetype(zone), serial, true);
if (zoneobj == NULL)
return (ISC_R_NOMEMORY);
@@ -2285,8 +2289,8 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
isc_stats_t *zonestats;
isc_stats_t *gluecachestats;
dns_stats_t *rcvquerystats;
isc_uint64_t nsstat_values[ns_statscounter_max];
isc_uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
uint64_t nsstat_values[ns_statscounter_max];
uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
zonestats = dns_zone_getrequeststats(zone);
if (zonestats != NULL) {
@@ -2376,7 +2380,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
static isc_result_t
generatejson(named_server_t *server, size_t *msglen,
const char **msg, json_object **rootp, isc_uint32_t flags)
const char **msg, json_object **rootp, uint32_t flags)
{
dns_view_t *view;
isc_result_t result = ISC_R_SUCCESS;
@@ -2386,17 +2390,17 @@ generatejson(named_server_t *server, size_t *msglen,
json_object *tcpreq4 = NULL, *tcpresp4 = NULL;
json_object *udpreq6 = NULL, *udpresp6 = NULL;
json_object *tcpreq6 = NULL, *tcpresp6 = NULL;
isc_uint64_t nsstat_values[ns_statscounter_max];
isc_uint64_t resstat_values[dns_resstatscounter_max];
isc_uint64_t adbstat_values[dns_adbstats_max];
isc_uint64_t zonestat_values[dns_zonestatscounter_max];
isc_uint64_t sockstat_values[isc_sockstatscounter_max];
isc_uint64_t udpinsizestat_values[dns_sizecounter_in_max];
isc_uint64_t udpoutsizestat_values[dns_sizecounter_out_max];
isc_uint64_t tcpinsizestat_values[dns_sizecounter_in_max];
isc_uint64_t tcpoutsizestat_values[dns_sizecounter_out_max];
uint64_t nsstat_values[ns_statscounter_max];
uint64_t resstat_values[dns_resstatscounter_max];
uint64_t adbstat_values[dns_adbstats_max];
uint64_t zonestat_values[dns_zonestatscounter_max];
uint64_t sockstat_values[isc_sockstatscounter_max];
uint64_t udpinsizestat_values[dns_sizecounter_in_max];
uint64_t udpoutsizestat_values[dns_sizecounter_out_max];
uint64_t tcpinsizestat_values[dns_sizecounter_in_max];
uint64_t tcpoutsizestat_values[dns_sizecounter_out_max];
#ifdef HAVE_DNSTAP
isc_uint64_t dnstapstat_values[dns_dnstapcounter_max];
uint64_t dnstapstat_values[dns_dnstapcounter_max];
#endif
stats_dumparg_t dumparg;
char boottime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
@@ -2610,7 +2614,7 @@ generatejson(named_server_t *server, size_t *msglen,
if ((flags & STATS_JSON_ZONES) != 0) {
result = dns_zt_apply(view->zonetable,
ISC_TRUE,
true,
NULL, zone_jsonrender,
za);
if (result != ISC_R_SUCCESS) {
@@ -2955,7 +2959,7 @@ generatejson(named_server_t *server, size_t *msglen,
}
static isc_result_t
render_json(isc_uint32_t flags,
render_json(uint32_t flags,
const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers,
void *arg, unsigned int *retcode, const char **retmsg,
@@ -3182,7 +3186,7 @@ shutdown_listener(named_statschannel_t *listener) {
isc_httpdmgr_shutdown(&listener->httpdmgr);
}
static isc_boolean_t
static bool
client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
named_statschannel_t *listener = arg;
dns_aclenv_t *env =
@@ -3200,7 +3204,7 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
&match, NULL) == ISC_R_SUCCESS) && match > 0)
{
UNLOCK(&listener->lock);
return (ISC_TRUE);
return (true);
}
UNLOCK(&listener->lock);
@@ -3209,7 +3213,7 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"rejected statistics connection from %s", socktext);
return (ISC_FALSE);
return (false);
}
static void
@@ -3222,7 +3226,7 @@ destroy_listener(void *arg) {
/* We don't have to acquire the lock here since it's already unlinked */
dns_acl_detach(&listener->acl);
DESTROYLOCK(&listener->lock);
isc_mutex_destroy(&listener->lock);
isc_mem_putanddetach(&listener->mctx, listener, sizeof(*listener));
}
@@ -3249,11 +3253,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
listener->mctx = NULL;
ISC_LINK_INIT(listener, link);
result = isc_mutex_init(&listener->lock);
if (result != ISC_R_SUCCESS) {
isc_mem_put(server->mctx, listener, sizeof(*listener));
return (ISC_R_FAILURE);
}
isc_mutex_init(&listener->lock);
isc_mem_attach(server->mctx, &listener->mctx);
@@ -3281,7 +3281,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
isc_socket_setname(sock, "statchannel", NULL);
#ifndef ISC_ALLOW_MAPPED
isc_socket_ipv6only(sock, ISC_TRUE);
isc_socket_ipv6only(sock, true);
#endif
result = isc_socket_bind(sock, addr, ISC_SOCKET_REUSEADDRESS);
@@ -3336,7 +3336,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/traffic",
render_json_traffic, server);
#endif
isc_httpdmgr_addurl2(listener->httpdmgr, "/bind9.xsl", ISC_TRUE,
isc_httpdmgr_addurl2(listener->httpdmgr, "/bind9.xsl", true,
render_xsl, server);
*listenerp = listener;
@@ -3348,7 +3348,7 @@ cleanup:
if (result != ISC_R_SUCCESS) {
if (listener->acl != NULL)
dns_acl_detach(&listener->acl);
DESTROYLOCK(&listener->lock);
isc_mutex_destroy(&listener->lock);
isc_mem_putanddetach(&listener->mctx, listener,
sizeof(*listener));
}
@@ -3566,12 +3566,12 @@ named_stats_dump(named_server_t *server, FILE *fp) {
dns_view_t *view;
dns_zone_t *zone, *next;
stats_dumparg_t dumparg;
isc_uint64_t nsstat_values[ns_statscounter_max];
isc_uint64_t resstat_values[dns_resstatscounter_max];
isc_uint64_t adbstat_values[dns_adbstats_max];
isc_uint64_t zonestat_values[dns_zonestatscounter_max];
isc_uint64_t sockstat_values[isc_sockstatscounter_max];
isc_uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
uint64_t nsstat_values[ns_statscounter_max];
uint64_t resstat_values[dns_resstatscounter_max];
uint64_t adbstat_values[dns_adbstats_max];
uint64_t zonestat_values[dns_zonestatscounter_max];
uint64_t sockstat_values[isc_sockstatscounter_max];
uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
RUNTIME_CHECK(isc_once_do(&once, init_desc) == ISC_R_SUCCESS);
+4 -2
View File
@@ -14,6 +14,8 @@
#include <config.h>
#include <inttypes.h>
#include <isc/buffer.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/mem.h>
@@ -50,7 +52,7 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
isc_result_t result;
dns_tkeyctx_t *tctx = NULL;
const char *s;
isc_uint32_t n;
uint32_t n;
dns_fixedname_t fname;
dns_name_t *name;
isc_buffer_t b;
@@ -101,7 +103,7 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
isc_buffer_add(&b, strlen(s));
name = dns_fixedname_initname(&fname);
RETERR(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
RETERR(dst_gssapi_acquirecred(name, ISC_FALSE, &tctx->gsscred));
RETERR(dst_gssapi_acquirecred(name, false, &tctx->gsscred));
}
obj = NULL;
+4 -2
View File
@@ -14,6 +14,8 @@
#include <config.h>
#include <inttypes.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/mem.h>
@@ -43,7 +45,7 @@ add_initial_keys(const cfg_obj_t *list, dns_tsig_keyring_t *ring,
int secretlen = 0;
isc_result_t ret;
isc_stdtime_t now;
isc_uint16_t bits;
uint16_t bits;
for (element = cfg_list_first(list);
element != NULL;
@@ -109,7 +111,7 @@ add_initial_keys(const cfg_obj_t *list, dns_tsig_keyring_t *ring,
isc_stdtime_get(&now);
ret = dns_tsigkey_create(&keyname, alg, secret, secretlen,
ISC_FALSE, NULL, now, now,
false, NULL, now, now,
mctx, ring, &tsigkey);
isc_mem_put(mctx, secret, secretalloc);
secret = NULL;
+46 -39
View File
@@ -12,9 +12,11 @@
#include <config.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <dlfcn.h>
#include <dns/log.h>
@@ -43,7 +45,7 @@ typedef struct dlopen_data {
unsigned int flags;
isc_mutex_t lock;
int version;
isc_boolean_t in_configure;
bool in_configure;
dlz_dlopen_version_t *dlz_version;
dlz_dlopen_create_t *dlz_create;
@@ -66,14 +68,14 @@ typedef struct dlopen_data {
#define MAYBE_LOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
cd->in_configure == ISC_FALSE) \
cd->in_configure == false) \
LOCK(&cd->lock); \
} while (0)
#define MAYBE_UNLOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
cd->in_configure == ISC_FALSE) \
cd->in_configure == false) \
UNLOCK(&cd->lock); \
} while (0)
@@ -193,7 +195,7 @@ dlopen_dlz_lookup(const char *zone, const char *name, void *driverarg,
* Load a symbol from the library
*/
static void *
dl_load_symbol(dlopen_data_t *cd, const char *symbol, isc_boolean_t mandatory) {
dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
void *ptr = dlsym(cd->dl_handle, symbol);
if (ptr == NULL && mandatory) {
dlopen_log(ISC_LOG_ERROR,
@@ -250,9 +252,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
}
/* Initialize the lock */
result = isc_mutex_init(&cd->lock);
if (result != ISC_R_SUCCESS)
goto failed;
isc_mutex_init(&cd->lock);
/* Open the library */
dlopen_flags = RTLD_NOW|RTLD_GLOBAL;
@@ -281,13 +281,13 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
/* Find the symbols */
cd->dlz_version = (dlz_dlopen_version_t *)
dl_load_symbol(cd, "dlz_version", ISC_TRUE);
dl_load_symbol(cd, "dlz_version", true);
cd->dlz_create = (dlz_dlopen_create_t *)
dl_load_symbol(cd, "dlz_create", ISC_TRUE);
dl_load_symbol(cd, "dlz_create", true);
cd->dlz_lookup = (dlz_dlopen_lookup_t *)
dl_load_symbol(cd, "dlz_lookup", ISC_TRUE);
dl_load_symbol(cd, "dlz_lookup", true);
cd->dlz_findzonedb = (dlz_dlopen_findzonedb_t *)
dl_load_symbol(cd, "dlz_findzonedb", ISC_TRUE);
dl_load_symbol(cd, "dlz_findzonedb", true);
if (cd->dlz_create == NULL ||
cd->dlz_version == NULL ||
@@ -300,29 +300,29 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
}
cd->dlz_allowzonexfr = (dlz_dlopen_allowzonexfr_t *)
dl_load_symbol(cd, "dlz_allowzonexfr", ISC_FALSE);
dl_load_symbol(cd, "dlz_allowzonexfr", false);
cd->dlz_allnodes = (dlz_dlopen_allnodes_t *)
dl_load_symbol(cd, "dlz_allnodes",
ISC_TF(cd->dlz_allowzonexfr != NULL));
(cd->dlz_allowzonexfr != NULL));
cd->dlz_authority = (dlz_dlopen_authority_t *)
dl_load_symbol(cd, "dlz_authority", ISC_FALSE);
dl_load_symbol(cd, "dlz_authority", false);
cd->dlz_newversion = (dlz_dlopen_newversion_t *)
dl_load_symbol(cd, "dlz_newversion", ISC_FALSE);
dl_load_symbol(cd, "dlz_newversion", false);
cd->dlz_closeversion = (dlz_dlopen_closeversion_t *)
dl_load_symbol(cd, "dlz_closeversion",
ISC_TF(cd->dlz_newversion != NULL));
(cd->dlz_newversion != NULL));
cd->dlz_configure = (dlz_dlopen_configure_t *)
dl_load_symbol(cd, "dlz_configure", ISC_FALSE);
dl_load_symbol(cd, "dlz_configure", false);
cd->dlz_ssumatch = (dlz_dlopen_ssumatch_t *)
dl_load_symbol(cd, "dlz_ssumatch", ISC_FALSE);
dl_load_symbol(cd, "dlz_ssumatch", false);
cd->dlz_addrdataset = (dlz_dlopen_addrdataset_t *)
dl_load_symbol(cd, "dlz_addrdataset", ISC_FALSE);
dl_load_symbol(cd, "dlz_addrdataset", false);
cd->dlz_subrdataset = (dlz_dlopen_subrdataset_t *)
dl_load_symbol(cd, "dlz_subrdataset", ISC_FALSE);
dl_load_symbol(cd, "dlz_subrdataset", false);
cd->dlz_delrdataset = (dlz_dlopen_delrdataset_t *)
dl_load_symbol(cd, "dlz_delrdataset", ISC_FALSE);
dl_load_symbol(cd, "dlz_delrdataset", false);
cd->dlz_destroy = (dlz_dlopen_destroy_t *)
dl_load_symbol(cd, "dlz_destroy", ISC_FALSE);
dl_load_symbol(cd, "dlz_destroy", false);
/* Check the version of the API is the same */
cd->version = cd->dlz_version(&cd->flags);
@@ -362,15 +362,19 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
failed:
dlopen_log(ISC_LOG_ERROR, "dlz_dlopen of '%s' failed", dlzname);
if (cd->dl_path != NULL)
if (cd->dl_path != NULL) {
isc_mem_free(mctx, cd->dl_path);
if (cd->dlzname != NULL)
}
if (cd->dlzname != NULL) {
isc_mem_free(mctx, cd->dlzname);
if (dlopen_flags != 0)
(void) isc_mutex_destroy(&cd->lock);
}
if (dlopen_flags != 0) {
isc_mutex_destroy(&cd->lock);
}
#ifdef HAVE_DLCLOSE
if (cd->dl_handle)
if (cd->dl_handle) {
dlclose(cd->dl_handle);
}
#endif
isc_mem_put(mctx, cd, sizeof(*cd));
isc_mem_destroy(&mctx);
@@ -393,17 +397,20 @@ dlopen_dlz_destroy(void *driverarg, void *dbdata) {
MAYBE_UNLOCK(cd);
}
if (cd->dl_path)
if (cd->dl_path) {
isc_mem_free(cd->mctx, cd->dl_path);
if (cd->dlzname)
}
if (cd->dlzname) {
isc_mem_free(cd->mctx, cd->dlzname);
}
#ifdef HAVE_DLCLOSE
if (cd->dl_handle)
if (cd->dl_handle) {
dlclose(cd->dl_handle);
}
#endif
(void) isc_mutex_destroy(&cd->lock);
isc_mutex_destroy(&cd->lock);
mctx = cd->mctx;
isc_mem_put(mctx, cd, sizeof(*cd));
@@ -435,7 +442,7 @@ dlopen_dlz_newversion(const char *zone, void *driverarg, void *dbdata,
* Called to end a transaction
*/
static void
dlopen_dlz_closeversion(const char *zone, isc_boolean_t commit,
dlopen_dlz_closeversion(const char *zone, bool commit,
void *driverarg, void *dbdata, void **versionp)
{
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
@@ -468,9 +475,9 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
return (ISC_R_SUCCESS);
MAYBE_LOCK(cd);
cd->in_configure = ISC_TRUE;
cd->in_configure = true;
result = cd->dlz_configure(view, dlzdb, cd->dbdata);
cd->in_configure = ISC_FALSE;
cd->in_configure = false;
MAYBE_UNLOCK(cd);
return (result);
@@ -480,18 +487,18 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
/*
* Check for authority to change a name.
*/
static isc_boolean_t
static bool
dlopen_dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
const char *type, const char *key, isc_uint32_t keydatalen,
const char *type, const char *key, uint32_t keydatalen,
unsigned char *keydata, void *driverarg, void *dbdata)
{
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
isc_boolean_t ret;
bool ret;
UNUSED(driverarg);
if (cd->dlz_ssumatch == NULL)
return (ISC_FALSE);
return (false);
MAYBE_LOCK(cd);
ret = cd->dlz_ssumatch(signer, name, tcpaddr, type, key, keydatalen,
+4 -3
View File
@@ -15,6 +15,7 @@
/*! \file */
#include <pwd.h>
#include <stdbool.h>
#include <isc/types.h>
@@ -49,12 +50,12 @@ void
named_os_minprivs(void);
FILE *
named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user);
named_os_openfile(const char *filename, mode_t mode, bool switch_user);
void
named_os_writepidfile(const char *filename, isc_boolean_t first_time);
named_os_writepidfile(const char *filename, bool first_time);
isc_boolean_t
bool
named_os_issingleton(const char *filename);
void
+61 -166
View File
@@ -13,6 +13,7 @@
#include <config.h>
#include <stdarg.h>
#include <stdbool.h>
#include <sys/types.h> /* dev_t FreeBSD 2.1 */
#include <sys/stat.h>
@@ -22,8 +23,8 @@
#include <ctype.h>
#include <errno.h>
#include <grp.h>
#include <fcntl.h>
#include <grp.h> /* Required for initgroups() on IRIX. */
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -39,7 +40,7 @@
#include <isc/print.h>
#include <isc/resource.h>
#include <isc/result.h>
#include <isc/strerror.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <named/globals.h>
@@ -58,68 +59,17 @@ static int singletonfd = -1;
#define ISC_FACILITY LOG_DAEMON
#endif
/*
* If there's no <sys/capability.h>, we don't care about <sys/prctl.h>
*/
#ifndef HAVE_SYS_CAPABILITY_H
#undef HAVE_SYS_PRCTL_H
#endif
/*
* Linux defines:
* (T) HAVE_LINUXTHREADS
* (C) HAVE_SYS_CAPABILITY_H
* (P) HAVE_SYS_PRCTL_H
* The possible cases are:
* none: setuid() normally
* T: no setuid()
* C: setuid() normally, drop caps (keep CAP_SETUID)
* T+C: no setuid(), drop caps (don't keep CAP_SETUID)
* T+C+P: setuid() early, drop caps (keep CAP_SETUID)
* C+P: setuid() normally, drop caps (keep CAP_SETUID)
* P: not possible
* T+P: not possible
*
* if (C)
* caps = BIND_SERVICE + CHROOT + SETGID
* if ((T && C && P) || !T)
* caps += SETUID
* endif
* capset(caps)
* endif
* if (T && C && P && -u)
* setuid()
* else if (T && -u)
* fail
* --> start threads
* if (!T && -u)
* setuid()
* if (C && (P || !-u))
* caps = BIND_SERVICE
* capset(caps)
* endif
*
* It will be nice when Linux threads work properly with setuid().
*/
#ifdef HAVE_LINUXTHREADS
static pid_t mainpid = 0;
#endif
static struct passwd *runas_pw = NULL;
static isc_boolean_t done_setuid = ISC_FALSE;
static bool done_setuid = false;
static int dfd[2] = { -1, -1 };
#ifdef HAVE_SYS_CAPABILITY_H
static isc_boolean_t non_root = ISC_FALSE;
static isc_boolean_t non_root_caps = ISC_FALSE;
static bool non_root = false;
static bool non_root_caps = false;
#include <sys/capability.h>
#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h> /* Required for prctl(). */
#endif /* HAVE_SYS_PRCTL_H */
#include <sys/prctl.h>
static void
linux_setcaps(cap_t caps) {
@@ -129,7 +79,7 @@ linux_setcaps(cap_t caps) {
return;
}
if (cap_set_proc(caps) < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("cap_set_proc() failed: %s:"
" please ensure that the capset kernel"
" module is loaded. see insmod(8)",
@@ -145,13 +95,13 @@ linux_setcaps(cap_t caps) {
if (err != -1 && curval) { \
err = cap_set_flag(caps, CAP_EFFECTIVE, 1, &capval, CAP_SET); \
if (err == -1) { \
isc__strerror(errno, strbuf, sizeof(strbuf)); \
strerror_r(errno, strbuf, sizeof(strbuf)); \
named_main_earlyfatal("cap_set_proc failed: %s", strbuf); \
} \
\
err = cap_set_flag(caps, CAP_PERMITTED, 1, &capval, CAP_SET); \
if (err == -1) { \
isc__strerror(errno, strbuf, sizeof(strbuf)); \
strerror_r(errno, strbuf, sizeof(strbuf)); \
named_main_earlyfatal("cap_set_proc failed: %s", strbuf); \
} \
} \
@@ -160,12 +110,12 @@ linux_setcaps(cap_t caps) {
do { \
caps = cap_init(); \
if (caps == NULL) { \
isc__strerror(errno, strbuf, sizeof(strbuf)); \
strerror_r(errno, strbuf, sizeof(strbuf)); \
named_main_earlyfatal("cap_init failed: %s", strbuf); \
} \
curcaps = cap_get_proc(); \
if (curcaps == NULL) { \
isc__strerror(errno, strbuf, sizeof(strbuf)); \
strerror_r(errno, strbuf, sizeof(strbuf)); \
named_main_earlyfatal("cap_get_proc failed: %s", strbuf); \
} \
} while (0)
@@ -200,15 +150,11 @@ linux_initialprivs(void) {
*/
SET_CAP(CAP_SYS_CHROOT);
#if defined(HAVE_SYS_PRCTL_H) || !defined(HAVE_LINUXTHREADS)
/*
* We can setuid() only if either the kernel supports keeping
* capabilities after setuid() (which we don't know until we've
* tried) or we're not using threads. If either of these is
* true, we want the setuid capability.
* We need setuid() as the kernel supports keeping capabilities after
* setuid().
*/
SET_CAP(CAP_SETUID);
#endif
/*
* Since we call initgroups, we need this.
@@ -274,7 +220,6 @@ linux_minprivs(void) {
FREE_CAP;
}
#ifdef HAVE_SYS_PRCTL_H
static void
linux_keepcaps(void) {
char strbuf[ISC_STRERRORSIZE];
@@ -285,20 +230,18 @@ linux_keepcaps(void) {
if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) < 0) {
if (errno != EINVAL) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("prctl() failed: %s", strbuf);
}
} else {
non_root_caps = ISC_TRUE;
non_root_caps = true;
if (getuid() != 0)
non_root = ISC_TRUE;
non_root = true;
}
}
#endif
#endif /* HAVE_SYS_CAPABILITY_H */
static void
setup_syslog(const char *progname) {
int options;
@@ -316,9 +259,6 @@ named_os_init(const char *progname) {
#ifdef HAVE_SYS_CAPABILITY_H
linux_initialprivs();
#endif
#ifdef HAVE_LINUXTHREADS
mainpid = getpid();
#endif
#ifdef SIGXFSZ
signal(SIGXFSZ, SIG_IGN);
#endif
@@ -330,13 +270,13 @@ named_os_daemonize(void) {
char strbuf[ISC_STRERRORSIZE];
if (pipe(dfd) == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("pipe(): %s", strbuf);
}
pid = fork();
if (pid == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("fork(): %s", strbuf);
}
if (pid != 0) {
@@ -361,12 +301,8 @@ named_os_daemonize(void) {
* We're the child.
*/
#ifdef HAVE_LINUXTHREADS
mainpid = getpid();
#endif
if (setsid() == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("setsid(): %s", strbuf);
}
@@ -428,16 +364,16 @@ named_os_closedevnull(void) {
}
}
static isc_boolean_t
static bool
all_digits(const char *s) {
if (*s == '\0')
return (ISC_FALSE);
return (false);
while (*s != '\0') {
if (!isdigit((*s)&0xff))
return (ISC_FALSE);
return (false);
s++;
}
return (ISC_TRUE);
return (true);
}
void
@@ -449,14 +385,14 @@ named_os_chroot(const char *root) {
if (root != NULL) {
#ifdef HAVE_CHROOT
if (chroot(root) < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("chroot(): %s", strbuf);
}
#else
named_main_earlyfatal("chroot(): disabled");
#endif
if (chdir("/") < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("chdir(/): %s", strbuf);
}
#ifdef HAVE_LIBSCF
@@ -483,7 +419,7 @@ named_os_inituserinfo(const char *username) {
if (getuid() == 0) {
if (initgroups(runas_pw->pw_name, runas_pw->pw_gid) < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("initgroups(): %s", strbuf);
}
}
@@ -496,44 +432,29 @@ named_os_changeuser(void) {
if (runas_pw == NULL || done_setuid)
return;
done_setuid = ISC_TRUE;
#ifdef HAVE_LINUXTHREADS
#ifdef HAVE_SYS_CAPABILITY_H
if (!non_root_caps) {
named_main_earlyfatal("-u with Linux threads not supported: "
"requires kernel support for "
"prctl(PR_SET_KEEPCAPS)");
}
#else
named_main_earlyfatal("-u with Linux threads not supported: "
"no capabilities support or capabilities "
"disabled at build time");
#endif
#endif
done_setuid = true;
if (setgid(runas_pw->pw_gid) < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("setgid(): %s", strbuf);
}
if (setuid(runas_pw->pw_uid) < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("setuid(): %s", strbuf);
}
#if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_DUMPABLE)
#if defined(HAVE_SYS_CAPABILITY_H)
/*
* Restore the ability of named to drop core after the setuid()
* call has disabled it.
*/
if (prctl(PR_SET_DUMPABLE,1,0,0,0) < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlywarning("prctl(PR_SET_DUMPABLE) failed: %s",
strbuf);
}
#endif
#if defined(HAVE_SYS_CAPABILITY_H) && !defined(HAVE_LINUXTHREADS)
linux_minprivs();
#endif
}
@@ -547,7 +468,7 @@ ns_os_uid(void) {
void
named_os_adjustnofile(void) {
#ifdef HAVE_LINUXTHREADS
#if defined(__linux__)
isc_result_t result;
isc_resourcevalue_t newvalue;
@@ -565,21 +486,15 @@ named_os_adjustnofile(void) {
void
named_os_minprivs(void) {
#ifdef HAVE_SYS_PRCTL_H
#if defined(HAVE_SYS_CAPABILITY_H)
linux_keepcaps();
#endif
#ifdef HAVE_LINUXTHREADS
named_os_changeuser(); /* Call setuid() before threads are started */
#endif
#if defined(HAVE_SYS_CAPABILITY_H) && defined(HAVE_LINUXTHREADS)
named_os_changeuser();
linux_minprivs();
#endif
}
static int
safe_open(const char *filename, mode_t mode, isc_boolean_t append) {
safe_open(const char *filename, mode_t mode, bool append) {
int fd;
struct stat sb;
@@ -647,7 +562,7 @@ mkdirpath(char *filename, void (*report)(const char *, ...)) {
if (stat(filename, &sb) == -1) {
if (errno != ENOENT) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
(*report)("couldn't stat '%s': %s", filename,
strbuf);
goto error;
@@ -667,7 +582,7 @@ mkdirpath(char *filename, void (*report)(const char *, ...)) {
mode |= S_IRGRP | S_IXGRP; /* g=rx */
mode |= S_IROTH | S_IXOTH; /* o=rx */
if (mkdir(filename, mode) == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
(*report)("couldn't mkdir '%s': %s", filename,
strbuf);
goto error;
@@ -675,7 +590,7 @@ mkdirpath(char *filename, void (*report)(const char *, ...)) {
if (runas_pw != NULL &&
chown(filename, runas_pw->pw_uid,
runas_pw->pw_gid) == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
(*report)("couldn't chown '%s': %s", filename,
strbuf);
}
@@ -702,7 +617,7 @@ setperms(uid_t uid, gid_t gid) {
#endif
#if defined(HAVE_SETEGID)
if (getegid() != gid && setegid(gid) == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlywarning("unable to set effective "
"gid to %ld: %s",
(long)gid, strbuf);
@@ -710,7 +625,7 @@ setperms(uid_t uid, gid_t gid) {
#elif defined(HAVE_SETRESGID)
if (getresgid(&tmpg, &oldgid, &tmpg) == -1 || oldgid != gid) {
if (setresgid(-1, gid, -1) == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlywarning("unable to set effective "
"gid to %d: %s", gid, strbuf);
}
@@ -719,7 +634,7 @@ setperms(uid_t uid, gid_t gid) {
#if defined(HAVE_SETEUID)
if (geteuid() != uid && seteuid(uid) == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlywarning("unable to set effective "
"uid to %ld: %s",
(long)uid, strbuf);
@@ -727,7 +642,7 @@ setperms(uid_t uid, gid_t gid) {
#elif defined(HAVE_SETRESUID)
if (getresuid(&tmpu, &olduid, &tmpu) == -1 || olduid != uid) {
if (setresuid(-1, uid, -1) == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlywarning("unable to set effective "
"uid to %d: %s", uid, strbuf);
}
@@ -736,7 +651,7 @@ setperms(uid_t uid, gid_t gid) {
}
FILE *
named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user) {
named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
char strbuf[ISC_STRERRORSIZE], *f;
FILE *fp;
int fd;
@@ -746,7 +661,7 @@ named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user)
*/
f = strdup(filename);
if (f == NULL) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlywarning("couldn't strdup() '%s': %s",
filename, strbuf);
return (NULL);
@@ -758,22 +673,17 @@ named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user)
free(f);
if (switch_user && runas_pw != NULL) {
#ifndef HAVE_LINUXTHREADS
gid_t oldgid = getgid();
#endif
/* Set UID/GID to the one we'll be running with eventually */
setperms(runas_pw->pw_uid, runas_pw->pw_gid);
fd = safe_open(filename, mode, ISC_FALSE);
fd = safe_open(filename, mode, false);
#ifndef HAVE_LINUXTHREADS
/* Restore UID/GID to root */
setperms(0, oldgid);
#endif /* HAVE_LINUXTHREADS */
if (fd == -1) {
#ifndef HAVE_LINUXTHREADS
fd = safe_open(filename, mode, ISC_FALSE);
fd = safe_open(filename, mode, false);
if (fd != -1) {
named_main_earlywarning("Required root "
"permissions to open "
@@ -785,20 +695,13 @@ named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user)
named_main_earlywarning("Please check file and "
"directory permissions "
"or reconfigure the filename.");
#else /* HAVE_LINUXTHREADS */
named_main_earlywarning("Could not open "
"'%s'.", filename);
named_main_earlywarning("Please check file and "
"directory permissions "
"or reconfigure the filename.");
#endif /* HAVE_LINUXTHREADS */
}
} else {
fd = safe_open(filename, mode, ISC_FALSE);
fd = safe_open(filename, mode, false);
}
if (fd < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlywarning("could not open file '%s': %s",
filename, strbuf);
return (NULL);
@@ -806,7 +709,7 @@ named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user)
fp = fdopen(fd, "w");
if (fp == NULL) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlywarning("could not fdopen() file '%s': %s",
filename, strbuf);
}
@@ -815,7 +718,7 @@ named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user)
}
void
named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
named_os_writepidfile(const char *filename, bool first_time) {
FILE *fh;
pid_t pid;
char strbuf[ISC_STRERRORSIZE];
@@ -834,7 +737,7 @@ named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
pidfile = strdup(filename);
if (pidfile == NULL) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
(*report)("couldn't strdup() '%s': %s", filename, strbuf);
return;
}
@@ -845,11 +748,7 @@ named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
cleanup_pidfile();
return;
}
#ifdef HAVE_LINUXTHREADS
pid = mainpid;
#else
pid = getpid();
#endif
if (fprintf(fh, "%ld\n", (long)pid) < 0) {
(*report)("fprintf() to pid file '%s' failed", filename);
(void)fclose(fh);
@@ -865,23 +764,23 @@ named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
(void)fclose(fh);
}
isc_boolean_t
bool
named_os_issingleton(const char *filename) {
char strbuf[ISC_STRERRORSIZE];
struct flock lock;
if (singletonfd != -1)
return (ISC_TRUE);
return (true);
if (strcasecmp(filename, "none") == 0)
return (ISC_TRUE);
return (true);
/*
* Make the containing directory if it doesn't exist.
*/
lockfile = strdup(filename);
if (lockfile == NULL) {
isc__strerror(errno, strbuf, sizeof(strbuf));
strerror_r(errno, strbuf, sizeof(strbuf));
named_main_earlyfatal("couldn't allocate memory for '%s': %s",
filename, strbuf);
} else {
@@ -890,7 +789,7 @@ named_os_issingleton(const char *filename) {
named_main_earlywarning("couldn't create '%s'",
filename);
cleanup_lockfile();
return (ISC_FALSE);
return (false);
}
}
@@ -902,7 +801,7 @@ named_os_issingleton(const char *filename) {
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
if (singletonfd == -1) {
cleanup_lockfile();
return (ISC_FALSE);
return (false);
}
memset(&lock, 0, sizeof(lock));
@@ -915,10 +814,10 @@ named_os_issingleton(const char *filename) {
if (fcntl(singletonfd, F_SETLK, &lock) == -1) {
close(singletonfd);
singletonfd = -1;
return (ISC_FALSE);
return (false);
}
return (ISC_TRUE);
return (true);
}
void
@@ -955,11 +854,7 @@ named_os_shutdownmsg(char *command, isc_buffer_t *text) {
return;
}
#ifdef HAVE_LINUXTHREADS
pid = mainpid;
#else
pid = getpid();
#endif
(void)isc_buffer_printf(text, "pid: %ld", (long)pid);
}
+42 -38
View File
@@ -14,9 +14,11 @@
#include <windows.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <dns/log.h>
#include <dns/result.h>
@@ -44,7 +46,7 @@ typedef struct dlopen_data {
unsigned int flags;
isc_mutex_t lock;
int version;
isc_boolean_t in_configure;
bool in_configure;
dlz_dlopen_version_t *dlz_version;
dlz_dlopen_create_t *dlz_create;
@@ -67,14 +69,14 @@ typedef struct dlopen_data {
#define MAYBE_LOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
cd->in_configure == ISC_FALSE) \
cd->in_configure == false) \
LOCK(&cd->lock); \
} while (0)
#define MAYBE_UNLOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
cd->in_configure == ISC_FALSE) \
cd->in_configure == false) \
UNLOCK(&cd->lock); \
} while (0)
@@ -194,7 +196,7 @@ dlopen_dlz_lookup(const char *zone, const char *name, void *driverarg,
* Load a symbol from the library
*/
static void *
dl_load_symbol(dlopen_data_t *cd, const char *symbol, isc_boolean_t mandatory) {
dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
void *ptr = GetProcAddress(cd->dl_handle, symbol);
if (ptr == NULL && mandatory) {
dlopen_log(ISC_LOG_ERROR,
@@ -214,7 +216,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
dlopen_data_t *cd;
isc_mem_t *mctx = NULL;
isc_result_t result = ISC_R_FAILURE;
isc_boolean_t triedload = ISC_FALSE;
bool triedload = false;
UNUSED(driverarg);
@@ -248,12 +250,10 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
goto failed;
}
triedload = ISC_TRUE;
triedload = true;
/* Initialize the lock */
result = isc_mutex_init(&cd->lock);
if (result != ISC_R_SUCCESS)
goto failed;
isc_mutex_init(&cd->lock);
/* Open the library */
cd->dl_handle = LoadLibraryA(cd->dl_path);
@@ -269,13 +269,13 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
/* Find the symbols */
cd->dlz_version = (dlz_dlopen_version_t *)
dl_load_symbol(cd, "dlz_version", ISC_TRUE);
dl_load_symbol(cd, "dlz_version", true);
cd->dlz_create = (dlz_dlopen_create_t *)
dl_load_symbol(cd, "dlz_create", ISC_TRUE);
dl_load_symbol(cd, "dlz_create", true);
cd->dlz_lookup = (dlz_dlopen_lookup_t *)
dl_load_symbol(cd, "dlz_lookup", ISC_TRUE);
dl_load_symbol(cd, "dlz_lookup", true);
cd->dlz_findzonedb = (dlz_dlopen_findzonedb_t *)
dl_load_symbol(cd, "dlz_findzonedb", ISC_TRUE);
dl_load_symbol(cd, "dlz_findzonedb", true);
if (cd->dlz_create == NULL ||
cd->dlz_version == NULL ||
@@ -288,27 +288,27 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
}
cd->dlz_allowzonexfr = (dlz_dlopen_allowzonexfr_t *)
dl_load_symbol(cd, "dlz_allowzonexfr", ISC_FALSE);
dl_load_symbol(cd, "dlz_allowzonexfr", false);
cd->dlz_allnodes = (dlz_dlopen_allnodes_t *)
dl_load_symbol(cd, "dlz_allnodes",
ISC_TF(cd->dlz_allowzonexfr != NULL));
(cd->dlz_allowzonexfr != NULL));
cd->dlz_authority = (dlz_dlopen_authority_t *)
dl_load_symbol(cd, "dlz_authority", ISC_FALSE);
dl_load_symbol(cd, "dlz_authority", false);
cd->dlz_newversion = (dlz_dlopen_newversion_t *)
dl_load_symbol(cd, "dlz_newversion", ISC_FALSE);
dl_load_symbol(cd, "dlz_newversion", false);
cd->dlz_closeversion = (dlz_dlopen_closeversion_t *)
dl_load_symbol(cd, "dlz_closeversion",
ISC_TF(cd->dlz_newversion != NULL));
(cd->dlz_newversion != NULL));
cd->dlz_configure = (dlz_dlopen_configure_t *)
dl_load_symbol(cd, "dlz_configure", ISC_FALSE);
dl_load_symbol(cd, "dlz_configure", false);
cd->dlz_ssumatch = (dlz_dlopen_ssumatch_t *)
dl_load_symbol(cd, "dlz_ssumatch", ISC_FALSE);
dl_load_symbol(cd, "dlz_ssumatch", false);
cd->dlz_addrdataset = (dlz_dlopen_addrdataset_t *)
dl_load_symbol(cd, "dlz_addrdataset", ISC_FALSE);
dl_load_symbol(cd, "dlz_addrdataset", false);
cd->dlz_subrdataset = (dlz_dlopen_subrdataset_t *)
dl_load_symbol(cd, "dlz_subrdataset", ISC_FALSE);
dl_load_symbol(cd, "dlz_subrdataset", false);
cd->dlz_delrdataset = (dlz_dlopen_delrdataset_t *)
dl_load_symbol(cd, "dlz_delrdataset", ISC_FALSE);
dl_load_symbol(cd, "dlz_delrdataset", false);
/* Check the version of the API is the same */
cd->version = cd->dlz_version(&cd->flags);
@@ -347,17 +347,21 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
return (ISC_R_SUCCESS);
cleanup_lock:
DESTROYLOCK(&cd->lock);
isc_mutex_destroy(&cd->lock);
failed:
dlopen_log(ISC_LOG_ERROR, "dlz_dlopen of '%s' failed", dlzname);
if (cd->dl_path)
if (cd->dl_path) {
isc_mem_free(mctx, cd->dl_path);
if (cd->dlzname)
}
if (cd->dlzname) {
isc_mem_free(mctx, cd->dlzname);
if (triedload)
(void) isc_mutex_destroy(&cd->lock);
if (cd->dl_handle)
}
if (triedload) {
isc_mutex_destroy(&cd->lock);
}
if (cd->dl_handle) {
FreeLibrary(cd->dl_handle);
}
isc_mem_put(mctx, cd, sizeof(*cd));
isc_mem_destroy(&mctx);
return (result);
@@ -388,7 +392,7 @@ dlopen_dlz_destroy(void *driverarg, void *dbdata) {
if (cd->dl_handle)
FreeLibrary(cd->dl_handle);
DESTROYLOCK(&cd->lock);
isc_mutex_destroy(&cd->lock);
mctx = cd->mctx;
isc_mem_put(mctx, cd, sizeof(*cd));
@@ -420,7 +424,7 @@ dlopen_dlz_newversion(const char *zone, void *driverarg, void *dbdata,
* Called to end a transaction
*/
static void
dlopen_dlz_closeversion(const char *zone, isc_boolean_t commit,
dlopen_dlz_closeversion(const char *zone, bool commit,
void *driverarg, void *dbdata, void **versionp)
{
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
@@ -453,9 +457,9 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
return (ISC_R_SUCCESS);
MAYBE_LOCK(cd);
cd->in_configure = ISC_TRUE;
cd->in_configure = true;
result = cd->dlz_configure(view, dlzdb, cd->dbdata);
cd->in_configure = ISC_FALSE;
cd->in_configure = false;
MAYBE_UNLOCK(cd);
return (result);
@@ -465,18 +469,18 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
/*
* Check for authority to change a name
*/
static isc_boolean_t
static bool
dlopen_dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
const char *type, const char *key, isc_uint32_t keydatalen,
const char *type, const char *key, uint32_t keydatalen,
unsigned char *keydata, void *driverarg, void *dbdata)
{
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
isc_boolean_t ret;
bool ret;
UNUSED(driverarg);
if (cd->dlz_ssumatch == NULL)
return (ISC_FALSE);
return (false);
MAYBE_LOCK(cd);
ret = cd->dlz_ssumatch(signer, name, tcpaddr, type, key, keydatalen,
+5 -3
View File
@@ -12,6 +12,8 @@
#ifndef NAMED_OS_H
#define NAMED_OS_H 1
#include <stdbool.h>
#include <isc/types.h>
void
@@ -45,12 +47,12 @@ void
named_os_minprivs(void);
FILE *
named_os_openfile(const char *filename, int mode, isc_boolean_t switch_user);
named_os_openfile(const char *filename, int mode, bool switch_user);
void
named_os_writepidfile(const char *filename, isc_boolean_t first_time);
named_os_writepidfile(const char *filename, bool first_time);
isc_boolean_t
bool
named_os_issingleton(const char *filename);
void

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