diff options
-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); } |