From: Philippe Antoine Date: Mon, 27 May 2019 15:00:05 +0000 (+0200) Subject: log: can use a file set from env variable X-Git-Tag: suricata-6.0.0-beta1~751 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12a3a24906470567a0112b61d4f8d02d9811756f;p=thirdparty%2Fsuricata.git log: can use a file set from env variable Enables the redirection of log to a file set by an environment variable SC_LOG_FILE when SC_LOG_OP_IFACE=file --- diff --git a/src/util-debug.c b/src/util-debug.c index 4dbf1427a4..a43ed2c884 100644 --- a/src/util-debug.c +++ b/src/util-debug.c @@ -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; }