]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: fix regression while handling user-defined axfr filters return values, and... 6370/head
authorCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Mon, 19 Mar 2018 18:47:25 +0000 (19:47 +0100)
committerCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Mon, 19 Mar 2018 18:47:25 +0000 (19:47 +0100)
docs/modes-of-operation.rst
pdns/lua-auth4.cc

index 69b17b6d2a0c860882c756cc87d1f85cfda87dc4..365eab4b66a26be3640d60266216fdabd7e13f0e 100644 (file)
@@ -272,7 +272,7 @@ Consider the following simple example:
            if record:qtype() == pdns.HINFO then
               resp = {}
               resp[1] = {
-                qname   = record:qname:toString(),
+                qname   = record:qname():toString(),
                 qtype   = pdns.TXT,
                 ttl     = 99,
                 content = "Hello Ahu!"
@@ -281,7 +281,7 @@ Consider the following simple example:
            end
 
            -- Grab each _tstamp TXT record and add a time stamp
-           if record:qtype() == pdns.TXT and string.starts(record:qname:toString(), "_tstamp.") then
+           if record:qtype() == pdns.TXT and string.starts(record:qname():toString(), "_tstamp.") then
               resp = {}
               resp[1] = {
                 qname   = record:qname():toString(),
@@ -296,7 +296,7 @@ Consider the following simple example:
            if record:qtype() == pdns.A then
               resp = {}
               resp[1] = {
-                qname   = record:qname:toString(),
+                qname   = record:qname():toString(),
                 qtype   = pdns.TXT,
                 ttl     = 99,
                 content = "Hello Ahu, again!"
index db9bb0ab37ba48fd9ae07370abc66a5c031a1fa4..f7a3414ad1cee87c192028ef5f789e703697869c 100644 (file)
@@ -113,10 +113,17 @@ bool AuthLua4::axfrfilter(const ComboAddress& remote, const DNSName& zone, const
 
   ret = d_axfr_filter(remote, zone, in);
   rcode = std::get<0>(ret);
-  if (rcode < 0)
+  if (rcode < 0) {
+    // no modification, handle normally
     return false;
-  else if (rcode == 1)
+  }
+  else if (rcode == 0) {
+    // replace the matching record by the filtered record(s)
+  }
+  else if (rcode == 1) {
+    // append the filtered record(s) after the matching record
     out.push_back(in);
+  }
   else
     throw PDNSException("Cannot understand return code "+std::to_string(rcode)+" in axfr filter response");