# HG changeset patch # User Matthew Wild # Date 1479221923 0 # Node ID 17d236129118f83c62485721fdfb223d0058b468 # Parent 12b78170b76cd7207fe263e245577c78889a529d mod_firewall: Allow implicit defitions of chains in scripts if they begin with 'user/' diff -r 12b78170b76c -r 17d236129118 mod_firewall/mod_firewall.lua --- 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