From: Evan Hunt Date: Wed, 17 Jun 2020 09:45:07 +0000 (-0700) Subject: add "primary-only" as a synonym for "master-only" X-Git-Tag: v9.17.3~19^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=424a3cf3ccb0c3b4aaf2f8e9af57432acadf2112;p=thirdparty%2Fbind9.git add "primary-only" as a synonym for "master-only" update the "notify" option to use RFC 8499 terminology as well. --- diff --git a/bin/named/named.conf.rst b/bin/named/named.conf.rst index dcbc5278251..0716c1b748d 100644 --- a/bin/named/named.conf.rst +++ b/bin/named/named.conf.rst @@ -312,7 +312,7 @@ OPTIONS new-zones-directory quoted_string; no-case-compress { address_match_element; ... }; nocookie-udp-size integer; - notify ( explicit | master-only | boolean ); + notify ( explicit | master-only | primary-only | boolean ); notify-delay integer; notify-rate integer; notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [ @@ -675,7 +675,7 @@ VIEW new-zones-directory quoted_string; no-case-compress { address_match_element; ... }; nocookie-udp-size integer; - notify ( explicit | master-only | boolean ); + notify ( explicit | master-only | primary-only | boolean ); notify-delay integer; notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [ dscp integer ]; @@ -872,7 +872,7 @@ VIEW min-refresh-time integer; min-retry-time integer; multi-master boolean; - notify ( explicit | master-only | boolean ); + notify ( explicit | master-only | primary-only | boolean ); notify-delay integer; notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [ dscp integer ]; @@ -979,7 +979,7 @@ ZONE min-refresh-time integer; min-retry-time integer; multi-master boolean; - notify ( explicit | master-only | boolean ); + notify ( explicit | master-only | primary-only | boolean ); notify-delay integer; notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [ dscp integer ]; diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index 2f7de9e89e3..4bd79ed6cc9 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -1271,10 +1271,12 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig, notifytype = dns_notifytype_no; } } else { - const char *notifystr = cfg_obj_asstring(obj); - if (strcasecmp(notifystr, "explicit") == 0) { + const char *str = cfg_obj_asstring(obj); + if (strcasecmp(str, "explicit") == 0) { notifytype = dns_notifytype_explicit; - } else if (strcasecmp(notifystr, "master-only") == 0) { + } else if (strcasecmp(str, "master-only") == 0 || + strcasecmp(str, "primary-only") == 0) + { notifytype = dns_notifytype_masteronly; } else { INSIST(0); diff --git a/bin/tests/system/checkconf/good.conf b/bin/tests/system/checkconf/good.conf index 69168df84d4..f083dae2d0e 100644 --- a/bin/tests/system/checkconf/good.conf +++ b/bin/tests/system/checkconf/good.conf @@ -168,6 +168,7 @@ view "third" { masters { 1.2.3.4; }; + notify primary-only; }; }; view "fourth" { diff --git a/doc/misc/master.zoneopt b/doc/misc/master.zoneopt index 70f069f15c4..f9903b34e81 100644 --- a/doc/misc/master.zoneopt +++ b/doc/misc/master.zoneopt @@ -41,7 +41,7 @@ zone [ ] { max-transfer-idle-out ; max-transfer-time-out ; max-zone-ttl ( unlimited | ); - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; notify-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; diff --git a/doc/misc/master.zoneopt.rst b/doc/misc/master.zoneopt.rst index df3a1ce9109..7d97ce8ead9 100644 --- a/doc/misc/master.zoneopt.rst +++ b/doc/misc/master.zoneopt.rst @@ -43,7 +43,7 @@ max-transfer-idle-out ; max-transfer-time-out ; max-zone-ttl ( unlimited | ); - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; notify-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; diff --git a/doc/misc/mirror.zoneopt b/doc/misc/mirror.zoneopt index ada8ae7438f..c142586fe21 100644 --- a/doc/misc/mirror.zoneopt +++ b/doc/misc/mirror.zoneopt @@ -28,7 +28,7 @@ zone [ ] { min-refresh-time ; min-retry-time ; multi-master ; - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; notify-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; diff --git a/doc/misc/mirror.zoneopt.rst b/doc/misc/mirror.zoneopt.rst index 9e229e006bf..84792737dcc 100644 --- a/doc/misc/mirror.zoneopt.rst +++ b/doc/misc/mirror.zoneopt.rst @@ -30,7 +30,7 @@ min-refresh-time ; min-retry-time ; multi-master ; - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; notify-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; diff --git a/doc/misc/options b/doc/misc/options index bf30d1f10c8..b6e5cc466fa 100644 --- a/doc/misc/options +++ b/doc/misc/options @@ -272,7 +272,7 @@ options { no-case-compress { ; ... }; nocookie-udp-size ; nosit-udp-size ; // obsolete - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-rate ; notify-source ( | * ) [ port ( | * ) ] [ @@ -634,7 +634,7 @@ view [ ] { no-case-compress { ; ... }; nocookie-udp-size ; nosit-udp-size ; // obsolete - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; @@ -846,7 +846,7 @@ view [ ] { min-refresh-time ; min-retry-time ; multi-master ; - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; @@ -955,7 +955,7 @@ zone [ ] { min-refresh-time ; min-retry-time ; multi-master ; - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; diff --git a/doc/misc/options.active b/doc/misc/options.active index 0be7cffd74d..018548edcc7 100644 --- a/doc/misc/options.active +++ b/doc/misc/options.active @@ -240,7 +240,7 @@ options { new-zones-directory ; no-case-compress { ; ... }; nocookie-udp-size ; - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-rate ; notify-source ( | * ) [ port ( | * ) ] [ @@ -566,7 +566,7 @@ view [ ] { new-zones-directory ; no-case-compress { ; ... }; nocookie-udp-size ; - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; @@ -763,7 +763,7 @@ view [ ] { min-refresh-time ; min-retry-time ; multi-master ; - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; @@ -865,7 +865,7 @@ zone [ ] { min-refresh-time ; min-retry-time ; multi-master ; - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; diff --git a/doc/misc/options.grammar.rst b/doc/misc/options.grammar.rst index f5cb236cfb0..034302cc290 100644 --- a/doc/misc/options.grammar.rst +++ b/doc/misc/options.grammar.rst @@ -169,7 +169,7 @@ new-zones-directory ; no-case-compress { ; ... }; nocookie-udp-size ; - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-rate ; notify-source ( | * ) [ port ( | * ) ] [ diff --git a/doc/misc/slave.zoneopt b/doc/misc/slave.zoneopt index 6a3deee91d9..040f2d5b69a 100644 --- a/doc/misc/slave.zoneopt +++ b/doc/misc/slave.zoneopt @@ -40,7 +40,7 @@ zone [ ] { min-refresh-time ; min-retry-time ; multi-master ; - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; notify-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; diff --git a/doc/misc/slave.zoneopt.rst b/doc/misc/slave.zoneopt.rst index b5a0b02ae98..d9617de9d34 100644 --- a/doc/misc/slave.zoneopt.rst +++ b/doc/misc/slave.zoneopt.rst @@ -42,7 +42,7 @@ min-refresh-time ; min-retry-time ; multi-master ; - notify ( explicit | master-only | ); + notify ( explicit | master-only | primary-only | ); notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; notify-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; diff --git a/lib/bind9/check.c b/lib/bind9/check.c index eb9e5a105cb..f2078fc6c20 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -2456,9 +2456,11 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, if (cfg_obj_isboolean(obj)) { donotify = cfg_obj_asboolean(obj); } else { - const char *notifystr = cfg_obj_asstring(obj); + const char *str = cfg_obj_asstring(obj); if (ztype != CFG_ZONE_MASTER && - strcasecmp(notifystr, "master-only") == 0) { + (strcasecmp(str, "master-only") == 0 || + strcasecmp(str, "primary-only") == 0)) + { donotify = false; } } diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index c7906fb42c2..2e93cb3faac 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -2812,7 +2812,8 @@ static cfg_type_t cfg_type_dialuptype = { "dialuptype", parse_dialup_type, cfg_print_ustring, doc_dialup_type, &cfg_rep_string, dialup_enums }; -static const char *notify_enums[] = { "explicit", "master-only", NULL }; +static const char *notify_enums[] = { "explicit", "master-only", "primary-only", + NULL }; static isc_result_t parse_notify_type(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { return (cfg_parse_enum_or_other(pctx, type, &cfg_type_boolean, ret));