From c07a0c6dea5bbe86574fc4b5d4a05b50a93ac8f7 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Sun, 24 Jan 2016 20:14:39 +0100 Subject: [PATCH] make sure replace-rrset replaces the right type --- pdns/pdnsutil.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 7b56b91f0..b8300bd92 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -985,10 +985,10 @@ int addOrReplaceRecord(bool addOrReplace, const vector& cmds) { rr.auth = 1; rr.domain_id = di.id; rr.qname = name; - + DNSResourceRecord oldrr; if(addOrReplace) { // the 'add' case B.lookup(rr.qtype, rr.qname, 0, di.id); - DNSResourceRecord oldrr; + while(B.get(oldrr)) newrrs.push_back(oldrr); } @@ -1011,8 +1011,8 @@ int addOrReplaceRecord(bool addOrReplace, const vector& cmds) { bool found=false; if(rr.qtype.getCode() == QType::CNAME) { // this will save us SO many questions - while(B.get(rr)) { - if(addOrReplace || rr.qtype.getCode() != QType::CNAME) // the replace case is ok if we replace one CNAME by the other + while(B.get(oldrr)) { + if(addOrReplace || oldrr.qtype.getCode() != QType::CNAME) // the replace case is ok if we replace one CNAME by the other found=true; } if(found) { @@ -1021,8 +1021,8 @@ int addOrReplaceRecord(bool addOrReplace, const vector& cmds) { } } else { - while(B.get(rr)) { - if(rr.qtype.getCode() == QType::CNAME) + while(B.get(oldrr)) { + if(oldrr.qtype.getCode() == QType::CNAME) found=true; } if(found) { -- 2.40.0