Commit graph

27156 commits

Author SHA1 Message Date
Michał Kępień
36e2175bd3 Merge branch '692-dig-fix-cleanup-upon-an-error-before-tcp-socket-creation-v9_11' into 'v9_11'
[v9_11] Fix cleanup upon an error before TCP socket creation

See merge request isc-projects/bind9!1308
2019-01-08 05:57:12 -05:00
Michał Kępień
9b96944bae Add CHANGES entry
5123.	[bug]		dig could hang indefinitely after encountering an error
			before creating a TCP socket. [GL #692]

(cherry picked from commit 3242cb53ec)
2019-01-08 11:24:04 +01: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ń
5c9106da2c Merge branch '315-track-forwarder-timeouts-in-fetch-contexts-v9_11' into 'v9_11'
[v9_11] Track forwarder timeouts in fetch contexts

See merge request isc-projects/bind9!1306
2019-01-08 05:00:06 -05:00
Michał Kępień
3ddb8337b3 Add CHANGES entry
5122.	[bug]		In a "forward first;" configuration, a forwarder
			timeout did not prevent that forwarder from being
			queried again after falling back to full recursive
			resolution. [GL #315]

(cherry picked from commit 1df9ca9e6a)
2019-01-08 08:34:37 +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
8a929b14f1 Merge branch 'marka-fix-stub_dlz_allowzonexfr-v9_11' into 'v9_11'
return ISC_R_NOTFOUND when name does not match the zone name

See merge request isc-projects/bind9!1302
2019-01-06 23:43:02 -05:00
Mark Andrews
c9a7169068 add CHANGES
(cherry picked from commit bb57c7f775)
2019-01-07 15:24:23 +11:00
Mark Andrews
7d2f6603cf return ISC_R_NOTFOUND when name does not match the zone name
(cherry picked from commit 402190df18)
2019-01-07 15:23:58 +11:00
Mark Andrews
14f22d9040 Merge branch 'indenting-v9_11' into 'v9_11'
indenting

See merge request isc-projects/bind9!1291
2019-01-01 20:11:51 -05:00
Mark Andrews
cc9ece19e3 indenting
(cherry picked from commit c69ad95238)
2019-01-02 11:51:52 +11:00
Mark Andrews
b63c545f59 Merge branch 'copyrights-v9_11' into 'v9_11'
update copyrights

See merge request isc-projects/bind9!1289
2019-01-01 18:45:03 -05:00
Mark Andrews
84527eb4d5 update copyrights 2019-01-02 10:26:49 +11:00
Ondřej Surý
94740dc46a Merge branch 'ondrej/sync-gitlab-ci-with-master' into 'v9_11'
[v9_11] Sync GitLab CI jobs with master

See merge request isc-projects/bind9!1222
2018-12-21 04:11:14 -05:00
Ondřej Surý
c8c74d8b3e For system tests, retry twice before failing 2018-12-21 09:29:47 +01:00
Ondřej Surý
4892b52156 Fix the stdatomic #ifdefs to work with older compilers 2018-12-21 09:29:47 +01:00
Ondřej Surý
074cc75aa7 Add better EMPTY_TRANSLATION_UNIT to isc/util.h 2018-12-21 09:29:47 +01:00
Ondřej Surý
c116fb963a Fix ECC algorithms unused constants in PKCS#11 build 2018-12-21 09:29:47 +01:00
Ondřej Surý
e402955133 Add Ubuntu Xenial and Bionic to GitLab CI jobs 2018-12-21 09:29:47 +01:00
Ondřej Surý
2c7c3b79bd SoftHSM 2.4.0 only supports softhsm2.conf now, rewrite GitLab CI commands to properly support that 2018-12-21 09:29:47 +01:00
Ondřej Surý
51286ec006 Add unreachable.spatch coccinelle recipe and run it in precheck CI phase 2018-12-21 09:29:47 +01:00
Ondřej Surý
f6ff0216c8 Sync GitLab CI jobs with master branch 2018-12-21 09:29:47 +01:00
Ondřej Surý
158e3187a3 Merge branch '674-abort-when-memory-allocation-fails-v9_11-strerror-fix' into 'v9_11'
Resolve "Abort when memory allocation or other mandatory resource allocation fails"

See merge request isc-projects/bind9!1278
2018-12-21 03:29:06 -05:00
Ondřej Surý
0c6c59a289 Use isc__strerror instead of strerror_r in v9_11 branch 2018-12-21 09:26:50 +01:00
Ondřej Surý
b865b66094 Merge branch '674-abort-when-memory-allocation-fails-v9_11' into 'v9_11'
(v9_11) Resolve "abort when memory allocation fails"

See merge request isc-projects/bind9!1274
2018-12-21 03:13:37 -05:00
Ondřej Surý
8d532c111b Add CHANGES entry for GL #674
(cherry picked from commit 37ff7f635b)
2018-12-21 03:03:24 -05:00
Ondřej Surý
7d9e19b5eb Abort on allocation failure only if the memory functions are used internally in BIND 9
(cherry picked from commit c22241ae9009391c1d28085c5cf0009a6caef09c)
2018-12-21 03:03:24 -05:00
Ondřej Surý
c73912278b Abort on memory allocation failure
(cherry picked from commit 8de2451756)
2018-12-21 03:03:24 -05:00
Matthijs Mekking
a1322f019e Merge branch '783-dnssec-signzone-unsupported-algorithms-v9_11' into 'v9_11'
(v9_11) Resolve "Allow unsupported algorithms in zone when not used for signing"

See merge request isc-projects/bind9!1271
2018-12-20 10:32:59 -05: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
1360a1fa1a Move REQUIRE outside comment unsupported alg
(cherry picked from commit 5ca649967e)
2018-12-20 04:50:08 -05:00
Matthijs Mekking
040e132f16 Allow unsupported alg in zone /w dnssec-signzone
dnssec-signzone should sign a zonefile that contains a DNSKEY record
with an unsupported algorithm.  Current behavior is that it will
fail, hitting a fatal error.  The fix detects unsupported algorithms
and will not try to add it to the keylist.

Also when determining the maximum iterations for NSEC3, don't take
into account DNSKEY records in the zonefile with an unsupported
algorithm.

(cherry picked from commit 1dd11fc754)
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ý
575cbf3ea1 Merge branch '768-add-description-to-ldap-schema-v9_11' into 'v9_11'
(v9_11) Add optional description field to LDAP schema

See merge request isc-projects/bind9!1269
2018-12-20 04:47:01 -05:00
Roland Gruber
4a97a37eae Add optional description field to LDAP schema
(cherry picked from commit 83903f6f5e)
2018-12-20 10:33:34 +01:00
Ondřej Surý
0905a87ed7 Merge branch '787-set-the-clang-define-to-1-v9_11' into 'v9_11'
(v9_11) __SANITIZE_ADDRESS__ needs to be defined to 1

See merge request isc-projects/bind9!1266
2018-12-19 18:16:51 -05:00
Ondřej Surý
d0dadf5ac4 __SANITIZE_ADDRESS__ needs to be defined to 1
(cherry picked from commit ff7c868f25)
2018-12-20 00:15:59 +01:00
Ondřej Surý
498ea71f99 Merge branch '782-add-support-for-msys2-in-stop.pl-script-v9_11' into 'v9_11'
(v9_11) Properly detect msys/msys2 environment in the stop.pl script.

See merge request isc-projects/bind9!1261
2018-12-19 16:14:18 -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ý
debf6c2853 Merge branch '787-use-correct-define-v9_11' into 'v9_11'
gcc defines __SANITIZE_ADDRESS__ and not __ADDRESS_SANITIZER__, use the correct #define

See merge request isc-projects/bind9!1257
2018-12-19 06:47:44 -05: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
Ondřej Surý
0768775dc1 Merge branch '787-disable-rtld_deepbind-when-compiled-under-asan-v9_11' into 'v9_11'
(v9_11) Resolve "RTLD_DEEPBIND and AddressSanitizer aren't compatible"

See merge request isc-projects/bind9!1254
2018-12-19 05:38:46 -05:00
Ondřej Surý
8fbd61343a Disable RTLD_DEEPBIND when compiled under AddressSanitizer
(cherry picked from commit cad6b39cab)
2018-12-19 10:51:09 +01:00
Ondřej Surý
9827b8ade9 Define __ADDRESS_SANITIZER__ if compiling under clang's AddressSanitizer
(cherry picked from commit e1ce3a3d42)
2018-12-19 10:50:54 +01:00
Ondřej Surý
68c573013e Merge branch '782-revert-cygwin-grep-CRLF-issue-v9_12-v9_11' into 'v9_11'
Revert "Merge branch '782-cygwin-grep-CRLF-issue-v9_12-v9_11' into 'v9_11'"

See merge request isc-projects/bind9!1243
2018-12-17 06:57:14 -05:00
Ondřej Surý
b9e16f3475 Revert "Merge branch '782-cygwin-grep-CRLF-issue-v9_12-v9_11' into 'v9_11'"
This reverts commit b644eb672b, reversing
changes made to 3b302c58e2.
2018-12-17 12:44:24 +01:00
Evan Hunt
b644eb672b Merge branch '782-cygwin-grep-CRLF-issue-v9_12-v9_11' into 'v9_11'
Resolve "current version of cygwin grep causes tests to fail when grepping for end of line character"

See merge request isc-projects/bind9!1240
2018-12-15 00:24:05 -05:00