diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-11-04 12:48:56 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-11-04 12:48:56 +0000 |
commit | 366b697603f8178eed4d2386973e9392bbed6cdf (patch) | |
tree | 71ddd3f703ef2b3ecb5dcf4b53063f7a5418220e /src/lua | |
parent | 533b568baf9b04a3c364c6550f19db538bc0e4c5 (diff) | |
download | rspamd-366b697603f8178eed4d2386973e9392bbed6cdf.tar.gz rspamd-366b697603f8178eed4d2386973e9392bbed6cdf.zip |
[Minor] Use pure UCL object when setting lua paths
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_common.c | 8 | ||||
-rw-r--r-- | src/lua/lua_common.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c index 3272ee254..dcdfef823 100644 --- a/src/lua/lua_common.c +++ b/src/lua/lua_common.c @@ -210,7 +210,7 @@ lua_add_actions_global (lua_State *L) } void -rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg, GHashTable *vars) +rspamd_lua_set_path (lua_State *L, const ucl_object_t *cfg_obj, GHashTable *vars) { const gchar *old_path, *additional_path = NULL; const ucl_object_t *opts; @@ -232,8 +232,8 @@ rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg, GHashTable *vars) return; } - if (cfg) { - opts = ucl_object_lookup (cfg->rcl_obj, "options"); + if (cfg_obj) { + opts = ucl_object_lookup (cfg_obj, "options"); if (opts != NULL) { opts = ucl_object_lookup (opts, "lua_path"); if (opts != NULL && ucl_object_type (opts) == UCL_STRING) { @@ -452,7 +452,7 @@ rspamd_init_lua_filters (struct rspamd_config *cfg, gboolean force_load, GString *tb; gint err_idx; - rspamd_lua_set_path (L, cfg, vars); + rspamd_lua_set_path (L, cfg->rcl_obj, vars); cur = g_list_first (cfg->script_modules); while (cur) { diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h index 82957d3a1..f67401fc2 100644 --- a/src/lua/lua_common.h +++ b/src/lua/lua_common.h @@ -280,7 +280,7 @@ gboolean rspamd_lua_check_condition (struct rspamd_config *cfg, void rspamd_lua_dumpstack (lua_State *L); /* Set lua path according to the configuration */ -void rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg, +void rspamd_lua_set_path (lua_State *L, const ucl_object_t *cfg_obj, GHashTable *vars); struct memory_pool_s * rspamd_lua_check_mempool (lua_State * L, gint pos); |