comparison mod_firewall/conditions.lib.lua @ 2584:d64fc9c3cffd

mod_firewall: Remove ambiguity from tokens dep parameter
author Matthew Wild <mwild1@gmail.com>
date Sun, 26 Feb 2017 09:50:16 +0000
parents ac3140cd89a2
children 1e1c929c1aa5
comparison
equal deleted inserted replaced
2583:b6b10f57aa56 2584:d64fc9c3cffd
289 function condition_handlers.SCAN(scan_expression) 289 function condition_handlers.SCAN(scan_expression)
290 local search_name, pattern_name, list_name = scan_expression:match("(%S+) for (%S+) in (%S+)$"); 290 local search_name, pattern_name, list_name = scan_expression:match("(%S+) for (%S+) in (%S+)$");
291 if not (search_name) then 291 if not (search_name) then
292 error("Error parsing SCAN expression, syntax: SEARCH for PATTERN in LIST"); 292 error("Error parsing SCAN expression, syntax: SEARCH for PATTERN in LIST");
293 end 293 end
294 return ("scan_list(list_%s, %s)"):format(list_name, "tokens_"..search_name.."_"..pattern_name), { "scan_list", "tokens:"..search_name.."_"..pattern_name, "list:"..list_name }; 294 return ("scan_list(list_%s, %s)"):format(list_name, "tokens_"..search_name.."_"..pattern_name), { "scan_list", "tokens:"..search_name.."-"..pattern_name, "list:"..list_name };
295 end 295 end
296 296
297 local valid_comp_ops = { [">"] = ">", ["<"] = "<", ["="] = "==", ["=="] = "==", ["<="] = "<=", [">="] = ">=" }; 297 local valid_comp_ops = { [">"] = ">", ["<"] = "<", ["="] = "==", ["=="] = "==", ["<="] = "<=", [">="] = ">=" };
298 function condition_handlers.COUNT(count_expression) 298 function condition_handlers.COUNT(count_expression)
299 local pattern_name, search_name, comparator_expression = count_expression:match("(%S+) in (%S+) (.+)$"); 299 local pattern_name, search_name, comparator_expression = count_expression:match("(%S+) in (%S+) (.+)$");