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;
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");
const gchar *condition);
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);
+
struct memory_pool_s * rspamd_lua_check_mempool (lua_State * L);