]> granicus.if.org Git - pdns/commitdiff
Rec: Don't validate when a Lua hook took the query
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 2 Sep 2016 11:49:27 +0000 (13:49 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 2 Sep 2016 11:49:27 +0000 (13:49 +0200)
This was in place for prequery, but not for nodata and the others.
Thanks to @ZaphodB for the report.

Fixes #4397

pdns/pdns_recursor.cc

index edac59f6bc18e26d934c2a2ae4b8b4274edb7b68..378e22a572d5ab5cb1705dcca19ddfb4161242a3 100644 (file)
@@ -859,14 +859,15 @@ void startDoResolve(void *p)
                 for(; i!= ret.cend(); ++i)
                   if(i->d_type == dc->d_mdp.d_qtype && i->d_place == DNSResourceRecord::ANSWER)
                           break;
-                if(i == ret.cend())
-                  (*t_pdl)->nodata(dc->d_remote, dc->d_local, dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), dc->d_tcp, ret, res, &variableAnswer);
+                if(i == ret.cend() && (*t_pdl)->nodata(dc->d_remote, dc->d_local, dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), dc->d_tcp, ret, res, &variableAnswer))
+                  shouldNotValidate = true;
+
        }
-       else if(res == RCode::NXDomain)
-         (*t_pdl)->nxdomain(dc->d_remote, dc->d_local, dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), dc->d_tcp, ret, res, &variableAnswer);
-       
+       else if(res == RCode::NXDomain && (*t_pdl)->nxdomain(dc->d_remote, dc->d_local, dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), dc->d_tcp, ret, res, &variableAnswer))
+          shouldNotValidate = true;
 
-       (*t_pdl)->postresolve(dc->d_remote, dc->d_local, dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), dc->d_tcp, ret, &appliedPolicy, &dc->d_policyTags, res, &variableAnswer);
+       if((*t_pdl)->postresolve(dc->d_remote, dc->d_local, dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), dc->d_tcp, ret, &appliedPolicy, &dc->d_policyTags, res, &variableAnswer))
+          shouldNotValidate = true;
       }
 
       if (wantsRPZ) { //XXX This block is repeated, see above