]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Set lua cpath to RSPAMD_LIBDIR, not LUALIBDIR
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 21 Jul 2017 10:14:25 +0000 (11:14 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 21 Jul 2017 10:41:06 +0000 (11:41 +0100)
config.h.in
src/lua/lua_common.c

index 35293858b41568ec9c21dee6c4d2a46e93acdcf4..2b9773aeac4f82280c8e109f5a9991a4be396cdc 100644 (file)
 #define RSPAMD_RULESDIR "${RULESDIR}"
 #define RSPAMD_WWWDIR "${WWWDIR}"
 #define RSPAMD_PREFIX "${CMAKE_INSTALL_PREFIX}"
+#define RSPAMD_LIBDIR "${RSPAMD_LIBDIR}"
 
 #define RSPAMD_VERSION_MAJOR "${RSPAMD_VERSION_MAJOR}"
 #define RSPAMD_VERSION_MINOR "${RSPAMD_VERSION_MINOR}"
index 2fde26a3178734e78854d3e4821025ca5e791ece..38b6ee81b4c582a6ec98126a27005d52a68bcada 100644 (file)
@@ -208,7 +208,8 @@ rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg, GHashTable *vars)
        const ucl_object_t *opts;
        const gchar *pluginsdir = RSPAMD_PLUGINSDIR,
                        *rulesdir = RSPAMD_RULESDIR,
-                       *lualibdir = RSPAMD_LUALIBDIR;
+                       *lualibdir = RSPAMD_LUALIBDIR,
+                       *libdir = RSPAMD_LIBDIR;
 
        gchar path_buf[PATH_MAX];
 
@@ -249,6 +250,16 @@ rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg, GHashTable *vars)
                if (t) {
                        lualibdir = t;
                }
+
+               t = g_hash_table_lookup (vars, "LIBDIR");
+               if (t) {
+                       libdir = t;
+               }
+
+               t = g_hash_table_lookup (vars, "RSPAMD_LIBDIR");
+               if (t) {
+                       libdir = t;
+               }
        }
 
        if (additional_path) {
@@ -288,7 +299,7 @@ rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg, GHashTable *vars)
        rspamd_snprintf (path_buf, sizeof (path_buf),
                                        "%s/?.so;"
                                        "%s",
-                       lualibdir,
+                       libdir,
                        old_path);
        lua_pop (L, 1);
        lua_pushstring (L, path_buf);