From: Pieter Lexis Date: Fri, 22 Jul 2016 19:14:47 +0000 (+0200) Subject: RPZ: Always set the policy name X-Git-Tag: rec-4.0.2~1^2~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0022e5ed46e1c4e277a08a0bf6011c92f1243edc;p=pdns RPZ: Always set the policy name For slaved zones, set it to the name of the zone by default. For file-based RPZs, use "rpzFile"; --- diff --git a/pdns/rec-lua-conf.cc b/pdns/rec-lua-conf.cc index 8150f8457..c362f5276 100644 --- a/pdns/rec-lua-conf.cc +++ b/pdns/rec-lua-conf.cc @@ -92,7 +92,7 @@ void loadRecursorLuaConfig(const std::string& fname) Lua.writeFunction("rpzFile", [&lci](const string& fname, const boost::optional>>& options) { try { boost::optional defpol; - std::string polName; + std::string polName("rpzFile"); if(options) { auto& have = *options; if(have.count("policyName")) { @@ -137,9 +137,9 @@ void loadRecursorLuaConfig(const std::string& fname) ComboAddress localAddress; if(options) { auto& have = *options; - if(have.count("policyName")) { + polName = zone_; + if(have.count("policyName")) polName = boost::get(constGet(have, "policyName")); - } if(have.count("defpol")) { // cout<<"Set a default policy"<