]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Terminate yaml string after negative comment
authorMark Andrews <marka@isc.org>
Sun, 15 Dec 2024 22:57:30 +0000 (09:57 +1100)
committerMark Andrews <marka@isc.org>
Wed, 22 Jan 2025 23:58:54 +0000 (23:58 +0000)
(cherry picked from commit 89afc1138992def8d03a6cf59e3c9b4ea2185bbb)

lib/dns/masterdump.c

index 4a5692544308d89c52219b388ff7bdd2f38f5ea5..c547f31eaf000f6ca3c8fc49af3a92fe9790d990 100644 (file)
@@ -766,10 +766,17 @@ rdataset_totext(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
                INDENT_TO(rdata_column);
                if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) {
                        if (NXDOMAIN(rdataset)) {
-                               RETERR(str_totext(";-$NXDOMAIN\n", target));
+                               RETERR(str_totext(";-$NXDOMAIN", target));
                        } else {
-                               RETERR(str_totext(";-$NXRRSET\n", target));
+                               RETERR(str_totext(";-$NXRRSET", target));
                        }
+                       if (start != NULL) {
+                               RETERR(yaml_stringify(target, start));
+                               RETERR(str_totext("'\n", target));
+                       } else {
+                               RETERR(str_totext("\n", target));
+                       }
+
                        /*
                         * Print a summary of the cached records which make
                         * up the negative response.