diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-06-12 15:59:12 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-06-12 15:59:12 +0100 |
commit | 2be05d7af71ac14a9f515254185e16522310b5ad (patch) | |
tree | fabc302d8a0e7218eb5a713f25f2a75535ed5dbb /src/lua/lua_cfg_file.c | |
parent | c3fa4244878d79e1e679622394146f6f0c593a5b (diff) | |
download | rspamd-2be05d7af71ac14a9f515254185e16522310b5ad.tar.gz rspamd-2be05d7af71ac14a9f515254185e16522310b5ad.zip |
Export rspamd paths to lua.
Diffstat (limited to 'src/lua/lua_cfg_file.c')
-rw-r--r-- | src/lua/lua_cfg_file.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lua/lua_cfg_file.c b/src/lua/lua_cfg_file.c index 63728a004..b23ba10f8 100644 --- a/src/lua/lua_cfg_file.c +++ b/src/lua/lua_cfg_file.c @@ -481,6 +481,14 @@ lua_check_condition (struct config_file *cfg, const gchar *condition) lua_pushstring (L, ""); lua_setglobal (L, "osrelease"); #endif + + /* Rspamd paths */ + lua_newtable (L); + lua_set_table_index (L, "etcdir", ETC_PREFIX); + lua_set_table_index (L, "prefix", CMAKE_PREFIX); + lua_set_table_index (L, "localstatesdir", LOCALSTATES_PREFIX); + lua_setglobal (L, "rspamd_paths"); + /* Make fake string */ hostlen = sizeof (FAKE_RES_VAR "=") + strlen (condition); condbuf = g_malloc (hostlen); |