Skip to content

Handle WSL filesystem path when analyze security zone of a file #13120

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 2 commits into from
Jul 13, 2020

Conversation

daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Jul 6, 2020

PR Summary

Fix #13106

WSL2 introduces a new filesystem path to access the Linux filesystem from Windows. Depending on the distro name, it would look like \wsl$\ubuntu. The problem is that this is not a valid UNC path, so it raises a UriFormatException when analyzing the security zone of the file as part of the work done by AuthorizationManager.

Fix is to check this type of path and consider it the MyComputer zone.

PR Checklist

@ghost ghost assigned adityapatwardhan Jul 6, 2020
@daxian-dbw daxian-dbw requested a review from iSazonov July 6, 2020 19:11
@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jul 7, 2020
@adityapatwardhan adityapatwardhan merged commit f90712a into PowerShell:master Jul 13, 2020
@adityapatwardhan adityapatwardhan added this to the 7.1.0-preview.6 milestone Jul 13, 2020
@daxian-dbw daxian-dbw deleted the wsluri branch July 13, 2020 20:24
@ghost
Copy link

ghost commented Aug 17, 2020

🎉v7.1.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pwsh.exe -C ./myscript.ps1 fails from WSL
3 participants