From aa0760a8d5527510a16d1a30c4fae609870da6f2 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Fri, 12 Jan 2018 14:46:31 -0600 Subject: [PATCH] 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. --- src/log-filestore.c | 7 +++++++ src/output-filestore.c | 7 +++++++ 2 files changed, 14 insertions(+) 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)) {