Skip to content

std: Fix fs::read_link behavior on Windows #24198

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
Apr 13, 2015

Conversation

alexcrichton
Copy link
Member

The current implementation of using GetFinalPathNameByHandle actually reads all
intermediate links instead of just looking at the current link. This commit
alters the behavior of the function to use a different API which correctly reads
only one level of the soft link.

[breaking-change]

The current implementation of using GetFinalPathNameByHandle actually reads all
intermediate links instead of just looking at the current link. This commit
alters the behavior of the function to use a different API which correctly reads
only one level of the soft link.

[breaking-change]
@alexcrichton
Copy link
Member Author

r? @aturon

cc @retep998, @andrew-d

@rust-highfive rust-highfive assigned aturon and unassigned huonw Apr 8, 2015
@rust-highfive
Copy link
Contributor

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@sfackler
Copy link
Member

sfackler commented Apr 8, 2015

Could you add a test for this?

@retep998
Copy link
Member

retep998 commented Apr 8, 2015

@sfackler That would require having a symbolic link to test it on, which requires administrator privileges to create by default.

@sfackler
Copy link
Member

sfackler commented Apr 8, 2015

Ah, bummer.

@retep998
Copy link
Member

retep998 commented Apr 8, 2015

@sfackler That said, it should be feasible to make the buildbot slaves able to create symbolic links, and have the test attempt to make a symbolic link and read it, and if it fails with insufficient privileges then we can just pass the test anyway.

@andrew-d
Copy link
Contributor

andrew-d commented Apr 8, 2015

@sfackler That said, it should be feasible to make the buildbot slaves able to create symbolic links, and have the test attempt to make a symbolic link and read it, and if it fails with insufficient privileges then we can just pass the test anyway.

I think this is pretty reasonable. Other than that, 👍 to the PR!

@alexcrichton
Copy link
Member Author

Unfortunately I've found that tests that pass when something is disabled to not work out too well in the past. Eventually we'll reconfigure the bots, forget to enable them to create symlinks, and then all the tests will just sit around for a bit not testing much.

I will say though that I've manually tested that the implementation works for now at least!

@aturon
Copy link
Member

aturon commented Apr 13, 2015

@bors: r+

Thanks for the fix!

@bors
Copy link
Collaborator

bors commented Apr 13, 2015

📌 Commit f3f99fb has been approved by aturon

@bors
Copy link
Collaborator

bors commented Apr 13, 2015

⌛ Testing commit f3f99fb with merge f55e66a...

bors added a commit that referenced this pull request Apr 13, 2015
The current implementation of using GetFinalPathNameByHandle actually reads all
intermediate links instead of just looking at the current link. This commit
alters the behavior of the function to use a different API which correctly reads
only one level of the soft link.

[breaking-change]
@bors bors merged commit f3f99fb into rust-lang:master Apr 13, 2015
@alexcrichton alexcrichton deleted the windows-readlink branch April 30, 2015 02:13
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.

8 participants