]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
log: can use a file set from env variable
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 27 May 2019 15:00:05 +0000 (17:00 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 14 Feb 2020 09:09:21 +0000 (10:09 +0100)
Enables the redirection of log to a file set by an environment
variable SC_LOG_FILE when SC_LOG_OP_IFACE=file

src/util-debug.c

index 4dbf1427a4482646479fb5ca6c8d765660bb5a59..a43ed2c884db8dbf7e29d7d75912d4e3e99674ba 100644 (file)
@@ -707,7 +707,7 @@ static inline SCLogOPIfaceCtx *SCLogInitFileOPIface(const char *file,
         exit(EXIT_FAILURE);
     }
 
-    if (file == NULL || log_format == NULL) {
+    if (file == NULL) {
         goto error;
     }
 
@@ -723,7 +723,7 @@ static inline SCLogOPIfaceCtx *SCLogInitFileOPIface(const char *file,
         goto error;
     }
 
-    if ((iface_ctx->log_format = SCStrdup(log_format)) == NULL) {
+    if (log_format != NULL && (iface_ctx->log_format = SCStrdup(log_format)) == NULL) {
         goto error;
     }