From: Vsevolod Stakhov Date: Wed, 11 Apr 2018 08:09:17 +0000 (+0100) Subject: [Minor] Add fool protection for nested section in ucl X-Git-Tag: 1.7.4~108 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=88d41f65cb9b1386dec4baace210841667492f0e;p=rspamd.git [Minor] Add fool protection for nested section in ucl --- diff --git a/lualib/lua_cfg_transform.lua b/lualib/lua_cfg_transform.lua index 4dcfd8111..971b60171 100644 --- a/lualib/lua_cfg_transform.lua +++ b/lualib/lua_cfg_transform.lua @@ -287,5 +287,13 @@ return function(cfg) cfg.dkim.sign_headers = table.concat(cfg.dkim.sign_headers, ':') end + -- Try to find some obvious issues with configuration + for k,v in pairs(cfg) do + if type(v) == 'table' and v[k] and type (v[k]) == 'table' then + logger.errx('nested section: %s { %s { ... } }, it is likely a configuration error', + k, k) + end + end + return ret, cfg end