diff options
author | Mikhail Galanin <mgalanin@mimecast.com> | 2018-09-21 12:24:41 +0100 |
---|---|---|
committer | Mikhail Galanin <mgalanin@mimecast.com> | 2018-09-21 12:24:41 +0100 |
commit | c7f0e214e9a11c304c71f79fd51a64c107038a91 (patch) | |
tree | 958a56246d6de998df8fc9544f1d0b147f635e3f /lualib/lua_selectors.lua | |
parent | c37939b51cc01db39717c4b6954e53b6bcb2f12f (diff) | |
download | rspamd-c7f0e214e9a11c304c71f79fd51a64c107038a91.tar.gz rspamd-c7f0e214e9a11c304c71f79fd51a64c107038a91.zip |
[Minor] Return nil if unknown processor was used
Diffstat (limited to 'lualib/lua_selectors.lua')
-rw-r--r-- | lualib/lua_selectors.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lualib/lua_selectors.lua b/lualib/lua_selectors.lua index 7de1a10d8..21efc4573 100644 --- a/lualib/lua_selectors.lua +++ b/lualib/lua_selectors.lua @@ -772,6 +772,7 @@ exports.parse_selector = function(cfg, str) lua_util.debugm(M, cfg, 'processed selector %s, args: %s', res.selector.name, res.selector.args) + local it_happened = false -- Now process processors pipe fun.each(function(proc_tbl) local proc_name = proc_tbl[1] @@ -804,6 +805,7 @@ exports.parse_selector = function(cfg, str) if not transform_function[proc_name] then logger.errx(cfg, 'processor %s is unknown', proc_name) + it_happened = true return nil end local processor = lua_util.shallowcopy(transform_function[proc_name]) @@ -815,6 +817,11 @@ exports.parse_selector = function(cfg, str) end end, fun.tail(sel)) + if it_happened then + logger.errx(cfg, 'unknown processor used, exiting') + return nil + end + table.insert(output, res) end |