diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-09-02 10:51:59 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-09-02 10:52:52 +0100 |
commit | ed6360a904f8082f4048332640e5f09ca9989854 (patch) | |
tree | b1e59defc315c22741585cff830ffeaf8856d19f /src | |
parent | de4305c11aa610b1dd1db49264fb511870c4bb0a (diff) | |
download | rspamd-ed6360a904f8082f4048332640e5f09ca9989854.tar.gz rspamd-ed6360a904f8082f4048332640e5f09ca9989854.zip |
[Minor] Explicitly disallow to set settings on top of other settings
Diffstat (limited to 'src')
-rw-r--r-- | src/lua/lua_task.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index eabbb2609..b095de8e7 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -5661,6 +5661,13 @@ lua_task_set_settings (lua_State *L) if (settings != NULL && task != NULL) { + if (task->settings) { + /* Do not allow to set settings on top of the existing ones */ + ucl_object_unref (settings); + + return luaL_error (L, "invalid invocation: settings has been already set"); + } + metric_elt = ucl_object_lookup (settings, DEFAULT_METRIC); if (metric_elt) { |