]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #7787 from rgacogne/auth-api-replace-ent
authorRemi Gacogne <rgacogne@users.noreply.github.com>
Wed, 15 May 2019 08:43:35 +0000 (10:43 +0200)
committerGitHub <noreply@github.com>
Wed, 15 May 2019 08:43:35 +0000 (10:43 +0200)
auth: Fix ENTs removal when "replacing" new records via the API

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

index 7f5d1b7cde0554aa521e7329f28268c1ad68dd54..21396729caa9b996574d57932e3d98cd546a8dbf 100644 (file)
@@ -2010,8 +2010,10 @@ static void patchZone(HttpRequest* req, HttpResponse* resp) {
           di.backend->lookup(QType(QType::ANY), qname);
           DNSResourceRecord rr;
           while (di.backend->get(rr)) {
-            if (qtype.getCode() == 0) {
+            if (rr.qtype.getCode() == 0) {
               ent_present = true;
+              /* that's fine, we will override it */
+              continue;
             }
             if (qtype.getCode() != rr.qtype.getCode()
               && (exclusiveEntryTypes.count(qtype.getCode()) != 0
index ff756bad0a33c776e90192ea14a9779c36386803..514cea8e0ee2b72ad1e47d5b0ab7a5a3815aa468 100644 (file)
@@ -1801,7 +1801,7 @@ $ORIGIN %NAME%
         self.assertIsNone(dbrecs[0]['ordername'])
 
     def test_cname_at_ent_place(self):
-        name, payload, zone = self.create_zone(api_rectify=True)
+        name, payload, zone = self.create_zone(dnssec=True, api_rectify=True)
         rrset = {
             'changetype': 'replace',
             'name': 'sub2.sub1.' + name,