From: Pieter Lexis Date: Fri, 2 Sep 2016 11:49:27 +0000 (+0200) Subject: Rec: Don't validate when a Lua hook took the query X-Git-Tag: dnsdist-1.1.0-beta2~152^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ca4e7351e75e602644eb5504246f7ba446b6b73;p=pdns Rec: Don't validate when a Lua hook took the query This was in place for prequery, but not for nodata and the others. Thanks to @ZaphodB for the report. Fixes #4397 --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index edac59f6b..378e22a57 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -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