comparison mod_firewall/conditions.lib.lua @ 2577:00cef058df8d

mod_firewall: TO/FROM ADMIN OF: Fix string quoting
author Matthew Wild <mwild1@gmail.com>
date Sat, 25 Feb 2017 16:53:45 +0000
parents 214b49d05ea1
children ac3140cd89a2
comparison
equal deleted inserted replaced
2576:95b79d515a65 2577:00cef058df8d
154 function condition_handlers.TO_GROUP(group_name) 154 function condition_handlers.TO_GROUP(group_name)
155 return ("group_contains(%q, bare_to)"):format(group_name), { "group_contains", "bare_to" }; 155 return ("group_contains(%q, bare_to)"):format(group_name), { "group_contains", "bare_to" };
156 end 156 end
157 157
158 function condition_handlers.FROM_ADMIN_OF(host) 158 function condition_handlers.FROM_ADMIN_OF(host)
159 return ("is_admin(bare_from, %s)"):format(host ~= "*" and host or nil), { "is_admin", "bare_from" }; 159 return ("is_admin(bare_from, %s)"):format(host ~= "*" and metaq(host) or nil), { "is_admin", "bare_from" };
160 end 160 end
161 161
162 function condition_handlers.TO_ADMIN_OF(host) 162 function condition_handlers.TO_ADMIN_OF(host)
163 return ("is_admin(bare_to, %s)"):format(host ~= "*" and host or nil), { "is_admin", "bare_to" }; 163 return ("is_admin(bare_to, %s)"):format(host ~= "*" and metaq(host) or nil), { "is_admin", "bare_to" };
164 end 164 end
165 165
166 function condition_handlers.FROM_ADMIN() 166 function condition_handlers.FROM_ADMIN()
167 return ("is_admin(bare_from, current_host)"), { "is_admin", "bare_from", "current_host" }; 167 return ("is_admin(bare_from, current_host)"), { "is_admin", "bare_from", "current_host" };
168 end 168 end