Skip to content

FileManager: correct symbolic link handling on Windows #2660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2020

Conversation

compnerd
Copy link
Member

When the symbolic link points across a drive, querying the symbolic link
will provide a NT style path. The NT style path is not valid for a
reparse point destination. Use a hand-rolled canonicalization (removal
of the \??\ prefix) for the path to get a path that we can use in the
symbolic link. NTPathToDosPath is a possible approach to a more
robust solution but relies on undocumented kernel APIs.

When the symbolic link points across a drive, querying the symbolic link
will provide a NT style path.  The NT style path is not valid for a
reparse point destination.  Use a hand-rolled canonicalization (removal
of the `\??\` prefix) for the path to get a path that we can use in the
symbolic link.  `NTPathToDosPath` is a possible approach to a more
robust solution but relies on undocumented kernel APIs.
@compnerd
Copy link
Member Author

@swift-ci please test Linux platform

1 similar comment
@compnerd
Copy link
Member Author

@swift-ci please test Linux platform

@compnerd
Copy link
Member Author

@spevans
Copy link
Contributor

spevans commented Feb 14, 2020

@swift-ci please test Linux platform

@compnerd
Copy link
Member Author

The Windows builds have passed, no regressions, and an improvement in the test pass rate on both.

@compnerd compnerd merged commit 6167997 into swiftlang:master Feb 14, 2020
@compnerd compnerd deleted the nt-paths-to-dos-paths branch February 14, 2020 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants