]> 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 02:06:13 +0000 (02:06 +0000)
committerMark Andrews <marka@isc.org>
Thu, 13 Jan 2011 02:06:13 +0000 (02:06 +0000)
                        rdata which is no compressable when writing master
                        files.  [RT #22863]

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

diff --git a/CHANGES b/CHANGES
index 46e615725081f3234838558ddff9aa92cf88c140..15355193306447141f13c6727f40f3f6ef27d7dd 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 ab9df8b7d0bba9c9a8811bb5388e42ad9a97fefd..1c33999efc45856d5cf2101d8f3907090d6dcfe8 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rdata.c,v 1.199.50.2 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: rdata.c,v 1.199.50.3 2011/01/13 02:06:12 marka Exp $ */
 
 /*! \file */
 
@@ -1135,6 +1135,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 6a58bc9bb4e810db8b3c5b516a8bd9f60e037304..a8406e91df470b311549f30e047a509610e2d993 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: ipseckey_45.c,v 1.4.332.3 2009/09/18 21:55:48 jinmei Exp $ */
+/* $Id: ipseckey_45.c,v 1.4.332.4 2011/01/13 02:06:13 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 7e443d9b76395bacbef0b0dcf11f21b39d2777bc..08a78664bc1899831e3fc7c4225660c226b1916b 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsec_47.c,v 1.11 2008/07/15 23:47:21 tbox Exp $ */
+/* $Id: nsec_47.c,v 1.11.82.1 2011/01/13 02:06:13 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) {