commit d68a5f4: [Fix] lua_scanners - fix luacheck
Carsten Rosenberg
c.rosenberg at heinlein-support.de
Thu Jan 17 15:07:17 UTC 2019
Author: Carsten Rosenberg
Date: 2019-01-13 16:05:13 +0100
URL: https://github.com/rspamd/rspamd/commit/d68a5f42a33d8830d268c2cc581469fa0381fa6c
[Fix] lua_scanners - fix luacheck
---
lualib/lua_scanners/common.lua | 2 +-
lualib/lua_scanners/oletools.lua | 1 -
lualib/lua_scanners/sophos.lua | 4 ++--
src/plugins/lua/antivirus.lua | 3 +--
src/plugins/lua/external_services.lua | 6 +++---
5 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/lualib/lua_scanners/common.lua b/lualib/lua_scanners/common.lua
index 1fe82fabb..43400c375 100644
--- a/lualib/lua_scanners/common.lua
+++ b/lualib/lua_scanners/common.lua
@@ -180,7 +180,7 @@ local function save_av_cache(task, digest, rule, to_save, dyn_weight)
return false
end
-local function create_regex_table(task, patterns)
+local function create_regex_table(patterns)
local regex_table = {}
if patterns[1] then
for i, p in ipairs(patterns) do
diff --git a/lualib/lua_scanners/oletools.lua b/lualib/lua_scanners/oletools.lua
index fd2775775..814fe368e 100644
--- a/lualib/lua_scanners/oletools.lua
+++ b/lualib/lua_scanners/oletools.lua
@@ -27,7 +27,6 @@ local upstream_list = require "rspamd_upstream_list"
local rspamd_logger = require "rspamd_logger"
local ucl = require "ucl"
local common = require "lua_scanners/common"
-local fun = require "fun"
local module_name = 'oletools'
diff --git a/lualib/lua_scanners/sophos.lua b/lualib/lua_scanners/sophos.lua
index 0f874e756..d0297fa97 100644
--- a/lualib/lua_scanners/sophos.lua
+++ b/lualib/lua_scanners/sophos.lua
@@ -129,9 +129,9 @@ local function sophos_check(task, content, digest, rule)
else
if string.find(data, 'DONE OK') then
if rule['log_clean'] then
- rspamd_logger.infox(task, '%s [%s]: message or mime_part is clean', rule['symbol'], rule['type'])
+ rspamd_logger.infox(task, '%s: message or mime_part is clean', rule.log_prefix)
else
- lua_util.debugm(rule.module_name, task, '%s [%s]: message or mime_part is clean', rule['symbol'], rule['type'])
+ lua_util.debugm(rule.module_name, task, '%s: message or mime_part is clean', rule.log_prefix)
end
common.save_av_cache(task, digest, rule, 'OK')
-- not finished - continue
diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua
index 0515e3376..5ce6dfe06 100644
--- a/src/plugins/lua/antivirus.lua
+++ b/src/plugins/lua/antivirus.lua
@@ -15,7 +15,6 @@ limitations under the License.
]] --
local rspamd_logger = require "rspamd_logger"
-local rspamd_regexp = require "rspamd_regexp"
local lua_util = require "lua_util"
local fun = require "fun"
local lua_antivirus = require("lua_scanners").filter('antivirus')
@@ -108,7 +107,7 @@ local function add_antivirus_rule(sym, opts)
return nil
end
- rule.patterns = common.create_regex_table(task, opts.patterns or {})
+ rule.patterns = common.create_regex_table(opts.patterns or {})
if opts['whitelist'] then
rule['whitelist'] = rspamd_config:add_hash_map(opts['whitelist'])
diff --git a/src/plugins/lua/external_services.lua b/src/plugins/lua/external_services.lua
index 038142da5..fb7aef709 100644
--- a/src/plugins/lua/external_services.lua
+++ b/src/plugins/lua/external_services.lua
@@ -147,11 +147,11 @@ local function add_scanner_rule(sym, opts)
rule.scan_all_mime_parts = false
end
- rule.patterns = common.create_regex_table(task, opts.patterns or {})
+ rule.patterns = common.create_regex_table(opts.patterns or {})
- rule.mime_parts_filter_regex = common.create_regex_table(task, opts.mime_parts_filter_regex or {})
+ rule.mime_parts_filter_regex = common.create_regex_table(opts.mime_parts_filter_regex or {})
- rule.mime_parts_filter_ext = common.create_regex_table(task, opts.mime_parts_filter_ext or {})
+ rule.mime_parts_filter_ext = common.create_regex_table(opts.mime_parts_filter_ext or {})
if opts['whitelist'] then
rule['whitelist'] = rspamd_config:add_hash_map(opts['whitelist'])
More information about the Commits
mailing list