From 246271cbfe77f1496ca7b2c2e8f6d1a0403e1322 Mon Sep 17 00:00:00 2001 From: yazan-abdalrahman Date: Wed, 21 Aug 2024 15:04:15 +0300 Subject: [PATCH 1/5] 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 From 9d733782def54e13d268f5f34a2ee32352e81042 Mon Sep 17 00:00:00 2001 From: yazan-abdalrahman Date: Wed, 21 Aug 2024 15:14:13 +0300 Subject: [PATCH 2/5] Trigger Build From b4fd2c3e84b580d658ad2c54b173cb31417452c2 Mon Sep 17 00:00:00 2001 From: yazan-abdalrahman Date: Wed, 21 Aug 2024 16:10:07 +0300 Subject: [PATCH 3/5] Trigger Build From 033370da7137438be2b1c67910e0175b767587ca Mon Sep 17 00:00:00 2001 From: yazan-abdalrahman Date: Wed, 21 Aug 2024 16:27:22 +0300 Subject: [PATCH 4/5] Fix: Address permissions issue for UNC paths on Windows --- runtime/permissions/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/permissions/lib.rs b/runtime/permissions/lib.rs index 33d86190bf..005d5f9587 100644 --- a/runtime/permissions/lib.rs +++ b/runtime/permissions/lib.rs @@ -1823,6 +1823,7 @@ impl PermissionsContainer { // 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 + #[cfg(windows)] if s.windows(2).any(|window| window == b"\\\\") { return true; } From 53395acb2636dd113fd4a0798e2385b5f2701f11 Mon Sep 17 00:00:00 2001 From: yazan-abdalrahman Date: Wed, 21 Aug 2024 17:05:33 +0300 Subject: [PATCH 5/5] Revert "Fix: Address permissions issue for UNC paths on Windows" This reverts commit 033370da7137438be2b1c67910e0175b767587ca. --- runtime/permissions/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/permissions/lib.rs b/runtime/permissions/lib.rs index 005d5f9587..33d86190bf 100644 --- a/runtime/permissions/lib.rs +++ b/runtime/permissions/lib.rs @@ -1823,7 +1823,6 @@ impl PermissionsContainer { // 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 - #[cfg(windows)] if s.windows(2).any(|window| window == b"\\\\") { return true; }