]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
datasets: fix dataset load path construction 5386/head
authorJason Ish <jason.ish@oisf.net>
Tue, 8 Sep 2020 16:54:20 +0000 (10:54 -0600)
committerVictor Julien <victor@inliniac.net>
Tue, 8 Sep 2020 17:48:35 +0000 (19:48 +0200)
Test the full path instead of just the filename provided in the
rule to see if it exists.

Fixes the case where a rule file is loaded from a directory
other than the default-rule-directory.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3916

src/detect-dataset.c

index b098c428a615dbdf77a03d8109b8c233590b8ae0..ff8d13f00d45a3a2d53eb1c44dcce797a7d121be 100644 (file)
@@ -264,7 +264,7 @@ static int SetupLoadPath(const DetectEngineCtx *de_ctx,
     if (snprintf(path, sizeof(path), "%s/%s", dir, load) >= (int)sizeof(path)) // TODO windows path
         return -1;
 
-    if (SCPathExists(load)) {
+    if (SCPathExists(path)) {
         done = true;
         strlcpy(load, path, load_size);
         SCLogDebug("using path '%s' (HAVE_LIBGEN_H)", load);