]> granicus.if.org Git - pdns/commitdiff
Fix logic error in zone2sql
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 22 Dec 2015 15:41:32 +0000 (16:41 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 22 Dec 2015 15:46:51 +0000 (16:46 +0100)
Introduced in #3019.

Closes #3067

pdns/zone2sql.cc

index cc4ca92dbe4d6de60efa900d027b5b91401d173e..d95c5f2afc35931c80a21bf66c77b43f28b5adf2 100644 (file)
@@ -421,12 +421,14 @@ try
          continue;
        if(rr.qtype.getCode() == QType::SOA)
          seenSOA=true;
-        if(!haveEmittedZone && !zpt.getZoneName().empty()){
-          emitDomain(zpt.getZoneName().toStringNoDot());
-          haveEmittedZone = true;
-        } else {
-          // We have no zonename yet, don't emit
-          continue;
+        if(!haveEmittedZone) {
+          if(!zpt.getZoneName().empty()){
+            emitDomain(zpt.getZoneName().toStringNoDot());
+            haveEmittedZone = true;
+          } else {
+            // We have no zonename yet, don't emit
+            continue;
+          }
         }
 
         emitRecord(zpt.getZoneName().toStringNoDot(), rr.qname, rr.qtype.getName(), rr.content, rr.ttl, comment);