Skip to content
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

Resolve full file paths when copying files #1323

Merged
merged 2 commits into from
Sep 22, 2020
Merged

Resolve full file paths when copying files #1323

merged 2 commits into from
Sep 22, 2020

Conversation

iffyio
Copy link
Contributor

@iffyio iffyio commented Sep 9, 2020

Currently, the copy_files function doesn't support symlink files due to
its use of DirEntry::metadata - To avoid this issue, this patch
resolves the file path first before checking for metadata.

Fixes #1157
Fixes #1209

Currently, the `copy_files` function doesn't support symlink files due to
its use of `DirEntry::metadata` - To avoid this issue, this patch
resolves the file path first before checking for metadata.

Fixes #1157
Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

This has the potential to be relatively risky, but I haven't been able to think of any specific problems. Windows users will need to enable Developer Mode, which I guess isn't too bad. There might be some risk that the user wants a symlink in the output directory, but since I believe that doesn't work today, this seems like a good/simple first step. I also think this will fail if there is a symlink cycle, but I believe most operating systems will detect that with an error.

@ehuss ehuss merged commit db8a282 into rust-lang:master Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants