]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fixes to regexp selectors
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 17 Sep 2018 10:51:10 +0000 (11:51 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 17 Sep 2018 10:51:10 +0000 (11:51 +0100)
src/libmime/mime_expressions.c
src/libserver/re_cache.c
src/lua/lua_config.c

index bbbdaff044be90f9c9cdbfaa4ab42c95f7ca634a..596d959c6e25680ea798d14dc800601caace47c9 100644 (file)
@@ -690,7 +690,7 @@ rspamd_mime_expr_parse (const gchar *line, gsize len,
                                state = in_flags_brace;
                                p ++;
                        }
-                       else if (!g_ascii_isalpha (t)) {
+                       else if (!g_ascii_isalpha (t) && t != '$') {
                                state = end_atom;
                        }
                        else {
index c438b6c618195a16e8e4206b22ad9c63cd5e3e9c..707d220ce1bc45b984df87432519b767c97f155b 100644 (file)
@@ -831,7 +831,7 @@ rspamd_re_cache_process_selector (struct rspamd_task *task,
        lua_pushcfunction (L, &rspamd_lua_traceback);
        err_idx = lua_gettop (L);
 
-       lua_pushvalue (L, ref);
+       lua_rawgeti (L, LUA_REGISTRYINDEX, ref);
        ptask = lua_newuserdata (L, sizeof (*ptask));
        *ptask = task;
        rspamd_lua_setclass (L, "rspamd{task}", -1);
index ccf6143002cd6c6c5fb75e4ec040abd42d7895a7..d72c5ff666e955ce697b383269b7f20755885c8f 100644 (file)
@@ -3673,6 +3673,10 @@ lua_config_register_re_selector (lua_State *L)
        lua_settop (L, top);
        lua_pushboolean (L, res);
 
+       if (res) {
+               msg_info_config ("registered regexp selector %s", name);
+       }
+
        return 1;
 }