From: Jason Ish Date: Fri, 12 Jan 2018 20:46:31 +0000 (-0600) Subject: filestore: only allow one filestore to be enabled X-Git-Tag: suricata-4.1.0-beta1~334 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa0760a8d5527510a16d1a30c4fae609870da6f2;p=thirdparty%2Fsuricata.git filestore: only allow one filestore to be enabled There is probably not too much bad about enabling both, but open file counts can get messy with both enabled. And v1 should be schedule for deprecation soon enough. --- diff --git a/src/log-filestore.c b/src/log-filestore.c index 69b4a42de7..d0509540c0 100644 --- a/src/log-filestore.c +++ b/src/log-filestore.c @@ -584,6 +584,13 @@ static OutputInitResult LogFilestoreLogInitCtx(ConfNode *conf) } } + if (RunModeOutputFiledataEnabled()) { + SCLogWarning(SC_ERR_NOT_SUPPORTED, + "A file data logger is already enabled. Filestore (v1) " + "will not be enabled."); + return result; + } + OutputCtx *output_ctx = SCCalloc(1, sizeof(OutputCtx)); if (unlikely(output_ctx == NULL)) return result; diff --git a/src/output-filestore.c b/src/output-filestore.c index ec82e5a810..d5eb2c9688 100644 --- a/src/output-filestore.c +++ b/src/output-filestore.c @@ -387,6 +387,13 @@ static OutputInitResult OutputFilestoreLogInitCtx(ConfNode *conf) return result; } + if (RunModeOutputFiledataEnabled()) { + SCLogWarning(SC_ERR_NOT_SUPPORTED, + "A file data logger is already enabled. Filestore (v2) " + "will not be enabled."); + return result; + } + char log_directory[PATH_MAX] = ""; GetLogDirectory(conf, log_directory, sizeof(log_directory)); if (!InitFilestoreDirectory(log_directory)) {