]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: api, do not create SOA and NS records for consumer zones
authorKees Monshouwer <mind04@monshouwer.org>
Tue, 6 Dec 2022 17:29:16 +0000 (18:29 +0100)
committermind04 <mind04@monshouwer.org>
Tue, 6 Dec 2022 17:29:16 +0000 (18:29 +0100)
pdns/ws-auth.cc

index 419cdc03c76817e55e70538a9e203965b2f18db8..8342d5af368590ec8dea96f0a9abaf2eb8fe721c 100644 (file)
@@ -1705,7 +1705,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) {
       throw ApiException("You cannot give rrsets AND zone data as text");
 
     auto nameservers = document["nameservers"];
-    if (!nameservers.is_null() && !nameservers.is_array() && zonekind != DomainInfo::Slave)
+    if (!nameservers.is_null() && !nameservers.is_array() && zonekind != DomainInfo::Slave && zonekind != DomainInfo::Consumer)
       throw ApiException("Nameservers is not a list");
 
     // if records/comments are given, load and check them
@@ -1755,7 +1755,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) {
     autorr.auth = true;
     autorr.ttl = ::arg().asNum("default-ttl");
 
-    if (!have_soa && zonekind != DomainInfo::Slave) {
+    if (!have_soa && zonekind != DomainInfo::Slave && zonekind != DomainInfo::Consumer) {
       // synthesize a SOA record so the zone "really" exists
       string soa = ::arg()["default-soa-content"];
       boost::replace_all(soa, "@", zonename.toStringNoDot());