commit 2fe3002: [Minor] Improve logging logic

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Feb 4 20:49:04 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-02-04 20:42:31 +0000
URL: https://github.com/rspamd/rspamd/commit/2fe30027a9f30877bb108e887ac74cbbb4a3fe95 (HEAD -> master)

[Minor] Improve logging logic

---
 src/libmime/archives.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/libmime/archives.c b/src/libmime/archives.c
index 1673c24b4..45fca12f2 100644
--- a/src/libmime/archives.c
+++ b/src/libmime/archives.c
@@ -146,11 +146,14 @@ rspamd_archive_file_try_utf (struct rspamd_task *task,
 			}
 			else {
 				g_string_append_c (res, '?');
-				msg_info_task("non graph character in archive file name found: 0x%02xd "
-							  "(filename=%T)", (int)*p, arch->archive_name);
 
 				if (*p < 0x7f && (g_ascii_iscntrl(*p) || *p == '\0')) {
-					fentry->flags |= RSPAMD_ARCHIVE_FILE_OBFUSCATED;
+					if (!(fentry->flags & RSPAMD_ARCHIVE_FILE_OBFUSCATED)) {
+						msg_info_task("suspicious character in archive file name found: 0x%02xd "
+									  "(filename=%T)",
+									  (int) *p, arch->archive_name);
+						fentry->flags |= RSPAMD_ARCHIVE_FILE_OBFUSCATED;
+					}
 				}
 			}
 


More information about the Commits mailing list