mod_firewall: Allow implicit defitions of chains in scripts if they begin with 'user/'
--- a/mod_firewall/mod_firewall.lua Tue Nov 15 14:58:16 2016 +0000
+++ b/mod_firewall/mod_firewall.lua Tue Nov 15 14:58:43 2016 +0000
@@ -217,7 +217,11 @@
chain = line:gsub("^::%s*", "");
local chain_info = chains[chain];
if not chain_info then
- return nil, errmsg("Unknown chain: "..chain);
+ if chain:match("^user/") then
+ chains[chain] = { type = "event", priority = 1, "firewall/chains/"..chain };
+ else
+ return nil, errmsg("Unknown chain: "..chain);
+ end
elseif chain_info.type ~= "event" then
return nil, errmsg("Only event chains supported at the moment");
end