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
pull/5386/head
Jason Ish 4 years ago committed by Victor Julien
parent e3b28bcf2a
commit c4d0a61eca

@ -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);

Loading…
Cancel
Save