Software /
code /
prosody-modules
Diff
mod_firewall/mod_firewall.lua @ 2364:17d236129118
mod_firewall: Allow implicit defitions of chains in scripts if they begin with 'user/'
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 15 Nov 2016 14:58:43 +0000 |
parent | 2342:6848297cf40a |
child | 2365:05dae9adf778 |
line wrap: on
line diff
--- 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