From c4d0a61eca10d3b6f08ea028c3388d01dc47298f Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Tue, 8 Sep 2020 10:54:20 -0600 Subject: [PATCH] datasets: fix dataset load path construction 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detect-dataset.c b/src/detect-dataset.c index b098c428a6..ff8d13f00d 100644 --- a/src/detect-dataset.c +++ b/src/detect-dataset.c @@ -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);