Commit 3e440113 authored by Mark Andrews's avatar Mark Andrews
Browse files

Merge branch...

Merge branch '420-reading-from-master-files-could-sometime-fail-to-preserve-the-case-of-the-owner-name' into 'master'

Resolve "reading from master files could sometime fail to preserve the case of the owner name."

Closes #420

See merge request !536
parents c93acb99 4fcdad29
Pipeline #5027 passed with stages
in 13 minutes and 35 seconds
5039. [bug] Named could fail to preserve owner name case of new
RRset. [GL #420]
5038. [bug] Chaosnet addresses were compared incorrectly.
[GL #562]
 
......
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
; <<>> 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
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
......@@ -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)
{
......
......@@ -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(&current_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, &region);
dns_name_fromregion(&name, &region);
if (dns_name_compare(&name, owner) == 0)
if (dns_name_equal(&name, owner)) {
return (true);
}
rdata = ISC_LIST_NEXT(rdata, link);
}
return (false);
......
......@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment