fix: implement the --no-follow-symlinks option in Windows.

Until now this option was working only on POSIX systems.
This commit is contained in:
Victor M. Alvarez
2025-09-03 16:47:17 +02:00
parent 77f866f4aa
commit 6e11b5ae1f
+8
View File
@@ -500,6 +500,14 @@ static int scan_dir(const char_t* dir, SCAN_OPTIONS* scan_opts)
{
_sntprintf(path, YR_MAX_PATH, _T("%s\\%s"), dir, FindFileData.cFileName);
// If symbolic links must not be followed, and this entry is a symbolic
// link, ignore it and continue with the next one.
if (!scan_opts.follow_symlinks &&
FindFileData.dwFileAttribute & FILE_ATTRIBUTE_REPARSE_POINT)
{
continue;
}
if (!(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
LARGE_INTEGER file_size;