diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-05-08 14:39:06 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-08 14:39:06 -0600 |
commit | 9f7f681e26887a9b284a2f25e8252c3a5077f348 (patch) | |
tree | 19315e1b11ab3597b2055966b8b6dd93780af298 /runtime/permissions/lib.rs | |
parent | 547ce6c3b82c5e0c04dfb902f609cb229a2bde9a (diff) |
fix(runtime): allow nul device on windows (#23741)
Fixes [23721](https://github.com/denoland/deno/issues/23721)
Diffstat (limited to 'runtime/permissions/lib.rs')
-rw-r--r-- | runtime/permissions/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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:\ |