#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
-#include <libgen.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
}
if (line.len > strlen("include ") && strpfx(line.ptr, "include "))
{
- char **expanded, *path, *dir, pattern[PATH_MAX];
+ char **expanded, *dir, pattern[PATH_MAX];
u_char *pos;
if (level > MAX_SECRETS_RECURSION)
}
else
{ /* use directory of current file if relative */
- path = strdup(file);
- dir = dirname(path);
+ dir = path_dirname(file);
if (line.len + 1 + strlen(dir) + 1 > sizeof(pattern))
{
DBG1(DBG_CFG, "include pattern too long, ignored");
- free(path);
+ free(dir);
continue;
}
snprintf(pattern, sizeof(pattern), "%s/%.*s",
dir, (int)line.len, line.ptr);
- free(path);
+ free(dir);
}
#ifdef HAVE_GLOB_H
{