From 0022e5ed46e1c4e277a08a0bf6011c92f1243edc Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Fri, 22 Jul 2016 21:14:47 +0200 Subject: [PATCH] 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"; --- pdns/rec-lua-conf.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdns/rec-lua-conf.cc b/pdns/rec-lua-conf.cc index 8150f84574..c362f5276a 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"<