diff --git a/src/libpsl-native/src/isfile.cpp b/src/libpsl-native/src/isfile.cpp index b2cead6cd..89c415f47 100644 --- a/src/libpsl-native/src/isfile.cpp +++ b/src/libpsl-native/src/isfile.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "isfile.h" @@ -36,5 +37,6 @@ bool IsFile(const char* path) return false; } - return access(path, F_OK) != -1; + // Resolve relative paths to cwd of process, and do not follow symlinks + return faccessat(AT_FDCWD, path, F_OK, AT_SYMLINK_NOFOLLOW) != -1; }