comparison mod_firewall/definitions.lib.lua @ 2535:b85d88737a32

mod_firewall: Fix file backend init code
author Matthew Wild <mwild1@gmail.com>
date Mon, 20 Feb 2017 13:13:28 +0000
parents 2ddb74805f91
children 22a271641c29
comparison
equal deleted inserted replaced
2534:13b8c31dce01 2535:b85d88737a32
138 end 138 end
139 return self.items and self.items[item] == true; 139 return self.items and self.items[item] == true;
140 end; 140 end;
141 }; 141 };
142 file = { 142 file = {
143 init = function (list_backend, file_spec, opts) 143 init = function (self, file_spec, opts)
144 local filename = file_spec:gsub("^file:"); 144 local filename = file_spec:gsub("^file:", "");
145 local file, err = io.open(filename); 145 local file, err = io.open(filename);
146 if not file then 146 if not file then
147 module:log("warn", "Failed to open list from %s: %s", filename, err); 147 module:log("warn", "Failed to open list from %s: %s", filename, err);
148 return; 148 return;
149 end 149 end