]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
pdnsutil add-record: notice when backend does not support replaceRRSet. Fixes #9730 9775/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 25 Nov 2020 12:07:12 +0000 (13:07 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 25 Nov 2020 12:07:12 +0000 (13:07 +0100)
pdns/pdnsutil.cc

index f9d0481db8b24f63affa241f47d553273d732d3b..a8b1ffc577aebf65cc3cc3f2114ff1eac3514c71 100644 (file)
@@ -1408,7 +1408,10 @@ static int addOrReplaceRecord(bool addOrReplace, const vector<string>& cmds) {
   }
 
 
-  di.backend->replaceRRSet(di.id, name, rr.qtype, newrrs);
+  if(!di.backend->replaceRRSet(di.id, name, rr.qtype, newrrs)) {
+    cerr<<"backend did not accept the new RRset, aborting"<<endl;
+    return EXIT_FAILURE;
+  }
   // need to be explicit to bypass the ueberbackend cache!
   di.backend->lookup(rr.qtype, name, di.id);
   cout<<"New rrset:"<<endl;