]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
filestore: only allow one filestore to be enabled
authorJason Ish <ish@unx.ca>
Fri, 12 Jan 2018 20:46:31 +0000 (14:46 -0600)
committerJason Ish <ish@unx.ca>
Thu, 18 Jan 2018 13:26:29 +0000 (07:26 -0600)
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
src/output-filestore.c

index 69b4a42de715a960a7bbe20cb9023c8b5dbbbe20..d0509540c0975d93a14ac54057e6d70689f0965c 100644 (file)
@@ -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;
index ec82e5a81000bb73bdb95fcce467310abe0c2963..d5eb2c9688ee9463cbd02e3f5a7ea0a084f4af7d 100644 (file)
@@ -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)) {