diff --git a/src/util-logopenfile.c b/src/util-logopenfile.c index 718e5ad78b..0bd96f1e64 100644 --- a/src/util-logopenfile.c +++ b/src/util-logopenfile.c @@ -132,7 +132,11 @@ SCConfLogOpenGeneric(ConfNode *conf, if (ConfGet("default-log-dir", &log_dir) != 1) log_dir = DEFAULT_LOG_DIR; - snprintf(log_path, PATH_MAX, "%s/%s", log_dir, filename); + if (PathIsAbsolute(filename)) { + snprintf(log_path, PATH_MAX, "%s", filename); + } else { + snprintf(log_path, PATH_MAX, "%s/%s", log_dir, filename); + } filetype = ConfNodeLookupChildValue(conf, "filetype"); if (filetype == NULL) diff --git a/src/util-path.c b/src/util-path.c index 0be44dedcb..8be7d96bfb 100644 --- a/src/util-path.c +++ b/src/util-path.c @@ -40,7 +40,7 @@ int PathIsAbsolute(const char *path) { return 1; } -#ifdef OS_WIN32 +#if (defined OS_WIN32 || defined __CYGWIN__) if (strlen(path) > 2) { if (isalpha(path[0]) && path[1] == ':') { return 1;