From 6b7a488cbcedf0fcb3f9de3e8e63795afd599781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 16 Sep 2021 10:38:22 +0200 Subject: [PATCH 1/3] Mark the masterfile-format type 'map' as deprecated The map masterfile-format is very fragile and it needs API bump every time a RBTDB data structures changes. Also while testing it, we found out that files larger than 2GB weren't loading and nobody noticed, and loading many map files were also failing (subject to kernel limits). Thus we are marking the masterfile-format type 'map' as deprecated and to be removed in the next stable BIND 9 release. --- bin/named/zoneconf.c | 3 +++ lib/bind9/check.c | 3 +++ 2 files changed, 6 insertions(+) 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/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(); From f4e6348f296d9c8d7f40be8956062339fb1bb8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 16 Sep 2021 10:58:38 +0200 Subject: [PATCH 2/3] Add masterfile-format checkconf tests Add tests that check that masterfile-format map generate deprecation warning and mastefile-formats text and raw doesn't. --- .../deprecated-masterfile-format-map.conf | 20 +++++++++++++++++++ .../checkconf/good-masterfile-format-raw.conf | 20 +++++++++++++++++++ .../good-masterfile-format-text.conf | 20 +++++++++++++++++++ bin/tests/system/checkconf/tests.sh | 18 +++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 bin/tests/system/checkconf/deprecated-masterfile-format-map.conf create mode 100644 bin/tests/system/checkconf/good-masterfile-format-raw.conf create mode 100644 bin/tests/system/checkconf/good-masterfile-format-text.conf 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" From c5180369881d813674d6127124350c96ba021c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 16 Sep 2021 11:02:32 +0200 Subject: [PATCH 3/3] Add CHANGES and releases notes for [GL #2882] --- CHANGES | 4 ++++ doc/notes/notes-current.rst | 3 +++ 2 files changed, 7 insertions(+) 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/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 ~~~~~~~~~