From: Victor Julien Date: Sat, 9 Apr 2022 15:24:33 +0000 (+0200) Subject: eve: allow /dev/null in threaded mode X-Git-Tag: suricata-7.0.0-beta1~763 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7225%2Fhead;p=thirdparty%2Fsuricata.git eve: allow /dev/null in threaded mode Avoids creation of actual files called /dev/null.N which take up space in /dev/ which lives in memory. --- diff --git a/src/util-logopenfile.c b/src/util-logopenfile.c index 90626aad51..84c1bc2cc8 100644 --- a/src/util-logopenfile.c +++ b/src/util-logopenfile.c @@ -711,6 +711,11 @@ LogFileCtx *LogFileEnsureExists(LogFileCtx *parent_ctx, int thread_id) static bool LogFileThreadedName( const char *original_name, char *threaded_name, size_t len, uint32_t unique_id) { + if (strcmp("/dev/null", original_name) == 0) { + strlcpy(threaded_name, original_name, len); + return true; + } + const char *base = SCBasename(original_name); if (!base) { FatalError(SC_ERR_FATAL,