From: Vsevolod Stakhov Date: Thu, 11 Jun 2020 13:46:59 +0000 (+0100) Subject: [Minor] Lua_task: Log when an unknown symbol is inserted from Lua X-Git-Tag: 2.6~332 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b2d80e6066657216572090743ce45604a2e6ccb6;p=thirdparty%2Frspamd.git [Minor] Lua_task: Log when an unknown symbol is inserted from Lua --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 6437b0dada..75c2f0a998 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -1944,6 +1944,15 @@ lua_task_insert_result_common (lua_State * L, struct rspamd_scan_result *result, /* Get additional options */ if (s) { + if (s->sym == NULL) { + /* Unknown symbol, print traceback */ + lua_pushfstring (L, "unknown symbol %s", symbol_name); + rspamd_lua_traceback (L); + + msg_info_task ("symbol insertion issue: %s", lua_tostring (L, -1)); + + lua_pop (L, 1); /* Traceback string */ + } for (i = args_start + 2; i <= top; i++) { gint ltype = lua_type (L, i); @@ -2013,6 +2022,14 @@ lua_task_insert_result_common (lua_State * L, struct rspamd_scan_result *result, } } } + else { + lua_pushfstring (L, "insertion failed for %s", symbol_name); + rspamd_lua_traceback (L); + + msg_info_task ("symbol insertion issue: %s", lua_tostring (L, -1)); + + lua_pop (L, 2); /* Traceback string + error string */ + } } else {