diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-09-01 14:37:44 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-09-01 14:37:44 +0100 |
commit | 8d7e8ec7590cd4f25626f788827f71e51b7777f2 (patch) | |
tree | fb84359d6f1867089cd0ad38646cc79b33b31b3a /src/libserver/cfg_rcl.c | |
parent | fe132d0fcade211ba349dc82e9aa93cc42468a20 (diff) | |
download | rspamd-8d7e8ec7590cd4f25626f788827f71e51b7777f2.tar.gz rspamd-8d7e8ec7590cd4f25626f788827f71e51b7777f2.zip |
Fix modules defined by direct path.
Diffstat (limited to 'src/libserver/cfg_rcl.c')
-rw-r--r-- | src/libserver/cfg_rcl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index ec6e1f7eb..d549b2579 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -808,6 +808,15 @@ rspamd_rcl_add_module_path (struct rspamd_config *cfg, cur_mod = rspamd_mempool_alloc (cfg->cfg_pool, sizeof (struct script_module)); cur_mod->path = rspamd_mempool_strdup (cfg->cfg_pool, path); + cur_mod->name = g_path_get_basename (cur_mod->path); + rspamd_mempool_add_destructor (cfg->cfg_pool, g_free, + cur_mod->name); + ext_pos = strstr (cur_mod->name, ".lua"); + + if (ext_pos != NULL) { + *ext_pos = '\0'; + } + cfg->script_modules = g_list_prepend (cfg->script_modules, cur_mod); } |