commit 1c3e091: [Minor] Arc: Improve failure logging

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Sep 25 19:42:08 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-09-25 20:39:48 +0100
URL: https://github.com/rspamd/rspamd/commit/1c3e0910b3da049dd95b3083b88469b56d83f439 (HEAD -> master)

[Minor] Arc: Improve failure logging

---
 src/plugins/lua/arc.lua | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua
index dc10476d7..9811e4357 100644
--- a/src/plugins/lua/arc.lua
+++ b/src/plugins/lua/arc.lua
@@ -131,15 +131,17 @@ end
 local function arc_validate_seals(task, seals, sigs, seal_headers, sig_headers)
   for i = 1,#seals do
     if (sigs[i].i or 0) ~= i then
-      rspamd_logger.infox(task, 'bad i value for signature: %s, expected %s',
-        sigs[i].i, i)
-      task:insert_result(arc_symbols['invalid'], 1.0, 'invalid count of seals and signatures')
+      local fail_reason = string.format('bad i for signature: %d, expected %d; d=%s',
+          sigs[i].i, i, sigs[i].d)
+      rspamd_logger.infox(task, fail_reason)
+      task:insert_result(arc_symbols['invalid'], 1.0, fail_reason)
       return false
     end
     if (seals[i].i or 0) ~= i then
-      rspamd_logger.infox(task, 'bad i value for seal: %s, expected %s',
-        seals[i].i, i)
-      task:insert_result(arc_symbols['invalid'], 1.0, 'invalid count of seals and signatures')
+      local fail_reason = string.format('bad i for seal: %d, expected %d; d=%s',
+          seals[i].i, i, seals[i].d)
+      rspamd_logger.infox(task, fail_reason)
+      task:insert_result(arc_symbols['invalid'], 1.0,fail_reason)
       return false
     end
 


More information about the Commits mailing list