diff options
| author | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 17:02:56 -0500 |
|---|---|---|
| committer | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 17:02:56 -0500 |
| commit | edbaf7c585086df000b88bc0c2c6c76535a8324c (patch) | |
| tree | d9d72d38075089a99e88b2f50f23fefe0138fdb4 /runtime/shims/file_system.cpp | |
| parent | 50d4f46fcf967cde9a36dc7ae453718a18090215 (diff) | |
| parent | 75f1351a07dce61fb7695b8468ad7aed036e599e (diff) | |
Merge pull request #3602 from kotorvr
Diffstat (limited to 'runtime/shims/file_system.cpp')
| -rw-r--r-- | runtime/shims/file_system.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/shims/file_system.cpp b/runtime/shims/file_system.cpp index f245f9a22..3675cc73b 100644 --- a/runtime/shims/file_system.cpp +++ b/runtime/shims/file_system.cpp | |||
| @@ -350,9 +350,11 @@ Target write_target(const std::wstring& path, bool copy_up) { | |||
| 350 | return t; | 350 | return t; |
| 351 | } | 351 | } |
| 352 | 352 | ||
| 353 | // MAXIMUM_ALLOWED names no right and grants every one the file allows, write included, so it is a write-open: opened | ||
| 354 | // as a read it handed out a handle to the package file itself, and a WriteFile through it changed the package. | ||
| 353 | bool writes(DWORD access, DWORD disposition) { | 355 | bool writes(DWORD access, DWORD disposition) { |
| 354 | constexpr DWORD kWriteAccess = GENERIC_WRITE | GENERIC_ALL | FILE_WRITE_DATA | FILE_APPEND_DATA | FILE_WRITE_EA | | 356 | constexpr DWORD kWriteAccess = GENERIC_WRITE | GENERIC_ALL | MAXIMUM_ALLOWED | FILE_WRITE_DATA | FILE_APPEND_DATA | |
| 355 | FILE_WRITE_ATTRIBUTES | DELETE | WRITE_DAC | WRITE_OWNER; | 357 | FILE_WRITE_EA | FILE_WRITE_ATTRIBUTES | DELETE | WRITE_DAC | WRITE_OWNER; |
| 356 | if ((access & kWriteAccess) != 0) return true; | 358 | if ((access & kWriteAccess) != 0) return true; |
| 357 | return disposition == CREATE_NEW || disposition == CREATE_ALWAYS || disposition == OPEN_ALWAYS || | 359 | return disposition == CREATE_NEW || disposition == CREATE_ALWAYS || disposition == OPEN_ALWAYS || |
| 358 | disposition == TRUNCATE_EXISTING; | 360 | disposition == TRUNCATE_EXISTING; |