aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_settings.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-07 12:02:55 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-07 12:02:55 +0100
commitf3bcd7d1b7fcccb3de4a3857dfd3d70229b81eca (patch)
tree95265a05d3845784afdb482979368aa29417edf1 /lualib/lua_settings.lua
parente22f70c0cc84dcab2b9dec437c258e8bbd907f5c (diff)
downloadrspamd-f3bcd7d1b7fcccb3de4a3857dfd3d70229b81eca.tar.gz
rspamd-f3bcd7d1b7fcccb3de4a3857dfd3d70229b81eca.zip
[Minor] Do not return raw tables as they might be uninitialized
Diffstat (limited to 'lualib/lua_settings.lua')
-rw-r--r--lualib/lua_settings.lua21
1 files changed, 18 insertions, 3 deletions
diff --git a/lualib/lua_settings.lua b/lualib/lua_settings.lua
index fb1a70217..67a33bb58 100644
--- a/lualib/lua_settings.lua
+++ b/lualib/lua_settings.lua
@@ -211,9 +211,24 @@ end
exports.settings_by_id = settings_by_id
-exports.all_settings = known_ids
-exports.all_symbols = all_symbols
+exports.all_settings = function()
+ if not post_init_performed then
+ register_settings_cb()
+ end
+ return known_ids
+end
+exports.all_symbols = function()
+ if not post_init_performed then
+ register_settings_cb()
+ end
+ return all_symbols
+end
-- What is enabled when no settings are there
-exports.default_symbols = default_symbols
+exports.default_symbols = function()
+ if not post_init_performed then
+ register_settings_cb()
+ end
+ return default_symbols
+end
return exports \ No newline at end of file