From: Jeff Lucovsky Date: Thu, 12 Dec 2024 13:49:20 +0000 (-0500) Subject: output/log: Remove extraneous error message X-Git-Tag: suricata-7.0.9~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6c30bbf3270003aed245d8c3dcb9730df77f999;p=thirdparty%2Fsuricata.git output/log: Remove extraneous error message Issue: 7447 When the output file can't be opened, 2 error messages are displayed for the same problem. The second message doesn't add value and lacks context (error reason, e.g., "Permission denied"). Retaining the second message as a debug message. Without this commit: Error: logopenfile: Error opening file: "/home/jlucovsky/src/jal/suricata-verify/tests/bug-5198/output/noperms/eve.1.json": Permission denied [SCLogOpenFileFp:util-logopenfile.c:428] Error: logopenfile: Unable to open slot 1 for file /home/jlucovsky/src/jal/suricata-verify/tests/bug-5198/output/noperms/eve.json [LogFileEnsureExists:util-logopenfile.c:737] Error: runmodes: unable to initialize sub-module eve-log.stats [RunModeInitializeEveOutput:runmodes.c:692] With commit: Error: logopenfile: Error opening file: "/home/jlucovsky/src/jal/suricata-verify/tests/bug-5198/output/noperms/eve.1.json": Permission denied [SCLogOpenFileFp:util-logopenfile.c:428] Error: runmodes: unable to initialize sub-module eve-log.stats [RunModeInitializeEveOutput:runmodes.c:692] (cherry picked from commit d853972c744c789abbb61fa8e2fb567f4f6456ec) --- diff --git a/src/util-logopenfile.c b/src/util-logopenfile.c index 5206365bda..5f0cb01fe5 100644 --- a/src/util-logopenfile.c +++ b/src/util-logopenfile.c @@ -731,7 +731,7 @@ LogFileCtx *LogFileEnsureExists(LogFileCtx *parent_ctx) entry->isopen = true; ret_ctx = entry->ctx; } else { - SCLogError( + SCLogDebug( "Unable to open slot %d for file %s", entry->slot_number, parent_ctx->filename); (void)HashTableRemove(parent_ctx->threads->ht, entry, 0); }