From 246271cbfe77f1496ca7b2c2e8f6d1a0403e1322 Mon Sep 17 00:00:00 2001 From: yazan-abdalrahman Date: Wed, 21 Aug 2024 15:04:15 +0300 Subject: [PATCH] Fix: Address permissions issue for UNC paths on Windows --- runtime/permissions/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtime/permissions/lib.rs b/runtime/permissions/lib.rs index 55a94d909a..33d86190bf 100644 --- a/runtime/permissions/lib.rs +++ b/runtime/permissions/lib.rs @@ -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