+3713. [bug] Save memory by not storing "also-notify" addresses
+ in zone objects that are configured not to send
+ notify requests. [RT #35195]
+
3712. [placeholder]
3711. [placeholder]
obj = NULL;
result = ns_config_get(maps, "also-notify", &obj);
- if (result == ISC_R_SUCCESS) {
+ if (result == ISC_R_SUCCESS &&
+ (notifytype == dns_notifytype_yes ||
+ notifytype == dns_notifytype_explicit ||
+ (notifytype == dns_notifytype_masteronly &&
+ ztype == dns_zone_master)))
+ {
isc_uint32_t addrcount;
addrs = NULL;
keynames = NULL;
--- /dev/null
+/*
+ * Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+view one {
+ notify master-only;
+
+ # also-notify inconsistent with master-only notify option
+ zone "slave" {
+ type slave;
+ masters { 1.2.3.4; };
+ also-notify { 5.6.7.8; };
+ };
+
+ # OK
+ zone "master" {
+ type master;
+ file "filename";
+ also-notify { 5.6.7.8; };
+ };
+};
+
+view two {
+ notify no;
+
+ # also-notify inconsistent with notify option at the view level
+ zone "slave" {
+ type slave;
+ masters { 1.2.3.4; };
+ also-notify { 5.6.7.8; };
+ };
+
+ # OK
+ zone "master" {
+ type master;
+ file "filename";
+ notify yes;
+ also-notify { 5.6.7.8; };
+ };
+};
+
+view three {
+ # also-notify inconsistent with notify option at the zone level
+ zone "slave" {
+ type slave;
+ masters { 1.2.3.4; };
+ notify no;
+ also-notify { 5.6.7.8; };
+ };
+
+ # OK
+ zone "master" {
+ type master;
+ file "filename";
+ also-notify { 5.6.7.8; };
+ };
+};
+
+view four {
+ also-notify { 5.6.7.8; };
+
+ # OK
+ zone "slave" {
+ type slave;
+ masters { 1.2.3.4; };
+ notify master-only;
+ };
+
+ # OK
+ zone "master" {
+ type master;
+ file "filename";
+ notify no;
+ };
+};
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+echo "I: checking that named-checkconf warns of notify inconsistencies"
+ret=0
+warnings=`$CHECKCONF notify.conf 2>&1 | grep "'notify' is disabled" | wc -l`
+[ $warnings -eq 3 ] || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
echo "I: checking named-checkconf dnssec warnings"
ret=0
$CHECKCONF dnssec.1 2>&1 | grep 'validation yes.*enable no' > /dev/null || ret=1
}
/*
- * Master & slave zones must have a "also-notify" field.
+ * Master & slave zones may have an "also-notify" field, but
+ * shouldn't if notify is disabled.
*/
if (ztype == MASTERZONE || ztype == SLAVEZONE ) {
+ isc_boolean_t donotify = ISC_TRUE;
+
obj = NULL;
- tresult = cfg_map_get(zoptions, "also-notify", &obj);
+ tresult = cfg_map_get(zoptions, "notify", &obj);
+ if (tresult != ISC_R_SUCCESS && voptions != NULL)
+ tresult = cfg_map_get(voptions, "notify", &obj);
+ if (tresult != ISC_R_SUCCESS && goptions != NULL)
+ tresult = cfg_map_get(goptions, "notify", &obj);
if (tresult == ISC_R_SUCCESS) {
+ if (cfg_obj_isboolean(obj))
+ donotify = cfg_obj_asboolean(obj);
+ else {
+ const char *notifystr = cfg_obj_asstring(obj);
+ if (ztype != MASTERZONE &&
+ strcasecmp(notifystr, "master-only") == 0)
+ donotify = ISC_FALSE;
+ }
+ }
+
+ obj = NULL;
+ tresult = cfg_map_get(zoptions, "also-notify", &obj);
+ if (tresult == ISC_R_SUCCESS && !donotify) {
+ cfg_obj_log(zoptions, logctx, ISC_LOG_WARNING,
+ "zone '%s': 'also-notify' set but "
+ "'notify' is disabled", znamestr);
+ } else if (tresult == ISC_R_SUCCESS) {
isc_uint32_t count;
tresult = validate_masters(obj, config, &count,
logctx, mctx);