From: Vsevolod Stakhov Date: Tue, 29 May 2018 11:00:51 +0000 (+0100) Subject: [Minor] Fix minor issues X-Git-Tag: 1.7.6~92 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b8354b5a5790da9afc1a7c5025584cbcde9baef8;p=rspamd.git [Minor] Fix minor issues --- 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;