]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Don't insert 2nd space between NSEC3 nexthash and typemap fields
authorMukund Sivaraman <muks@isc.org>
Wed, 23 May 2018 13:10:48 +0000 (18:40 +0530)
committerMark Andrews <marka@isc.org>
Mon, 4 Jun 2018 03:21:57 +0000 (13:21 +1000)
(cherry picked from commit d4ea1edd2c01433dedb21e31929e859c8507c6b9)

bin/tests/system/xfer/dig1.good
bin/tests/system/xfer/dig2.good
lib/dns/rdata.c
lib/dns/rdata/generic/csync_62.c
lib/dns/rdata/generic/nsec3_50.c
lib/dns/rdata/generic/nsec_47.c

index 5af1e5928a6d4c97667d151417016e6ed02aa5b9..aba6a43ac363e296eff59d125e26599164cafa1e 100644 (file)
@@ -149,7 +149,7 @@ wks01.example.              3600    IN      WKS     10.0.0.1 6 0 1 2 21 23
 wks02.example.         3600    IN      WKS     10.0.0.1 17 0 1 2 53
 wks03.example.         3600    IN      WKS     10.0.0.2 6 65535
 x2501.example.         3600    IN      X25     "123456789"
-8f1tmio9avcom2k0frp92lgcumak0cad.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C 8FPNS2UCT7FBS643THP2B77PEQ77K6IU  A NS SOA MX AAAA RRSIG DNSKEY NSEC3PARAM
+8f1tmio9avcom2k0frp92lgcumak0cad.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C 8FPNS2UCT7FBS643THP2B77PEQ77K6IU A NS SOA MX AAAA RRSIG DNSKEY NSEC3PARAM
 kcd3juae64f9c5csl1kif1htaui7un0g.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C KD5MN2M20340DGO0BL7NTSB8JP4BSC7E
-mr5ukvsk1l37btu4q7b1dfevft4hkqdk.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C MT38J6VG7S0SN5G17MCUF6IQIKFUAJ05  A AAAA RRSIG
+mr5ukvsk1l37btu4q7b1dfevft4hkqdk.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C MT38J6VG7S0SN5G17MCUF6IQIKFUAJ05 A AAAA RRSIG
 example.               86400   IN      SOA     ns2.example. hostmaster.example. 1397051952 5 5 1814400 3600
index e12ec118c5d6e0f85d7470b1f157597f6645f18a..40c8c405b41045b013daafb00fd2eb624972c4f7 100644 (file)
@@ -149,7 +149,7 @@ wks01.example.              3600    IN      WKS     10.0.0.1 6 0 1 2 21 23
 wks02.example.         3600    IN      WKS     10.0.0.1 17 0 1 2 53
 wks03.example.         3600    IN      WKS     10.0.0.2 6 65535
 x2501.example.         3600    IN      X25     "123456789"
-8f1tmio9avcom2k0frp92lgcumak0cad.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C 8FPNS2UCT7FBS643THP2B77PEQ77K6IU  A NS SOA MX AAAA RRSIG DNSKEY NSEC3PARAM
+8f1tmio9avcom2k0frp92lgcumak0cad.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C 8FPNS2UCT7FBS643THP2B77PEQ77K6IU A NS SOA MX AAAA RRSIG DNSKEY NSEC3PARAM
 kcd3juae64f9c5csl1kif1htaui7un0g.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C KD5MN2M20340DGO0BL7NTSB8JP4BSC7E
-mr5ukvsk1l37btu4q7b1dfevft4hkqdk.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C MT38J6VG7S0SN5G17MCUF6IQIKFUAJ05  A AAAA RRSIG
+mr5ukvsk1l37btu4q7b1dfevft4hkqdk.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C MT38J6VG7S0SN5G17MCUF6IQIKFUAJ05 A AAAA RRSIG
 example.               86400   IN      SOA     ns2.example. hostmaster.example. 1397051953 5 5 1814400 3600
index 60e929c6f1d1ef97bb9d3ab9fd44066a6a8b0f37..bc7d93c2c0b6b1443f43436205fa492e608ed58e 100644 (file)
@@ -512,7 +512,7 @@ typemap_totext(isc_region_t *sr, dns_rdata_textctx_t *tctx,
 {
        unsigned int i, j, k;
        unsigned int window, len;
-       isc_boolean_t first = ISC_FALSE;
+       isc_boolean_t first = ISC_TRUE;
 
        for (i = 0; i < sr->length; i += len) {
                if (tctx != NULL &&
index 64785c0a700b1f3afd1a9d4361f589157aa1fa6c..0d5dcc58061ab8d18b14f51e5f330bdbff0e577a 100644 (file)
@@ -74,6 +74,12 @@ totext_csync(ARGS_TOTEXT) {
        snprintf(buf, sizeof(buf), "%lu", num);
        RETERR(str_totext(buf, target));
 
+       /*
+        * Don't leave a trailing space when there's no typemap present.
+        */
+       if (sr.length > 0) {
+               RETERR(str_totext(" ", target));
+       }
        return (typemap_totext(&sr, NULL, target));
 }
 
index 0eaed2261ed1661a7b0a3e78ee972bfd77e1632f..973460c881495eea39c7a078ac92c1502fe47b53 100644 (file)
@@ -168,9 +168,9 @@ totext_nsec3(ARGS_TOTEXT) {
        /*
         * Don't leave a trailing space when there's no typemap present.
         */
-       if (((tctx->flags & DNS_STYLEFLAG_MULTILINE) == 0) && (sr.length > 0))
+       if (((tctx->flags & DNS_STYLEFLAG_MULTILINE) == 0) && (sr.length > 0)) {
                RETERR(str_totext(" ", target));
-
+       }
        RETERR(typemap_totext(&sr, tctx, target));
 
        if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
index 437c124659cef5832615ff73f2a414b1b3adba62..1a39b76fb42796e268c9615f6870f56bda043ea6 100644 (file)
@@ -70,6 +70,12 @@ totext_nsec(ARGS_TOTEXT) {
        dns_name_fromregion(&name, &sr);
        isc_region_consume(&sr, name_length(&name));
        RETERR(dns_name_totext(&name, ISC_FALSE, target));
+       /*
+        * Don't leave a trailing space when there's no typemap present.
+        */
+       if (sr.length > 0) {
+               RETERR(str_totext(" ", target));
+       }
        return (typemap_totext(&sr, NULL, target));
 }