aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-03-13 11:00:47 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-03-13 11:00:47 +0000
commit9d8a5db7faecaa395fcd7d471ef65b39685bd625 (patch)
treee5d820fb3e922e38f232f34ef8f9908949862795
parente2d44157b31eff46aeb1645b73e5b576b5afa897 (diff)
downloadrspamd-9d8a5db7faecaa395fcd7d471ef65b39685bd625.tar.gz
rspamd-9d8a5db7faecaa395fcd7d471ef65b39685bd625.zip
[Fix] Lua_maps: Fix adjustments for the map type in the complex map definitions
-rw-r--r--lualib/lua_maps.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/lualib/lua_maps.lua b/lualib/lua_maps.lua
index 77aa298e5..a3dc88053 100644
--- a/lualib/lua_maps.lua
+++ b/lualib/lua_maps.lua
@@ -153,6 +153,20 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
end
if opt[1] then
+ -- Adjust each element if needed
+ local adjusted
+ for i,source in ipairs(opt) do
+ local nsrc,ntype = maybe_adjust_type(source, mtype)
+
+ if mtype ~= ntype then
+ if not adjusted then
+ mtype = ntype
+ end
+ adjusted = true
+ end
+ opt[i] = nsrc
+ end
+
if mtype == 'radix' then
if string.find(opt[1], '^%d') then