aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-17 12:55:51 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-17 12:55:51 +0000
commit77d65b7266828dccdec909d352f2c1238e970e4b (patch)
tree202b66617fb28e6da04db5e58f9e8e7b39286451 /src/lua/lua_common.c
parentf3addee53d27e0ed9ddeab5e5215378ba951baa7 (diff)
downloadrspamd-77d65b7266828dccdec909d352f2c1238e970e4b.tar.gz
rspamd-77d65b7266828dccdec909d352f2c1238e970e4b.zip
Set lua path for lua configuration.
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r--src/lua/lua_common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index cb5f07712..ffba71754 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -281,7 +281,7 @@ lua_add_actions_global (lua_State *L)
lua_setglobal (L, "rspamd_actions");
}
-static void
+void
rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg)
{
const gchar *old_path, *additional_path = NULL;
@@ -292,6 +292,11 @@ rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg)
lua_getfield (L, -1, "path");
old_path = luaL_checkstring (L, -1);
+ if (strstr (old_path, RSPAMD_PLUGINSDIR) != NULL) {
+ /* Path has been already set, do not touch it */
+ return;
+ }
+
opts = ucl_object_find_key (cfg->rcl_obj, "options");
if (opts != NULL) {
opts = ucl_object_find_key (opts, "lua_path");