diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-09-17 11:51:10 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-09-17 11:51:10 +0100 |
commit | 5cd10b421b5989b118d52e399ba5b191991c506e (patch) | |
tree | 35582a1b92a8e7c2e280af14eb4efacccb976800 | |
parent | 954727f41c7ed5449206f035d4015d30b6c92f13 (diff) | |
download | rspamd-5cd10b421b5989b118d52e399ba5b191991c506e.tar.gz rspamd-5cd10b421b5989b118d52e399ba5b191991c506e.zip |
[Minor] Fixes to regexp selectors
-rw-r--r-- | src/libmime/mime_expressions.c | 2 | ||||
-rw-r--r-- | src/libserver/re_cache.c | 2 | ||||
-rw-r--r-- | src/lua/lua_config.c | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c index bbbdaff04..596d959c6 100644 --- a/src/libmime/mime_expressions.c +++ b/src/libmime/mime_expressions.c @@ -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 { diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c index c438b6c61..707d220ce 100644 --- a/src/libserver/re_cache.c +++ b/src/libserver/re_cache.c @@ -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); diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index ccf614300..d72c5ff66 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -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; } |