mirror of
https://github.com/VirusTotal/yara.git
synced 2026-10-12 02:10:00 +00:00
fix: implement the --no-follow-symlinks option in Windows.
Until now this option was working only on POSIX systems.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user