[PR #977] file_system: MAXIMUM_ALLOWED open of an overlay copy names read+write to the host (FS-MAXIMUM-ALLOWED-WINE) #1014

Open
opened 2026-11-26 20:19:48 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/977
Author: @OlaiFG7
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/fs-maximum-allowed-wine


📝 Commits (1)

  • 0d00b56 file_system: a MAXIMUM_ALLOWED open of an overlay copy names read and write to the host (FS-MAXIMUM-ALLOWED-WINE)

📊 Changes

3 files changed (+55 additions, -2 deletions)

View changed files

📝 runtime/shims/file_system.cpp (+19 -2)
📝 runtime/shims/file_system.h (+7 -0)
📝 runtime/test/file_system_test.cpp (+29 -0)

📄 Description

Claimed in the coordination issue as: FS-MAXIMUM-ALLOWED-WINE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136888814)

What and why

Under Wine a handle opened with MAXIMUM_ALLOWED reads but cannot write (finding by milk4sale in #14); Windows grants every right. The file-system shim already treats MAXIMUM_ALLOWED as a write-open and hands the title an overlay copy, but passed the mask to the host unchanged.

  • host_open_access() in runtime/shims/file_system.{h,cpp} adds GENERIC_READ | GENERIC_WRITE to a mask that has MAXIMUM_ALLOWED; other masks are unchanged. Used by the CreateFileW/A and CreateFile2 shims.
  • If the host answers ERROR_ACCESS_DENIED to the widened mask (read-only overlay copy), the open is retried with the title's own mask.
  • runtime/test/file_system_test.cpp: mask checks and a read-only overlay copy check. No game files.

Tested

Not built and not run: the machine used to write this has no C++ toolchain. Draft until file_system_test is built and run on Windows and under Wine.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly
  • One topic
  • No game data, keys or decryption
  • Not a translator rule

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/977 **Author:** [@OlaiFG7](https://github.com/OlaiFG7) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/fs-maximum-allowed-wine` --- ### 📝 Commits (1) - [`0d00b56`](https://github.com/ubiquitarianism/leonida/commit/0d00b562ad695b97027d24bcacfaaba40744febf) file_system: a MAXIMUM_ALLOWED open of an overlay copy names read and write to the host (FS-MAXIMUM-ALLOWED-WINE) ### 📊 Changes **3 files changed** (+55 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/file_system.cpp` (+19 -2) 📝 `runtime/shims/file_system.h` (+7 -0) 📝 `runtime/test/file_system_test.cpp` (+29 -0) </details> ### 📄 Description Claimed in the coordination issue as: FS-MAXIMUM-ALLOWED-WINE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136888814) ### What and why Under Wine a handle opened with `MAXIMUM_ALLOWED` reads but cannot write (finding by milk4sale in #14); Windows grants every right. The file-system shim already treats `MAXIMUM_ALLOWED` as a write-open and hands the title an overlay copy, but passed the mask to the host unchanged. - `host_open_access()` in `runtime/shims/file_system.{h,cpp}` adds `GENERIC_READ | GENERIC_WRITE` to a mask that has `MAXIMUM_ALLOWED`; other masks are unchanged. Used by the CreateFileW/A and CreateFile2 shims. - If the host answers `ERROR_ACCESS_DENIED` to the widened mask (read-only overlay copy), the open is retried with the title's own mask. - `runtime/test/file_system_test.cpp`: mask checks and a read-only overlay copy check. No game files. ### Tested **Not built and not run**: the machine used to write this has no C++ toolchain. Draft until `file_system_test` is built and run on Windows and under Wine. GPUs tested: n/a AI-assisted: yes ### Checklist - [ ] Based on current `main` and merges cleanly - [x] One topic - [x] No game data, keys or decryption - [x] Not a translator rule 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1014
No description provided.