aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamadm/rspamadm.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-26 10:39:50 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-26 10:39:50 +0100
commita2b1d168f51e41ae0b459cd677956aa25ed7fa1b (patch)
treeb81d796eb0e93f8b4a628a47853590b0f06d1201 /src/rspamadm/rspamadm.c
parent674d8a69a808669b540ba5452e707af67ca7f7c8 (diff)
downloadrspamd-a2b1d168f51e41ae0b459cd677956aa25ed7fa1b.tar.gz
rspamd-a2b1d168f51e41ae0b459cd677956aa25ed7fa1b.zip
[Minor] Fix rspamadm configdump -m
Diffstat (limited to 'src/rspamadm/rspamadm.c')
-rw-r--r--src/rspamadm/rspamadm.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/rspamadm/rspamadm.c b/src/rspamadm/rspamadm.c
index 2e5359133..45a9171ed 100644
--- a/src/rspamadm/rspamadm.c
+++ b/src/rspamadm/rspamadm.c
@@ -206,7 +206,9 @@ rspamadm_parse_ucl_var (const gchar *option_name,
gboolean
rspamadm_execute_lua_ucl_subr (gpointer pL, gint argc, gchar **argv,
- const ucl_object_t *res, const gchar *script_name)
+ const ucl_object_t *res,
+ const gchar *script_name,
+ gboolean rspamadm_subcommand)
{
lua_State *L = pL;
gint err_idx, i, ret;
@@ -219,8 +221,14 @@ rspamadm_execute_lua_ucl_subr (gpointer pL, gint argc, gchar **argv,
/* Init internal rspamadm routines */
- rspamd_snprintf (str, sizeof (str), "return require \"%s.%s\"", "rspamadm",
- script_name);
+ if (rspamadm_subcommand) {
+ rspamd_snprintf (str, sizeof (str), "return require \"%s.%s\"", "rspamadm",
+ script_name);
+ }
+ else {
+ rspamd_snprintf (str, sizeof (str), "return require \"%s\"",
+ script_name);
+ }
if (luaL_dostring (L, str) != 0) {
msg_err ("cannot execute lua script %s: %s",