Fix false positives by filesystem::equivalent
on file systems with transient file IDs by muellerj2 · Pull Request #5130 · microsoft/STL (original) (raw)
Fixes #3571 for <filesystem>
and <experimental/filesystem>
.
The fix for <experimental/filesystem>
affects the redist because it changes the implementation of _Equivalent
in filesys.cpp
that is exported by msvcp140.dll.
There is no additional test coverage because a reliable test for this issue would involve setting up a drive commonly producing such transient file IDs. But I verified manually with a drive shared by Remote Desktop that (a) false positives by std::filesystem::equivalent
and std::experimental::filesystem::equivalent
are present without this PR and (b) are gone with it. I also added comments at the top of _Equivalent
and __std_fs_equivalent
that reference #3571 and serve as a reminder why the file handles can't be closed before file IDs for both files have been obtained.