]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #12291 from Habbie/backport-12285-to-auth-4.7.x
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 8 Dec 2022 08:04:55 +0000 (09:04 +0100)
committerGitHub <noreply@github.com>
Thu, 8 Dec 2022 08:04:55 +0000 (09:04 +0100)
auth-4.7 api: do not create SOA and NS records for consumer zones

1  2 
pdns/ws-auth.cc
regression-tests.api/test_Zones.py

diff --cc pdns/ws-auth.cc
index 419cdc03c76817e55e70538a9e203965b2f18db8,d2d0ab015382fa5bb074d46531d5b1e9085ba8f5..8342d5af368590ec8dea96f0a9abaf2eb8fe721c
@@@ -1705,9 -1704,18 +1705,9 @@@ static void apiServerZones(HttpRequest
        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");
  
 -    string soa_edit_api_kind;
 -    if (document["soa_edit_api"].is_string()) {
 -      soa_edit_api_kind = document["soa_edit_api"].string_value();
 -    }
 -    else {
 -      soa_edit_api_kind = "DEFAULT";
 -    }
 -    string soa_edit_kind = document["soa_edit"].string_value();
 -
      // if records/comments are given, load and check them
      bool have_soa = false;
      bool have_zone_ns = false;
Simple merge