]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
file-hashing: restore 'force-md5'
authorVictor Julien <victor@inliniac.net>
Thu, 22 Sep 2016 08:45:29 +0000 (10:45 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 22 Sep 2016 08:45:36 +0000 (10:45 +0200)
We don't want to break existing setups.

Do issue a warning that a new option is available.

src/util-file.c

index b2f6b47a5e7c810d6ad297fb6d5f45b89bb41014..502fcf059b152e8a16bad978340036f79005a260 100644 (file)
@@ -134,6 +134,22 @@ void FileForceHashParseCfg(ConfNode *conf)
 
     ConfNode *forcehash_node = NULL;
 
+    /* legacy option */
+    const char *force_md5 = ConfNodeLookupChildValue(conf, "force-md5");
+    if (force_md5 != NULL) {
+        SCLogWarning(SC_ERR_DEPRECATED_CONF, "deprecated 'force-md5' option "
+                "found. Please use 'force-hash: [md5]' instead");
+
+        if (ConfValIsTrue(force_md5)) {
+#ifdef HAVE_NSS
+            FileForceMd5Enable();
+            SCLogInfo("forcing md5 calculation for logged files");
+#else
+            SCLogInfo("md5 calculation requires linking against libnss");
+#endif
+        }
+    }
+
     if (conf != NULL)
         forcehash_node = ConfNodeLookupChild(conf, "force-hash");