diff --git a/CHANGES b/CHANGES index ab92f4d4b6bdd9d76f0c9179b6f3973a0949d1c8..799faaf44a308da56723eb105910990c59468944 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5039. [bug] Named could fail to preserve owner name case of new + RRset. [GL #420] + 5038. [bug] Chaosnet addresses were compared incorrectly. [GL #562] diff --git a/bin/tests/system/case/dynamic.good b/bin/tests/system/case/dynamic.good index 2e10b64191c1ab4b72000782e6eeb5884eb9089e..66f8afd66e9fcb915c6ed9cede85a953f9ceb26f 100644 --- a/bin/tests/system/case/dynamic.good +++ b/bin/tests/system/case/dynamic.good @@ -1,6 +1,6 @@ DyNaMiC. 300 IN SOA mname1. . 2000042407 20 20 1814400 3600 DyNaMiC. 300 IN NS ns1.DYNAMIC. -DyNaMiC. 300 IN MX 0 mail.eXaMpLe. +DynamiC. 300 IN MX 0 mail.eXaMpLe. mAiL.DynamiC. 300 IN A 10.53.0.1 ns1.DYNAMIC. 300 IN A 10.53.0.1 DyNaMiC. 300 IN SOA mname1. . 2000042407 20 20 1814400 3600 diff --git a/bin/tests/system/case/postns1.good b/bin/tests/system/case/postns1.good index 46bce2e6fd9b4792fdf7250fbc9648bca2350ca3..fcb3f9c58369c823cdede3145b71588aa7737a46 100644 --- a/bin/tests/system/case/postns1.good +++ b/bin/tests/system/case/postns1.good @@ -1,14 +1,6 @@ - -; <<>> DiG 9.11.0pre-alpha <<>> axfr dynamic @10.53.0.1 -p 5300 -;; global options: +cmd -dYNAMIc. 0 IN SOA mname1. . 2000042409 20 20 1814400 3600 +dYNAMIc. 300 IN SOA mname1. . 2000042409 20 20 1814400 3600 DyNaMiC. 300 IN NS ns1.DYNAMIC. -DyNaMiC. 300 IN MX 0 mail.eXaMpLe. +DynamiC. 300 IN MX 0 mail.eXaMpLe. mAiL.DynamiC. 300 IN A 10.53.0.1 Ns1.DyNaMIC. 300 IN A 10.53.0.1 -dYNAMIc. 0 IN SOA mname1. . 2000042409 20 20 1814400 3600 -;; Query time: 0 msec -;; SERVER: 10.53.0.1#5300(10.53.0.1) -;; WHEN: Mon Jan 19 14:50:54 EST 2015 -;; XFR size: 6 records (messages 1, bytes 234) - +dYNAMIc. 300 IN SOA mname1. . 2000042409 20 20 1814400 3600 diff --git a/bin/tests/system/case/postupdate.good b/bin/tests/system/case/postupdate.good index 66e5e36ed144cdff9eb0e84f5880fe411609ac03..77559288e9340aa1b8fb17506347a70a67f368ef 100644 --- a/bin/tests/system/case/postupdate.good +++ b/bin/tests/system/case/postupdate.good @@ -1,6 +1,6 @@ dYNAMIc. 300 IN SOA mname1. . 2000042408 20 20 1814400 3600 DyNaMiC. 300 IN NS ns1.DYNAMIC. -DyNaMiC. 300 IN MX 0 mail.eXaMpLe. +DynamiC. 300 IN MX 0 mail.eXaMpLe. mAiL.DynamiC. 300 IN A 10.53.0.1 ns1.DYNAMIC. 300 IN A 10.53.0.1 dYNAMIc. 300 IN SOA mname1. . 2000042408 20 20 1814400 3600 diff --git a/lib/dns/diff.c b/lib/dns/diff.c index 07c55bc2dc10f6bafbf4468fc31b9082ce5c3cd4..910326f38bcc624f00d17e4d18f516cd55ab69d5 100644 --- a/lib/dns/diff.c +++ b/lib/dns/diff.c @@ -476,7 +476,7 @@ dns_diff_load(dns_diff_t *diff, dns_addrdatasetfunc_t addfunc, dns_name_t *name; name = &t->name; - while (t != NULL && dns_name_equal(&t->name, name)) { + while (t != NULL && dns_name_caseequal(&t->name, name)) { dns_rdatatype_t type, covers; dns_diffop_t op; dns_rdatalist_t rdl; @@ -492,7 +492,7 @@ dns_diff_load(dns_diff_t *diff, dns_addrdatasetfunc_t addfunc, rdl.rdclass = t->rdata.rdclass; rdl.ttl = t->ttl; - while (t != NULL && dns_name_equal(&t->name, name) && + while (t != NULL && dns_name_caseequal(&t->name, name) && t->op == op && t->rdata.type == type && rdata_covers(&t->rdata) == covers) { diff --git a/lib/dns/master.c b/lib/dns/master.c index e10c23e25f5865ec01ace2285b08f37db864400d..c4025832cfe9f634cc54a926e02371350b450a5a 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -1459,7 +1459,7 @@ load_text(dns_loadctx_t *lctx) { * state. Linked lists are undone by commit(). */ if (ictx->glue != NULL && - dns_name_compare(ictx->glue, new_name) != 0) { + !dns_name_caseequal(ictx->glue, new_name)) { result = commit(callbacks, lctx, &glue_list, ictx->glue, source, ictx->glue_line); @@ -1485,7 +1485,7 @@ load_text(dns_loadctx_t *lctx) { * have. */ if ((ictx->glue == NULL) && (ictx->current == NULL || - dns_name_compare(ictx->current, new_name) != 0)) { + !dns_name_caseequal(ictx->current, new_name))) { if (current_has_delegation && is_glue(¤t_list, new_name)) { rdcount_save = rdcount; @@ -1856,7 +1856,7 @@ load_text(dns_loadctx_t *lctx) { if (type == dns_rdatatype_soa && (lctx->options & DNS_MASTER_ZONE) != 0 && - dns_name_compare(ictx->current, lctx->top) != 0) { + !dns_name_equal(ictx->current, lctx->top)) { char namebuf[DNS_NAME_FORMATSIZE]; dns_name_format(ictx->current, namebuf, sizeof(namebuf)); @@ -3083,8 +3083,9 @@ is_glue(rdatalist_head_t *head, dns_name_t *owner) { dns_name_init(&name, NULL); dns_rdata_toregion(rdata, ®ion); dns_name_fromregion(&name, ®ion); - if (dns_name_compare(&name, owner) == 0) + if (dns_name_equal(&name, owner)) { return (true); + } rdata = ISC_LIST_NEXT(rdata, link); } return (false); diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c index 9e2b403b11e8adf9a041bab995e05c6798880c78..198b7f251c9d5963ec2f91d5b96124b231d0d24a 100644 --- a/lib/dns/masterdump.c +++ b/lib/dns/masterdump.c @@ -1194,13 +1194,17 @@ dump_rdataset_raw(isc_mem_t *mctx, const dns_name_t *name, } static isc_result_t -dump_rdatasets_raw(isc_mem_t *mctx, const dns_name_t *name, +dump_rdatasets_raw(isc_mem_t *mctx, const dns_name_t *owner_name, dns_rdatasetiter_t *rdsiter, dns_totext_ctx_t *ctx, isc_buffer_t *buffer, FILE *f) { isc_result_t result; dns_rdataset_t rdataset; + dns_fixedname_t fixed; + dns_name_t *name; + name = dns_fixedname_initname(&fixed); + dns_name_copy(owner_name, name, NULL); for (result = dns_rdatasetiter_first(rdsiter); result == ISC_R_SUCCESS; result = dns_rdatasetiter_next(rdsiter)) { @@ -1208,6 +1212,8 @@ dump_rdatasets_raw(isc_mem_t *mctx, const dns_name_t *name, dns_rdataset_init(&rdataset); dns_rdatasetiter_current(rdsiter, &rdataset); + dns_rdataset_getownercase(&rdataset, name); + if (((rdataset.attributes & DNS_RDATASETATTR_NEGATIVE) != 0) && (ctx->style.flags & DNS_STYLEFLAG_NCACHE) == 0) { /* Omit negative cache entries */