1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-21 04:52:26 -05:00

Fix: Address permissions issue for UNC paths on Windows

This commit is contained in:
yazan-abdalrahman 2024-08-21 15:04:15 +03:00
parent 19bcb40059
commit 246271cbfe

View file

@ -1820,6 +1820,14 @@ impl PermissionsContainer {
fn is_normalized_windows_drive_path(path: &Path) -> bool {
let s = path.as_os_str().as_encoded_bytes();
// Check if the path is a UNC path (e.g., \\Server\Share\Folder)
// UNC paths typically contain "\\" at the start or somewhere in the middle
if s.windows(2).any(|window| window == b"\\\\") {
return true;
}
// Original check for normalized drive paths (e.g., \\?\C:\)
// \\?\X:\
if s.len() < 7 {
false