Commit graph

8495 commits

Author SHA1 Message Date
Evan Hunt
dd54a08163 also add -D options for transient named processes started in tests.sh
(cherry picked from commit dd45831acc)
2019-01-28 21:22:13 -08:00
Evan Hunt
e5acb97c8a add properly-formatted -D options to named.args files
this prevents servers that use arguments specified in named.args
from appearing different in 'ps' output from servers run with arguments
from start.pl

(cherry picked from commit 175d6e9bfb)
2019-01-28 21:21:33 -08:00
Evan Hunt
0cc8758724 reset SYSTEMTESTTOP when changing directories
(cherry picked from commit 70f36a25e4)
2019-01-28 20:42:13 -08:00
Evan Hunt
7dad677ef8 fix runtime test
named doesn't understand cygwin paths, so we need to use
`cygpath -aw .` instead of `pwd` to get the absolute path to the
working directory.
2019-01-26 00:54:22 -08:00
Evan Hunt
f0ebe6cbe4 fix rrl test
strip CR characters before using awk/sed
2019-01-25 16:15:35 -08:00
Evan Hunt
77bc4e27f1 fix rpz test
- work around a CR newline problem
- use rndc to stop servers
2019-01-25 16:15:35 -08:00
Evan Hunt
aa1cf3c606 fix rpzrecurse test
- backport from v9_12 changes to enable rpzrecurse test to
  suspend and resume servers on win32
- use rndc to stop servers
2019-01-25 16:15:08 -08:00
Evan Hunt
be8dfc7421 fix dnssec test
- work around CR issues
- use UTC for time comparisons
- use $DIFF instead of cmp
2019-01-25 15:38:50 -08:00
Evan Hunt
4e597364a6 fix legacy test
use rndc rather than signals to stop the server
2019-01-25 15:38:49 -08:00
Evan Hunt
f1906e8ea3 fix fetchlimit test
use TCP for the test queries in between UDP bursts; this avoids
congestion issues that interfered with the test on windows
2019-01-25 15:38:49 -08:00
Evan Hunt
f7a77ff295 fix sfcache test
use a lame server configuration to force SERVFAILs instead of killing ns2.
this prevents test failures that occurred due to a different behavior of
the netowrking stack in windows.
2019-01-25 15:38:49 -08:00
Evan Hunt
d48fa83230 fix nsupdate test
rndc_reload was failing on windows
2019-01-25 15:38:49 -08:00
Evan Hunt
dc5c53b23a fix rndc test
use regex instead of exact string matching to deal with CR at end of line
2019-01-25 15:38:49 -08:00
Evan Hunt
4c5c91f36d fix statistics test
the active sockets test is supposed to be commented out on win32, but
only part of it was
2019-01-25 15:38:49 -08:00
Evan Hunt
73f9d372f6 fix redirect test
strip CR characters before using sed
2019-01-25 15:38:49 -08:00
Evan Hunt
0828d9c6db fix notify test
test the average delay between notifies instead of the minimum delay;
this helps avoid unnecessary test failures on systems with bursty
network performance.
2019-01-25 15:38:49 -08:00
Evan Hunt
57272bfb60 fix masterformat test
use stop.pl instead of rndc to stop server
2019-01-25 15:38:49 -08:00
Evan Hunt
09b61926d8 fix inline test
use regex instead of exact string matching, to deal with CR at end of ine
2019-01-25 15:38:48 -08:00
Evan Hunt
7a8058b988 fix forward test
strip CR characters before using sed
2019-01-25 15:38:48 -08:00
Evan Hunt
409a62c54c fix cookie test
strip CR characters before comparing files
2019-01-25 15:38:48 -08:00
Evan Hunt
e947cdfd27 use $DIFF instead of diff 2019-01-25 15:38:48 -08:00
Evan Hunt
cad88c5906 set and use SYSTEMTESTTOP consistently 2019-01-25 15:38:48 -08:00
Evan Hunt
79fa438d45 more reliable method for killing "ans" servers on windows
as perl and python are both native to cygwin, we don't want to use
the "kill -f" option to terminate them.
2019-01-25 15:38:48 -08:00
Evan Hunt
27e4da57f8 update ifconfig.bat with current test interfaces
the addresses set up in ifconfig.bat were out of sync with the
ones in ifconfig.sh
2019-01-25 15:38:48 -08:00
Evan Hunt
f0d8bf4d44 update conf.sh.win32 test list
- the test lists in conf.sh.in and conf.sh.win32 were out of sync
2019-01-25 15:38:48 -08:00
Evan Hunt
36221e6447 improve handling of trailing dots in dnssec-keymgr and dnssec-coverage
- mishandling of trailing dots caused bad behavior with the
  root zone or names like "example.com."
- fixing this exposed an error in dnssec-coverage caused the
  wrong return value if there were KSK errors but no ZSK errors
- incidentally silenced the dnssec-keygen output in the coverage
  system test

(cherry picked from commit 1ccf4e6c16)
2019-01-24 13:58:05 -08:00
Petr Menšík
eb06423b7e Try to fix crash at +sigchase +topdown
When multilabel name is already cached, child_of_zone fails check when
zone_name is direct child of name. Error is ignored and crashes on
expectation child_name was initialized. Handle the error and relax the
check.

Reproducer:
dig isc.org
dig +sigchase +topdown isc.org
2019-01-24 13:09:21 +01:00
Mark Andrews
67b001b190 introducing keymgr need to preserve functionality
(cherry picked from commit 083b730ec7)
(cherry picked from commit 15b4240764)
2019-01-22 11:17:28 -08:00
Witold Kręcicki
aa9866c390 If possible don't use forwarders when priming the resolver.
If we try to fetch a record from cache and need to look into
hints database we assume that the resolver is not primed and
start dns_resolver_prime(). Priming query is supposed to return
NSes for "." in ANSWER section and glue records for them in
ADDITIONAL section, so that we can fill that info in 'regular'
cache and not use hints db anymore.
However, if we're using a forwarder the priming query goes through
it, and if it's configured to return minimal answers we won't get
the addresses of root servers in ADDITIONAL section. Since the
only records for root servers we have are in hints database we'll
try to prime the resolver with every single query.

This patch adds a DNS_FETCHOPT_NOFORWARD flag which avoids using
forwarders if possible (that is if we have forward-first policy).
Using this flag on priming fetch fixes the problem as we get the
proper glue. With forward-only policy the problem is non-existent,
as we'll never ask for root server addresses because we'll never
have a need to query them.

Also added a test to confirm priming queries are not forwarded.

(cherry picked from commit b49310ac06)
(cherry picked from commit f8963ad70e)
2019-01-16 22:27:52 -08:00
Petr Menšík
2e8a927912 Normalize windows files and shell scripts
Commands used:
git add --chmod=+x bin/tests/system/ifconfig.sh mkinstalldirs
git add --renormalize 'win32utils/**.txt' '**.dsw'
2019-01-16 19:04:50 -05:00
Mark Andrews
06eb0a4367 add multi-view server and tests
(cherry picked from commit 7122b5786d)
(cherry picked from commit 22b77f45b7)
2019-01-14 18:31:02 -08:00
Tony Finch
f72c687fa2 Fix a few cosmetic issues with rndc managed-keys
The handling of class and view arguments was broken, because the code
didn't realise that next_token() would overwrite the class name when
it parsed the view name. The code was trying to implement a syntax
like `refresh [[class] view]`, but it was documented to have a syntax
like `refresh [class [view]]`. The latter is consistent with other rndc
commands, so that is how I have fixed it.

Before:

$ rndc managed-keys refresh in rec
rndc: 'managed-keys' failed: unknown class/type
unknown class 'rec'

After:

$ rndc managed-keys refresh in rec
refreshing managed keys for 'rec'

There were missing newlines in the output from `rndc managed-keys
refresh` and `rndc managed-keys destroy`.

Before:

$ rndc managed-keys refresh
refreshing managed keys for 'rec'refreshing managed keys for 'auth'

After:

$ rndc managed-keys refresh
refreshing managed keys for 'rec'
refreshing managed keys for 'auth'

(cherry picked from commit 6a3b851f72)
(cherry picked from commit bc984ace12)
2019-01-14 18:19:22 -08:00
Evan Hunt
3b367ef3cb b/t/s/dnssec/tests.sh: Cleanup showprivate() function
(cherry picked from commit b241dc58ec)
2019-01-14 13:23:36 -08:00
Evan Hunt
d653989a1e fix testing errors
- the checkprivate function in the dnssec test set ret=0, erasing
  results from previous tests and making the test appear to have passed
  when it shouldn't have
- checkprivate needed a delay loop to ensure there was time for all
  private signing records to be updated before the test

(cherry picked from commit 82e83d5dc7)
2019-01-13 21:34:35 -05:00
Tony Finch
81408256d3 cleanup: alphabetize rndc command dispatch 2019-01-14 13:02:02 +11:00
Mark Andrews
58cc1ee718 Ensure base64/base32/hex fields in DNS records that should be non-empty are.
(cherry picked from commit 5e8b772ad1)
2019-01-09 18:52:50 +11:00
Mark Andrews
e4f7d6c418 explictly convert ISC_R_NOSPACE from dns_message_parse to DNS_R_FORMERR and remove from dns_result_torcode
(cherry picked from commit 0c42a9c0ab)
2019-01-08 20:51:27 -08:00
Mark Andrews
24f7bc252d wait longer for dump to complete
(cherry picked from commit 8a8d378def)
2019-01-08 20:18:26 -08:00
Michał Kępień
b9f577eb6a Fix cleanup upon an error before TCP socket creation
When a query times out after a socket is created and associated with a
given dig_query_t structure, calling isc_socket_cancel() causes
connect_done() to be run, which in turn takes care of all necessary
cleanups.  However, certain errors (e.g. get_address() returning
ISC_R_FAMILYNOSUPPORT) may prevent a TCP socket from being created in
the first place.  Since force_timeout() may be used in code handling
such errors, connect_timeout() needs to properly clean up a TCP query
which is not associated with any socket.  Call clear_query() from
connect_timeout() after attempting to send a TCP query to the next
available server if the timed out query does not have a socket
associated with it, in order to prevent dig from hanging indefinitely
due to the dig_query_t structure not being detached from its parent
dig_lookup_t structure.

(cherry picked from commit 13975b32c6)
2019-01-08 11:24:03 +01:00
Michał Kępień
11a4845c7d Refactor code sending a query to the next server upon a timeout
When a query times out and another server is available for querying
within the same lookup, the timeout handler - connect_timeout() - is
responsible for sending the query to the next server.  Extract the
relevant part of connect_timeout() to a separate function in order to
improve code readability.

(cherry picked from commit c108fc5c6e)
2019-01-08 11:24:03 +01:00
Michał Kępień
d8de90f859 Remove dead code handling address family mismatches for TCP sockets
Before commit c2ec022f57, using the "-b"
command line switch for dig did not disable use of the other address
family than the one to which the address supplied to that option
belonged to.  Thus, bind9_getaddresses() could e.g. prepare an
isc_sockaddr_t structure for an IPv6 address when an IPv4 address has
been passed to the "-b" command line option.  To avoid attempting the
impossible (e.g. querying an IPv6 address from a socket bound to an IPv4
address), a certain code block in send_tcp_connect() checked whether the
address family of the server to be queried was the same as the address
family of the socket set up for sending that query; if there was a
mismatch, that particular server address was skipped.

Commit c2ec022f57 made
bind9_getaddresses() fail upon an address family mismatch between the
address the hostname passed to it resolved to and the address supplied
to the "-b" command line option.  Such failures were fatal to dig back
then.

Commit 7f65860391 made
bind9_getaddresses() failures non-fatal, but also ensured that a
get_address() failure in send_tcp_connect() still causes the given query
address to be skipped (and also made such failures trigger an early
return from send_tcp_connect()).

Summing up, the code block handling address family mismatches in
send_tcp_connect() has been redundant since commit
c2ec022f57.  Remove it.

(cherry picked from commit ef1da8731b)
2019-01-08 11:24:03 +01:00
Michał Kępień
3db9f56718 Track forwarder timeouts in fetch contexts
Since following a delegation resets most fetch context state, address
marks (FCTX_ADDRINFO_MARK) set inside lib/dns/resolver.c are not
preserved when a delegation is followed.  This is fine for full
recursive resolution but when named is configured with "forward first;"
and one of the specified forwarders times out, triggering a fallback to
full recursive resolution, that forwarder should no longer be consulted
at each delegation point subsequently reached within a given fetch
context.

Add a new badnstype_t enum value, badns_forwarder, and use it to mark a
forwarder as bad when it times out in a "forward first;" configuration.
Since the bad server list is not cleaned when a fetch context follows a
delegation, this prevents a forwarder from being queried again after
falling back to full recursive resolution.  Yet, as each fetch context
maintains its own list of bad servers, this change does not cause a
forwarder timeout to prevent that forwarder from being used by other
fetch contexts.

(cherry picked from commit 33350626f9)
2019-01-08 08:34:37 +01:00
Mark Andrews
cc9ece19e3 indenting
(cherry picked from commit c69ad95238)
2019-01-02 11:51:52 +11:00
Mark Andrews
84527eb4d5 update copyrights 2019-01-02 10:26:49 +11:00
Ondřej Surý
c116fb963a Fix ECC algorithms unused constants in PKCS#11 build 2018-12-21 09:29:47 +01:00
Matthijs Mekking
bb2c242c39 Remove dig_with_opts 2018-12-20 15:23:07 +01:00
Matthijs Mekking
0e9a8da68c Replace DSA with Reserved algorithm
(cherry picked from commit 17cdde1e56)
2018-12-20 04:50:08 -05:00
Matthijs Mekking
9f81119c02 Add dnssec-signzone tests with unsupported alg
dnssec-signzone should sign a zonefile that contains a DNSKEY record
with an unsupported algorithm.

(cherry picked from commit 6d976b37c1)
(cherry picked from commit 8619318a1e6207e487438a93bd7a620967091347)
2018-12-20 04:50:08 -05:00
Ondřej Surý
c1c10ca2b9 Properly detect msys/msys2 environment in the stop.pl script.
(cherry picked from commit 808dac0760)
2018-12-19 21:31:41 +01:00
Ondřej Surý
11cce88a41 gcc defines __SANITIZE_ADDRESS__ and not __ADDRESS_SANITIZER__, use the correct #define
(cherry picked from commit 8903d68d69)
2018-12-19 12:46:05 +01:00