Skip to content

Commit dcc0ef9

Browse files
committed
include delete bits in ACL mask
1 parent 89bbbb5 commit dcc0ef9

File tree

1 file changed

+7
-1
lines changed
  • codex-rs/windows-sandbox-rs/src

1 file changed

+7
-1
lines changed

codex-rs/windows-sandbox-rs/src/acl.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use windows_sys::Win32::Storage::FileSystem::FILE_ALL_ACCESS;
3434
use windows_sys::Win32::Storage::FileSystem::FILE_APPEND_DATA;
3535
use windows_sys::Win32::Storage::FileSystem::FILE_ATTRIBUTE_NORMAL;
3636
use windows_sys::Win32::Storage::FileSystem::FILE_FLAG_BACKUP_SEMANTICS;
37+
use windows_sys::Win32::Storage::FileSystem::FILE_DELETE_CHILD;
3738
use windows_sys::Win32::Storage::FileSystem::FILE_GENERIC_EXECUTE;
3839
use windows_sys::Win32::Storage::FileSystem::FILE_GENERIC_READ;
3940
use windows_sys::Win32::Storage::FileSystem::FILE_GENERIC_WRITE;
@@ -45,6 +46,7 @@ use windows_sys::Win32::Storage::FileSystem::FILE_WRITE_DATA;
4546
use windows_sys::Win32::Storage::FileSystem::FILE_WRITE_EA;
4647
use windows_sys::Win32::Storage::FileSystem::OPEN_EXISTING;
4748
use windows_sys::Win32::Storage::FileSystem::READ_CONTROL;
49+
use windows_sys::Win32::Storage::FileSystem::DELETE;
4850
const SE_KERNEL_OBJECT: u32 = 6;
4951
const INHERIT_ONLY_ACE: u8 = 0x08;
5052
const GENERIC_WRITE_MASK: u32 = 0x4000_0000;
@@ -334,7 +336,11 @@ pub unsafe fn dacl_effective_allows_mask(
334336
}
335337

336338
#[allow(dead_code)]
337-
const WRITE_ALLOW_MASK: u32 = FILE_GENERIC_READ | FILE_GENERIC_WRITE | FILE_GENERIC_EXECUTE;
339+
const WRITE_ALLOW_MASK: u32 = FILE_GENERIC_READ
340+
| FILE_GENERIC_WRITE
341+
| FILE_GENERIC_EXECUTE
342+
| DELETE
343+
| FILE_DELETE_CHILD;
338344

339345
/// Ensure all provided SIDs have a write-capable allow ACE on the path.
340346
/// Returns true if any ACE was added.

0 commit comments

Comments
 (0)