Fix infinite recursion writing to removable drives mounted to NTFS folders #3415
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix another issue with unresolvable reparse points on Windows. ArchReadLink
can return the passed in path if it refers to an "NT Object Manager" path, and we need to handle this as if it isn't a reparse point, because we can't follow the link.
This generalizes the fix by @seando-adsk in f6c2e82, by handling mounted volumes on Windows and avoiding infinitely recursive calls to TfReadLink by having TfIsLink return false in cases where this bad behavior could arise.
Description of Change(s)
Changed Tf_HasAttribute to remove the reparse point attribute on a directory if TfReadLink returns the original path or an empty string (i.e. we couldn't follow the link). This means TfIsLink returns false in these cases, preventing recursive calls to TfReadLink because we always call TfIsLink before calling TfReadLink.
Fixes Issue(s)
#3414
Checklist
[ X ] I have created this PR based on the dev branch
[ X ] I have followed the coding conventions
[ ] I have added unit tests that exercise this functionality
Unit testing this is basically impossible given the complex steps required to set up the USB drive appropriately.
[ X ] I have verified that all unit tests pass with the proposed changes
[ X ] I have submitted a signed Contributor License Agreement (Reference: