]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
pdnsutil: Set domain masters to the full list
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 11 Oct 2017 10:26:00 +0000 (12:26 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 11 Oct 2017 10:26:00 +0000 (12:26 +0200)
Before, only the last master of all the master would eb added becuase of
the way DNSBackend::setMaster() is implemented in gsql backends.

pdns/pdnsutil.cc

index db522db8d6b2f73160a82e510ed4e0275df81b55..50446ebd641899b74b2d6ca4d20d49a1204033c7 100644 (file)
@@ -3241,9 +3241,15 @@ try
       if (!tgt->createDomain(di.zone)) throw PDNSException("Failed to create zone");
       tgt->setKind(di.zone, di.kind);
       tgt->setAccount(di.zone,di.account);
+      string masters="";
+      bool first = true;
       for(const string& master: di.masters) {
-        tgt->setMaster(di.zone, master);
+        if (!first)
+          masters += ", ";
+        first = false;
+        masters += master;
       }
+      tgt->setMaster(di.zone, masters);
       // move records
       if (!src->list(di.zone, di.id, true)) throw PDNSException("Failed to list records");
       nr=0;