From 3b1fce680f1dbe9467cd3b0ab3138ea52d5a976f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 30 Mar 2004 02:13:45 +0000 Subject: [PATCH] 1595. [func] New notify type 'master-only'. Enable notify for master zones only. --- CHANGES | 3 ++- bin/named/zoneconf.c | 4 +++- doc/arm/Bv9ARM-book.xml | 8 +++++--- lib/dns/include/dns/types.h | 5 +++-- lib/dns/zone.c | 6 +++++- lib/isccfg/namedconf.c | 4 ++-- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 3a2037ced4..45bad73eb4 100644 --- a/CHANGES +++ b/CHANGES @@ -8,7 +8,8 @@ 1596. [func] Accept 'notify-source' style syntax for query-source. -1595. [placeholder] rt9164 +1595. [func] New notify type 'master-only'. Enable notify for + master zones only. 1594. [placeholder] rt10565 diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index 66cbad9fe7..3121dd61dc 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zoneconf.c,v 1.110 2004/03/05 04:57:49 marka Exp $ */ +/* $Id: zoneconf.c,v 1.111 2004/03/30 02:13:43 marka Exp $ */ #include @@ -472,6 +472,8 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig, char *notifystr = cfg_obj_asstring(obj); if (strcasecmp(notifystr, "explicit") == 0) notifytype = dns_notifytype_explicit; + else if (strcasecmp(notifystr, "master-only") == 0) + notifytype = dns_notifytype_masteronly; else INSIST(0); } diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml index b5af9b183d..b7f66f3a58 100644 --- a/doc/arm/Bv9ARM-book.xml +++ b/doc/arm/Bv9ARM-book.xml @@ -2,7 +2,7 @@ - + BIND 9 Administrator Reference Manual @@ -2752,7 +2752,7 @@ statement in the named.conf file: host-statistics yes_or_no; minimal-responses yes_or_no; multiple-cnames yes_or_no; - notify yes_or_no | explicit; + notify yes_or_no | explicit | master-only; recursion yes_or_no; rfc2308-type1 yes_or_no; use-id-pool yes_or_no; @@ -3165,6 +3165,8 @@ servers listed in the zone's NS records (except the master server identified in the SOA MNAME field), and to any servers listed in the also-notify option. +If master-only, notifies are only sent +for master zones. If explicit, notifies are sent only to servers explicitly listed using also-notify. If no, no notifies are sent. @@ -4543,7 +4545,7 @@ Statement Grammar max-transfer-idle-out number ; max-transfer-time-in number ; max-transfer-time-out number ; - notify yes_or_no | explicit ; + notify yes_or_no | explicit | master-only ; pubkey number number number string ; transfer-source (ip4_addr | *) port ip_port ; transfer-source-v6 (ip6_addr | *) port ip_port ; diff --git a/lib/dns/include/dns/types.h b/lib/dns/include/dns/types.h index 1da751ae12..42e8314252 100644 --- a/lib/dns/include/dns/types.h +++ b/lib/dns/include/dns/types.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: types.h,v 1.109 2004/03/05 05:09:47 marka Exp $ */ +/* $Id: types.h,v 1.110 2004/03/30 02:13:44 marka Exp $ */ #ifndef DNS_TYPES_H #define DNS_TYPES_H 1 @@ -136,7 +136,8 @@ typedef enum { typedef enum { dns_notifytype_no = 0, dns_notifytype_yes = 1, - dns_notifytype_explicit = 2 + dns_notifytype_explicit = 2, + dns_notifytype_masteronly = 3 } dns_notifytype_t; typedef enum { diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 9f73101035..cb914f125b 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.410 2004/03/18 02:58:03 marka Exp $ */ +/* $Id: zone.c,v 1.411 2004/03/30 02:13:44 marka Exp $ */ #include @@ -2917,6 +2917,10 @@ zone_notify(dns_zone_t *zone) { if (notifytype == dns_notifytype_no) return; + if (notifytype == dns_notifytype_masteronly && + zone->type != dns_zone_master) + return; + origin = &zone->origin; /* diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index 6c0f7de639..3c7bdd88e4 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: namedconf.c,v 1.31 2004/03/30 02:05:40 marka Exp $ */ +/* $Id: namedconf.c,v 1.32 2004/03/30 02:13:45 marka Exp $ */ #include @@ -1126,7 +1126,7 @@ static cfg_type_t cfg_type_dialuptype = { &cfg_rep_string, dialup_enums }; -static const char *notify_enums[] = { "explicit", NULL }; +static const char *notify_enums[] = { "explicit", "master-only", NULL }; static isc_result_t parse_notify_type(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { return (parse_enum_or_other(pctx, type, &cfg_type_boolean, ret));