]> granicus.if.org Git - pdns/commitdiff
make sure AXFR only delete records from a SLAVE domain in a multi backend setup
authorKees Monshouwer <mind04@monshouwer.org>
Tue, 20 Dec 2016 14:13:15 +0000 (15:13 +0100)
committermind04 <mind04@monshouwer.org>
Sat, 31 Dec 2016 10:10:37 +0000 (11:10 +0100)
pdns/dynhandler.cc
pdns/slavecommunicator.cc

index 71aa3886e44934a59f2731a047931a7fe1caca83..efa4e1606c3f04453cb145bed74cb6140147df9e 100644 (file)
@@ -247,7 +247,7 @@ string DLNotifyRetrieveHandler(const vector<string>&parts, Utility::pid_t ppid)
   if(!B.getDomainInfo(domain, di))
     return "Domain '"+domain.toString()+"' unknown";
   
-  if(di.masters.empty())
+  if(di.kind != DomainInfo::Slave || di.masters.empty())
     return "Domain '"+domain.toString()+"' is not a slave domain (or has no master defined)";
 
   random_shuffle(di.masters.begin(), di.masters.end());
index 56724320b812eb565db006e215fee011ca980027..0df99b07543e2fe507f3fc7c016164dc82507fe9 100644 (file)
@@ -92,7 +92,7 @@ void CommunicatorClass::ixfrSuck(const DNSName &domain, const TSIGTriplet& tt, c
   try {
     DNSSECKeeper dk (&B); // reuse our UeberBackend copy for DNSSECKeeper
 
-    if(!B.getDomainInfo(domain, di) || !di.backend) { // di.backend and B are mostly identical
+    if(!B.getDomainInfo(domain, di) || !di.backend || di.kind != DomainInfo::Slave) { // di.backend and B are mostly identical
       L<<Logger::Error<<"Can't determine backend for domain '"<<domain<<"'"<<endl;
       return;
     }
@@ -301,7 +301,7 @@ void CommunicatorClass::suck(const DNSName &domain, const string &remote)
   try {
     DNSSECKeeper dk (&B); // reuse our UeberBackend copy for DNSSECKeeper
 
-    if(!B.getDomainInfo(domain, di) || !di.backend) { // di.backend and B are mostly identical
+    if(!B.getDomainInfo(domain, di) || !di.backend || di.kind != DomainInfo::Slave) { // di.backend and B are mostly identical
       L<<Logger::Error<<"Can't determine backend for domain '"<<domain<<"'"<<endl;
       return;
     }