Skip to content

Commit

Permalink
output/log: Remove extraneous error message
Browse files Browse the repository at this point in the history
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 d853972)
  • Loading branch information
jlucovsky committed Jan 10, 2025
1 parent 78c555b commit a7ce3d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util-logopenfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a7ce3d4

Please sign in to comment.