obj = NULL;
(void)cfg_map_get(zoptions, "mirror", &obj);
if (obj != NULL) {
+ isc_boolean_t mirror = cfg_obj_asboolean(obj);
dns_zone_setoption(mayberaw, DNS_ZONEOPT_MIRROR,
- cfg_obj_asboolean(obj));
+ mirror);
+ if (mirror) {
+ /*
+ * Disable outgoing zone transfers unless they
+ * are explicitly enabled by zone
+ * configuration.
+ */
+ obj = NULL;
+ (void)cfg_map_get(zoptions, "allow-transfer",
+ &obj);
+ if (obj == NULL) {
+ dns_acl_t *none;
+ RETERR(dns_acl_none(mctx, &none));
+ dns_zone_setxfracl(zone, none);
+ dns_acl_detach(&none);
+ }
+ }
}
obj = NULL;
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
+n=`expr $n + 1`
+echo_i "checking that outgoing transfers of mirror zones are disabled by default ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.3 . AXFR > dig.out.ns3.test$n 2>&1 || ret=1
+grep "; Transfer failed" dig.out.ns3.test$n > /dev/null || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1