From: Jason Ish Date: Tue, 8 Sep 2020 16:54:20 +0000 (-0600) Subject: datasets: fix dataset load path construction X-Git-Tag: suricata-6.0.0-rc1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5386%2Fhead;p=thirdparty%2Fsuricata.git 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 --- 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);