mod_firewall/mod_firewall.lua
changeset 4586 cc20493018f6
parent 3985 7e8f2e36419d
child 4612 4e8fa75cc678
equal deleted inserted replaced
4585:3e2e708fd18b 4586:cc20493018f6
   370 			elseif chain_info.type ~= "event" then
   370 			elseif chain_info.type ~= "event" then
   371 				return nil, errmsg("Only event chains supported at the moment");
   371 				return nil, errmsg("Only event chains supported at the moment");
   372 			end
   372 			end
   373 			ruleset[chain] = ruleset[chain] or {};
   373 			ruleset[chain] = ruleset[chain] or {};
   374 		elseif not(state) and line:sub(1,1) == "%" then -- Definition (zone, limit, etc.)
   374 		elseif not(state) and line:sub(1,1) == "%" then -- Definition (zone, limit, etc.)
   375 			local what, name = line:match("^%%%s*(%w+) +([^ :]+)");
   375 			local what, name = line:match("^%%%s*([%w_]+) +([^ :]+)");
   376 			if not definition_handlers[what] then
   376 			if not definition_handlers[what] then
   377 				return nil, errmsg("Definition of unknown object: "..what);
   377 				return nil, errmsg("Definition of unknown object: "..what);
   378 			elseif not name or not idsafe(name) then
   378 			elseif not name or not idsafe(name) then
   379 				return nil, errmsg("Invalid "..what.." name");
   379 				return nil, errmsg("Invalid "..what.." name");
   380 			end
   380 			end