diff --git a/CHANGES b/CHANGES index 1e0dbae12b..fa06d6c91d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5719. [func] The "masterfile-format" format "map" has been marked + as deprecated. The "map" format will be permanently + removed in a future release. [GL #2882] + 5718. [bug] Changing the sig signing type, by specifing sig-signing-type, failed as the configuration was incorrectly rejected. [GL #2906] diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index 92fa47cc9f..d61fb4f2a5 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -1053,6 +1053,9 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig, masterformat = dns_masterformat_raw; } else if (strcasecmp(masterformatstr, "map") == 0) { masterformat = dns_masterformat_map; + cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING, + "masterfile-format: format 'map' is " + "deprecated"); } else { INSIST(0); ISC_UNREACHABLE(); diff --git a/bin/tests/system/checkconf/deprecated-masterfile-format-map.conf b/bin/tests/system/checkconf/deprecated-masterfile-format-map.conf new file mode 100644 index 0000000000..9218adf59a --- /dev/null +++ b/bin/tests/system/checkconf/deprecated-masterfile-format-map.conf @@ -0,0 +1,20 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + port 5300; +}; + +zone example { + type secondary; + primaries { ::1; }; + masterfile-format map; +}; diff --git a/bin/tests/system/checkconf/good-masterfile-format-raw.conf b/bin/tests/system/checkconf/good-masterfile-format-raw.conf new file mode 100644 index 0000000000..aa1386b81d --- /dev/null +++ b/bin/tests/system/checkconf/good-masterfile-format-raw.conf @@ -0,0 +1,20 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + port 5300; +}; + +zone example { + type secondary; + primaries { ::1; }; + masterfile-format raw; +}; diff --git a/bin/tests/system/checkconf/good-masterfile-format-text.conf b/bin/tests/system/checkconf/good-masterfile-format-text.conf new file mode 100644 index 0000000000..34fbf3b8f2 --- /dev/null +++ b/bin/tests/system/checkconf/good-masterfile-format-text.conf @@ -0,0 +1,20 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + port 5300; +}; + +zone example { + type secondary; + primaries { ::1; }; + masterfile-format text; +}; diff --git a/bin/tests/system/checkconf/tests.sh b/bin/tests/system/checkconf/tests.sh index 8f0dbadc43..c8cfea8923 100644 --- a/bin/tests/system/checkconf/tests.sh +++ b/bin/tests/system/checkconf/tests.sh @@ -571,6 +571,24 @@ grep "not recommended" < checkconf.out$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi status=`expr $status + $ret` +n=$((n+1)) +echo_i "check that masterfile-format map generates deprecation warning ($n)" +ret=0 +$CHECKCONF deprecated-masterfile-format-map.conf > checkconf.out$n 2>/dev/null || ret=1 +grep "is deprecated" < checkconf.out$n >/dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi +status=$((status+ret)) + +n=$((n+1)) +echo_i "check that masterfile-format text and raw don't generate deprecation warning ($n)" +ret=0 +$CHECKCONF good-masterfile-format-text.conf > checkconf.out$n 2>/dev/null || ret=1 +grep "is deprecated" < checkconf.out$n >/dev/null && ret=1 +$CHECKCONF good-masterfile-format-raw.conf > checkconf.out$n 2>/dev/null || ret=1 +grep "is deprecated" < checkconf.out$n >/dev/null && ret=1 +if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi +status=$((status+ret)) + rmdir keys echo_i "exit status: $status" diff --git a/doc/notes/notes-current.rst b/doc/notes/notes-current.rst index d985db095f..081dc00deb 100644 --- a/doc/notes/notes-current.rst +++ b/doc/notes/notes-current.rst @@ -47,6 +47,9 @@ Feature Changes 9.16.0 but no error was reported, although sending UDP messages (such as notifies) would fail. :gl:`#2888` +- The ``masterfile-format`` format ``map`` has been marked as deprecated and + will be removed in a future release. :gl:`#2882` + Bug Fixes ~~~~~~~~~ diff --git a/lib/bind9/check.c b/lib/bind9/check.c index 5cc360624e..7189a8d4c6 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -3459,6 +3459,9 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, masterformat = dns_masterformat_raw; } else if (strcasecmp(masterformatstr, "map") == 0) { masterformat = dns_masterformat_map; + cfg_obj_log(obj, logctx, ISC_LOG_WARNING, + "masterfile-format: format 'map' is " + "deprecated"); } else { INSIST(0); ISC_UNREACHABLE();