aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
parent674d8a69a808669b540ba5452e707af67ca7f7c8 (diff)
downloadrspamd-a2b1d168f51e41ae0b459cd677956aa25ed7fa1b.tar.gz
rspamd-a2b1d168f51e41ae0b459cd677956aa25ed7fa1b.zip
[Minor] Fix rspamadm configdump -m
Diffstat (limited to 'src')
-rw-r--r--src/rspamadm/configdump.c3
-rw-r--r--src/rspamadm/confighelp.c3
-rw-r--r--src/rspamadm/control.c3
-rw-r--r--src/rspamadm/fuzzy_convert.c3
-rw-r--r--src/rspamadm/rspamadm.c14
-rw-r--r--src/rspamadm/rspamadm.h3
-rw-r--r--src/rspamadm/stat_convert.c3
7 files changed, 23 insertions, 9 deletions
diff --git a/src/rspamadm/configdump.c b/src/rspamadm/configdump.c
index cd9f6d378..8e26ef0af 100644
--- a/src/rspamadm/configdump.c
+++ b/src/rspamadm/configdump.c
@@ -308,7 +308,8 @@ rspamadm_configdump (gint argc, gchar **argv, const struct rspamadm_command *cmd
argc,
argv,
cfg->rcl_obj,
- "plugins_stats");
+ "plugins_stats",
+ FALSE);
lua_close (L);
diff --git a/src/rspamadm/confighelp.c b/src/rspamadm/confighelp.c
index c77cb6091..f4c5176ac 100644
--- a/src/rspamadm/confighelp.c
+++ b/src/rspamadm/confighelp.c
@@ -110,7 +110,8 @@ rspamadm_confighelp_show (struct rspamd_config *cfg, gint argc, gchar **argv,
argc,
argv,
obj,
- "confighelp");
+ "confighelp",
+ TRUE);
rspamd_fstring_free (out);
return;
diff --git a/src/rspamadm/control.c b/src/rspamadm/control.c
index 4d7806b84..6d2849cc7 100644
--- a/src/rspamadm/control.c
+++ b/src/rspamadm/control.c
@@ -137,7 +137,8 @@ rspamd_control_finish_handler (struct rspamd_http_connection *conn,
cbdata->argc,
cbdata->argv,
obj,
- "fuzzy_stat");
+ "fuzzy_stat",
+ TRUE);
rspamd_fstring_free (out);
ucl_object_unref (obj);
diff --git a/src/rspamadm/fuzzy_convert.c b/src/rspamadm/fuzzy_convert.c
index 7671678dc..1c5620730 100644
--- a/src/rspamadm/fuzzy_convert.c
+++ b/src/rspamadm/fuzzy_convert.c
@@ -135,7 +135,8 @@ rspamadm_fuzzyconvert (gint argc, gchar **argv, const struct rspamadm_command *c
argc,
argv,
obj,
- "fuzzy_convert");
+ "fuzzy_convert",
+ TRUE);
ucl_object_unref (obj);
}
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",
diff --git a/src/rspamadm/rspamadm.h b/src/rspamadm/rspamadm.h
index 3d9799dd5..02ecb2f47 100644
--- a/src/rspamadm/rspamadm.h
+++ b/src/rspamadm/rspamadm.h
@@ -57,6 +57,7 @@ void rspamadm_fill_lua_commands (lua_State *L, GPtrArray *dest);
gboolean rspamadm_execute_lua_ucl_subr (gpointer L, gint argc, gchar **argv,
const ucl_object_t *res,
- const gchar *script_name);
+ const gchar *script_name,
+ gboolean rspamadm_subcommand);
#endif
diff --git a/src/rspamadm/stat_convert.c b/src/rspamadm/stat_convert.c
index ef17194b0..1dde4114d 100644
--- a/src/rspamadm/stat_convert.c
+++ b/src/rspamadm/stat_convert.c
@@ -251,7 +251,8 @@ rspamadm_statconvert (gint argc, gchar **argv, const struct rspamadm_command *cm
argc,
argv,
obj,
- "stat_convert");
+ "stat_convert",
+ TRUE);
ucl_object_unref (obj);
}