]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3007. [bug] Named failed to preserve the case of domain names in
authorMark Andrews <marka@isc.org>
Thu, 13 Jan 2011 01:34:41 +0000 (01:34 +0000)
committerMark Andrews <marka@isc.org>
Thu, 13 Jan 2011 01:34:41 +0000 (01:34 +0000)
                        rdata which is no compressable when writing master
                        files.  [RT #22863]

CHANGES
lib/dns/rdata.c
lib/dns/rdata/generic/hip_55.c
lib/dns/rdata/generic/ipseckey_45.c
lib/dns/rdata/generic/nsec_47.c
lib/dns/rdata/generic/rrsig_46.c

diff --git a/CHANGES b/CHANGES
index fe45cdf268d4d387c7fb225baa1ee0381c92118f..f8c6d648dac53b26614d54f3cf7221fbef5c5eaf 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+3007.  [bug]           Named failed to preserve the case of domain names in
+                       rdata which is no compressable when writing master
+                       files.  [RT #22863]
+
 3002.  [bug]           isc_mutex_init_errcheck() failed to destroy attr.
                        [RT #22766]
 
index 77c7f7bd2474ab63dbd89a76446824c2d01d0a9e..7c85ea1c0aa757739283466e83b1c756b5022726 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rdata.c,v 1.204 2009/12/04 21:09:33 marka Exp $ */
+/* $Id: rdata.c,v 1.204.4.1 2011/01/13 01:34:41 marka Exp $ */
 
 /*! \file */
 
@@ -1150,6 +1150,11 @@ name_prefix(dns_name_t *name, dns_name_t *origin, dns_name_t *target) {
        if (l1 == l2)
                goto return_false;
 
+       /* Master files should be case preserving. */
+       dns_name_getlabelsequence(name, l1 - l2, l2, target);
+       if (!dns_name_caseequal(origin, target))
+               goto return_false;
+
        dns_name_getlabelsequence(name, 0, l1 - l2, target);
        return (ISC_TRUE);
 
index cc7ded316aa5cc1eb96dc043e5f2ff22622fba37..36031169b1d99dd39a6fe4d861e81792548484a4 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: hip_55.c,v 1.6 2009/12/04 22:06:37 tbox Exp $ */
+/* $Id: hip_55.c,v 1.6.4.1 2011/01/13 01:34:41 marka Exp $ */
 
 /* reviewed: TBC */
 
@@ -122,8 +122,6 @@ static inline isc_result_t
 totext_hip(ARGS_TOTEXT) {
        isc_region_t region;
        dns_name_t name;
-       dns_name_t prefix;
-       isc_boolean_t sub;
        size_t length, key_len, hit_len;
        unsigned char algorithm;
        char buf[sizeof("225 ")];
@@ -175,12 +173,10 @@ totext_hip(ARGS_TOTEXT) {
         * Rendezvous Servers.
         */
        dns_name_init(&name, NULL);
-       dns_name_init(&prefix, NULL);
        while (region.length > 0) {
                dns_name_fromregion(&name, &region);
 
-               sub = name_prefix(&name, tctx->origin, &prefix);
-               RETERR(dns_name_totext(&prefix, sub, target));
+               RETERR(dns_name_totext(&name, ISC_FALSE, target));
                isc_region_consume(&region, name.length);
                if (region.length > 0)
                        RETERR(str_totext(tctx->linebreak, target));
index 072f13d6f2e3a1cd5f0a5c21354c728fd2b804b0..06ff80d4b025313a517524b1cf0fb6cddd7122d1 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: ipseckey_45.c,v 1.9 2009/12/04 22:06:37 tbox Exp $ */
+/* $Id: ipseckey_45.c,v 1.9.4.1 2011/01/13 01:34:41 marka Exp $ */
 
 #ifndef RDATA_GENERIC_IPSECKEY_45_C
 #define RDATA_GENERIC_IPSECKEY_45_C
@@ -120,8 +120,6 @@ static inline isc_result_t
 totext_ipseckey(ARGS_TOTEXT) {
        isc_region_t region;
        dns_name_t name;
-       dns_name_t prefix;
-       isc_boolean_t sub;
        char buf[sizeof("255 ")];
        unsigned short num;
        unsigned short gateway;
@@ -130,7 +128,6 @@ totext_ipseckey(ARGS_TOTEXT) {
        REQUIRE(rdata->length >= 3);
 
        dns_name_init(&name, NULL);
-       dns_name_init(&prefix, NULL);
 
        if (rdata->data[1] > 3U)
                return (ISC_R_NOTIMPLEMENTED);
@@ -183,8 +180,7 @@ totext_ipseckey(ARGS_TOTEXT) {
 
        case 3:
                dns_name_fromregion(&name, &region);
-               sub = name_prefix(&name, tctx->origin, &prefix);
-               RETERR(dns_name_totext(&prefix, sub, target));
+               RETERR(dns_name_totext(&name, ISC_FALSE, target));
                isc_region_consume(&region, name_length(&name));
                break;
        }
index ee9fb37c6c8db1f94d6c3f7051cf1006c56eaacf..4f728bbe67693cdd91d4384fdad18d49a33f50ee 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsec_47.c,v 1.13 2009/12/04 22:06:37 tbox Exp $ */
+/* $Id: nsec_47.c,v 1.13.4.1 2011/01/13 01:34:41 marka Exp $ */
 
 /* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */
 
@@ -88,20 +88,18 @@ totext_nsec(ARGS_TOTEXT) {
        isc_region_t sr;
        unsigned int i, j, k;
        dns_name_t name;
-       dns_name_t prefix;
-       isc_boolean_t sub;
        unsigned int window, len;
 
        REQUIRE(rdata->type == 47);
        REQUIRE(rdata->length != 0);
 
+       UNUSED(tctx);
+
        dns_name_init(&name, NULL);
-       dns_name_init(&prefix, NULL);
        dns_rdata_toregion(rdata, &sr);
        dns_name_fromregion(&name, &sr);
        isc_region_consume(&sr, name_length(&name));
-       sub = name_prefix(&name, tctx->origin, &prefix);
-       RETERR(dns_name_totext(&prefix, sub, target));
+       RETERR(dns_name_totext(&name, ISC_FALSE, target));
 
 
        for (i = 0; i < sr.length; i += len) {
index 078cd4cb131a56e3ad0a3d1ad4dfeaa8f32d32f3..44b350459428b3b5f7b34ac537f3d4b3446b1231 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rrsig_46.c,v 1.12 2009/12/04 22:06:37 tbox Exp $ */
+/* $Id: rrsig_46.c,v 1.12.4.1 2011/01/13 01:34:41 marka Exp $ */
 
 /* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */
 
@@ -134,8 +134,6 @@ totext_rrsig(ARGS_TOTEXT) {
        unsigned long exp;
        unsigned long foot;
        dns_name_t name;
-       dns_name_t prefix;
-       isc_boolean_t sub;
 
        REQUIRE(rdata->type == 46);
        REQUIRE(rdata->length != 0);
@@ -217,11 +215,9 @@ totext_rrsig(ARGS_TOTEXT) {
         * Signer.
         */
        dns_name_init(&name, NULL);
-       dns_name_init(&prefix, NULL);
        dns_name_fromregion(&name, &sr);
        isc_region_consume(&sr, name_length(&name));
-       sub = name_prefix(&name, tctx->origin, &prefix);
-       RETERR(dns_name_totext(&prefix, sub, target));
+       RETERR(dns_name_totext(&name, ISC_FALSE, target));
 
        /*
         * Sig.