Comparison

mod_firewall/conditions.lib.lua @ 2552:18b6a55dd5d6

mod_firewall: Support expressions in TO/FROM EXACTLY
author Matthew Wild <mwild1@gmail.com>
date Thu, 23 Feb 2017 14:05:39 +0000
parent 2545:9b46d24edf0d
child 2553:7ed2a66bfabd
comparison
equal deleted inserted replaced
2551:9392f45b0364 2552:18b6a55dd5d6
64 function condition_handlers.FROM(from) 64 function condition_handlers.FROM(from)
65 return compile_jid_match("from", from), { "split_from" }; 65 return compile_jid_match("from", from), { "split_from" };
66 end 66 end
67 67
68 function condition_handlers.FROM_EXACTLY(from) 68 function condition_handlers.FROM_EXACTLY(from)
69 return ("from == %q"):format(from), { "from" }; 69 local metadeps = {};
70 return ("from == %s"):format(metaq(from, metadeps)), { "from", unpack(metadeps) };
70 end 71 end
71 72
72 function condition_handlers.TO_EXACTLY(to) 73 function condition_handlers.TO_EXACTLY(to)
73 return ("to == %q"):format(to), { "to" }; 74 local metadeps = {};
75 return ("to == %s"):format(metaq(to, metadeps)), { "to", unpack(metadeps) };
74 end 76 end
75 77
76 function condition_handlers.TO_SELF() 78 function condition_handlers.TO_SELF()
77 return ("to == nil"); 79 return ("to == nil");
78 end 80 end