aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamadm/rspamadm.c
diff options
context:
space:
mode:
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",