Software /
code /
prosody-modules
Comparison
mod_firewall/mod_firewall.lua @ 2101:41a0a9db89ef
mod_firewall: Allow actions to have underscores in their names
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 17 Mar 2016 11:22:49 +0000 |
parent | 2100:cbd0095e9302 |
child | 2113:d75145297bf9 |
comparison
equal
deleted
inserted
replaced
2100:cbd0095e9302 | 2101:41a0a9db89ef |
---|---|
219 -- This is a standalone action with no conditions | 219 -- This is a standalone action with no conditions |
220 rule = new_rule(ruleset, chain); | 220 rule = new_rule(ruleset, chain); |
221 end | 221 end |
222 state = "actions"; | 222 state = "actions"; |
223 -- Action handlers? | 223 -- Action handlers? |
224 local action = line:match("^%P+"); | 224 local action = line:match("^[%w_]+"); |
225 if not action_handlers[action] then | 225 if not action_handlers[action] then |
226 return nil, ("Unknown action on line %d: %s"):format(line_no, action or "<unknown>"); | 226 return nil, ("Unknown action on line %d: %s"):format(line_no, action or "<unknown>"); |
227 end | 227 end |
228 table.insert(rule.actions, "-- "..line) | 228 table.insert(rule.actions, "-- "..line) |
229 local ok, action_string, action_deps = pcall(action_handlers[action], line:match("=(.+)$")); | 229 local ok, action_string, action_deps = pcall(action_handlers[action], line:match("=(.+)$")); |