]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix MX checks for dynamic updates
authorMichał Kępień <michal@isc.org>
Mon, 26 Feb 2018 11:30:48 +0000 (12:30 +0100)
committerEvan Hunt <each@isc.org>
Mon, 26 Feb 2018 23:20:06 +0000 (15:20 -0800)
commitd86a7dbe699c4f584d375c5bc88358835ced2552
treec449bec8cf5f59f28e71760b176df2bc224c15e5
parent8668c2eeab7f244a75c8329c4da9a7fe244f5f6c
Fix MX checks for dynamic updates

The check_mx() function in lib/ns/update.c incorrectly tests whether the
DNS_RDATA_CHECKMX/DNS_RDATA_CHECKMXFAIL flags are set for each applied
MX record update as these flags are never set in code paths related to
dynamic updates; they can only be set when loading a zone from a master
file (DNS_ZONEOPT_CHECKMX -> DNS_MASTER_CHECKMX -> DNS_RDATA_CHECKMX).
This flaw allows MX records containing IP addresses to be added to a
zone even when "check-mx fail;" is used.

Ensure correct behavior by modifying the relevant tests in check_mx() so
that they use DNS_ZONEOPT_CHECKMX/DNS_ZONEOPT_CHECKMXFAIL instead.

(cherry picked from commit 857a40c87bb80669ecc5cf1c51301d967e7aba53)
bin/named/update.c
bin/tests/system/nsupdate/ns1/named.conf.in
bin/tests/system/nsupdate/tests.sh