diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-29 12:00:51 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-29 12:00:51 +0100 |
commit | b8354b5a5790da9afc1a7c5025584cbcde9baef8 (patch) | |
tree | c337f0aaa16ddd0857581a6a2693059f3b37be21 | |
parent | cb40e98e64bc5a590a59c5772d5e192b9527429d (diff) | |
download | rspamd-b8354b5a5790da9afc1a7c5025584cbcde9baef8.tar.gz rspamd-b8354b5a5790da9afc1a7c5025584cbcde9baef8.zip |
[Minor] Fix minor issues
-rw-r--r-- | lualib/plugins_stats.lua | 2 | ||||
-rw-r--r-- | lualib/rspamadm/fuzzy_stat.lua | 2 | ||||
-rw-r--r-- | src/rspamadm/commands.c | 8 |
3 files changed, 8 insertions, 4 deletions
diff --git a/lualib/plugins_stats.lua b/lualib/plugins_stats.lua index 5c9797a9e..9bbebb1c8 100644 --- a/lualib/plugins_stats.lua +++ b/lualib/plugins_stats.lua @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. ]]-- -local ansicolors = require "rspamadm/ansicolors" +local ansicolors = require "ansicolors" local function printf(fmt, ...) print(string.format(fmt, ...)) diff --git a/lualib/rspamadm/fuzzy_stat.lua b/lualib/rspamadm/fuzzy_stat.lua index 05c2622bf..20945bd4a 100644 --- a/lualib/rspamadm/fuzzy_stat.lua +++ b/lualib/rspamadm/fuzzy_stat.lua @@ -143,7 +143,7 @@ local function print_result(r) return print_num(r) end -local getopt = require "rspamadm/getopt" +local getopt = require "getopt" return function(args, res) local res_ips = {} diff --git a/src/rspamadm/commands.c b/src/rspamadm/commands.c index 2ad8b81a1..744212afb 100644 --- a/src/rspamadm/commands.c +++ b/src/rspamadm/commands.c @@ -190,13 +190,17 @@ rspamadm_fill_lua_commands (lua_State *L, GPtrArray *dest) GError *err = NULL; const gchar *lualibdir = RSPAMD_LUALIBDIR, *path; struct rspamadm_command *lua_cmd; + gchar search_dir[PATH_MAX]; if (g_hash_table_lookup (ucl_vars, "LUALIBDIR")) { lualibdir = g_hash_table_lookup (ucl_vars, "LUALIBDIR"); } - if ((lua_paths = rspamd_glob_path (lualibdir, "*.lua", FALSE, &err)) == NULL) { - msg_err ("cannot glob files in %s/*.lua: %e", lualibdir, err); + rspamd_snprintf (search_dir, sizeof (search_dir), "%s%crspamadm%c", + lualibdir, G_DIR_SEPARATOR, G_DIR_SEPARATOR); + + if ((lua_paths = rspamd_glob_path (search_dir, "*.lua", FALSE, &err)) == NULL) { + msg_err ("cannot glob files in %s/*.lua: %e", search_dir, err); g_error_free (err); return; |