From 9f7f681e26887a9b284a2f25e8252c3a5077f348 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Wed, 8 May 2024 14:39:06 -0600 Subject: fix(runtime): allow nul device on windows (#23741) Fixes [23721](https://github.com/denoland/deno/issues/23721) --- runtime/permissions/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'runtime/permissions') diff --git a/runtime/permissions/lib.rs b/runtime/permissions/lib.rs index e66f16a7f..70d1abae7 100644 --- a/runtime/permissions/lib.rs +++ b/runtime/permissions/lib.rs @@ -1696,6 +1696,12 @@ impl PermissionsContainer { self.check_was_allow_all_flag_passed().map_err(error_all)?; } } else if cfg!(target_os = "windows") { + // \\.\nul is allowed + let s = path.as_os_str().as_encoded_bytes(); + if s.eq_ignore_ascii_case(br#"\\.\nul"#) { + return Ok(()); + } + fn is_normalized_windows_drive_path(path: &Path) -> bool { let s = path.as_os_str().as_encoded_bytes(); // \\?\X:\ -- cgit v1.2.3