]> 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:18:29 +0000 (02:18 +0000)
committerMark Andrews <marka@isc.org>
Thu, 13 Jan 2011 02:18:29 +0000 (02:18 +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
lib/dns/rdata/generic/rrsig_46.c

diff --git a/CHANGES b/CHANGES
index 3ee6b70182a13bb748711b03128540b7bd097798..42139804deaca5eb5aef68fbbf62e0479d7bbbad 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]
+
 2996.  [security]      Temporarily disable SO_ACCEPTFILTER support.
                        [RT #22589]
 
index 13409bc14394718f16d23f13a68e848facfc7b59..c972931180bc242124ac61389d3b4938d8d0aa98 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rdata.c,v 1.184.18.11 2008/12/12 23:46:04 tbox Exp $ */
+/* $Id: rdata.c,v 1.184.18.12 2011/01/13 02:18:28 marka Exp $ */
 
 /*! \file */
 
@@ -1128,6 +1128,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 e3ff045bff4fc05d45a4dc1da81c59d2166d69a3..dd9a01f3f0eff681ab8dffc42032915700c1d853 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: ipseckey_45.c,v 1.2.2.4 2009/09/18 21:57:08 jinmei Exp $ */
+/* $Id: ipseckey_45.c,v 1.2.2.5 2011/01/13 02:18:28 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 dd391052c399325f0f6bb58444e2c489ffea1960..e657a41d20520e3d3e2059d1f8ffda0835fa1a1f 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsec_47.c,v 1.7.20.2 2008/07/15 23:46:14 tbox Exp $ */
+/* $Id: nsec_47.c,v 1.7.20.3 2011/01/13 02:18:29 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 6561f28dc59fc2accdb535860aa9c3f9fac40960..e004d4353191ac167a0dc5ba79bf763c7f916e74 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rrsig_46.c,v 1.5.18.3 2005/04/29 00:16:39 marka Exp $ */
+/* $Id: rrsig_46.c,v 1.5.18.4 2011/01/13 02:18:29 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.