aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamadm/grep.c
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-04-25 16:36:34 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-04-25 16:36:34 +0200
commitdd6c0e555e5bbef7ec3f969e27b0d16c4f92fe8a (patch)
tree1a7187dc6dd01bdb36adc654eb7dbf52d7389c14 /src/rspamadm/grep.c
parent07f4054d92da116c8ac4ac8d7456706c319c5b38 (diff)
downloadrspamd-dd6c0e555e5bbef7ec3f969e27b0d16c4f92fe8a.tar.gz
rspamd-dd6c0e555e5bbef7ec3f969e27b0d16c4f92fe8a.zip
[Fix] Rspamadm grep: Disable Lua patterns in string search by default
Diffstat (limited to 'src/rspamadm/grep.c')
-rw-r--r--src/rspamadm/grep.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rspamadm/grep.c b/src/rspamadm/grep.c
index b88347a8b..9665b40e8 100644
--- a/src/rspamadm/grep.c
+++ b/src/rspamadm/grep.c
@@ -25,6 +25,7 @@ static gchar **inputs = NULL;
static gboolean sensitive = FALSE;
static gboolean orphans = FALSE;
static gboolean partial = FALSE;
+static gboolean luapat = FALSE;
static void rspamadm_grep (gint argc, gchar **argv);
static const char *rspamadm_grep_help (gboolean full_help);
@@ -39,6 +40,8 @@ struct rspamadm_command grep_command = {
static GOptionEntry entries[] = {
{"string", 's', 0, G_OPTION_ARG_STRING, &string,
"Plain string to search (case-insensitive)", NULL},
+ {"lua", 'l', 0, G_OPTION_ARG_NONE, &luapat,
+ "Use Lua patterns in string search", NULL},
{"pattern", 'p', 0, G_OPTION_ARG_STRING, &pattern,
"Pattern to search for (regex)", NULL},
{"input", 'i', 0, G_OPTION_ARG_STRING_ARRAY, &inputs,
@@ -63,6 +66,7 @@ rspamadm_grep_help (gboolean full_help)
"Usage: rspamadm grep <-s string | -p pattern> [-i input1 -i input2 -S -o -P]\n"
"Where options are:\n\n"
"-s: Plain string to search (case-insensitive)\n"
+ "-l: Use Lua patterns in string search\n"
"-p: Pattern to search for (regex)\n"
"-i: Process specified inputs (stdin if unspecified)\n"
"-S: Enable case-sensitivity in string search\n"
@@ -137,6 +141,8 @@ rspamadm_grep (gint argc, gchar **argv)
"orphans", 0, false);
ucl_object_insert_key (obj, ucl_object_frombool (partial),
"partial", 0, false);
+ ucl_object_insert_key (obj, ucl_object_frombool (luapat),
+ "luapat", 0, false);
rspamadm_execute_lua_ucl_subr (L,
argc,