[PR #287] file_system: GetTempPath and GetTempFileName resolve GAME:, G: and T: to the overlay scratch folder #339

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

📋 Pull Request Information

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

Base: main ← Head: old-pr/10017


📝 Commits (5)

  • 2f926d4 file_system: route console temporary paths to the overlay
  • 0f516a9 file_system: preserve temporary directory components
  • e0355e0 file_system: preserve Unicode temporary paths
  • fe05177 file_system: reject lossy temporary paths
  • 16acfac Fix GetTempPathA exact capacity return

📊 Changes

2 files changed (+246 additions, -0 deletions)

View changed files

📝 runtime/shims/file_system.cpp (+122 -0)
📝 runtime/test/file_system_test.cpp (+124 -0)

📄 Description

Carried over from old PR 10017 by tedin7 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10017, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
tedin7: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

@ItsNotRexed: an exe PR, as you asked.

Rebased cleanly on current main; supersedes #8813 closed during org migration.

What

GetTempPathA/W and GetTempFileNameA/W in runtime/shims/file_system.cpp now resolve console temp locations (GAME:, G:, T:) to the overlay scratch folder instead of the package. Subdirectories and Unicode are kept, lossy (unrepresentable) paths and refused names fail with the right error, a missing directory is not created, and GetTempPathA returns the exact required size. Host paths pass through unchanged.

Why

Without this, a title asking for its temp path on a console root got a path inside the read-only package, or a mangled one.

Tested

file_system_test (clang-cl cross build, run under Wine): +124 lines of checks.

  • With the fix: every new check passes (513 checks, 7 failures).
  • Negative control (shim reverted to origin/main, same test file): 26 failures, 19 of them the new temp-path checks.
  • The 7 remaining failures (MAXIMUM_ALLOWED CreateFile x6, *.? listing x1) are identical on main and are Wine-only, unrelated to this change.

🔄 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/287 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/10017` --- ### 📝 Commits (5) - [`2f926d4`](https://github.com/ubiquitarianism/leonida/commit/2f926d466378101e77886b9cb586b899b81fa524) file_system: route console temporary paths to the overlay - [`0f516a9`](https://github.com/ubiquitarianism/leonida/commit/0f516a943c166ffe749ad375ad673a1977e1db25) file_system: preserve temporary directory components - [`e0355e0`](https://github.com/ubiquitarianism/leonida/commit/e0355e044b2dc4038543b37251377a2dfb09c358) file_system: preserve Unicode temporary paths - [`fe05177`](https://github.com/ubiquitarianism/leonida/commit/fe051777f37743e44a35cc61da959015776f26f4) file_system: reject lossy temporary paths - [`16acfac`](https://github.com/ubiquitarianism/leonida/commit/16acface42bb14cc8222fbf465373f562821ccfc) Fix GetTempPathA exact capacity return ### 📊 Changes **2 files changed** (+246 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/file_system.cpp` (+122 -0) 📝 `runtime/test/file_system_test.cpp` (+124 -0) </details> ### 📄 Description > Carried over from **old PR 10017** by `tedin7` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10017`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `tedin7`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): `@ItsNotRexed`: an exe PR, as you asked. Rebased cleanly on current main; supersedes `#8813` closed during org migration. ## What GetTempPathA/W and GetTempFileNameA/W in `runtime/shims/file_system.cpp` now resolve console temp locations (GAME:, G:, T:) to the overlay scratch folder instead of the package. Subdirectories and Unicode are kept, lossy (unrepresentable) paths and refused names fail with the right error, a missing directory is not created, and GetTempPathA returns the exact required size. Host paths pass through unchanged. ## Why Without this, a title asking for its temp path on a console root got a path inside the read-only package, or a mangled one. ## Tested `file_system_test` (clang-cl cross build, run under Wine): +124 lines of checks. - With the fix: every new check passes (513 checks, 7 failures). - Negative control (shim reverted to origin/main, same test file): 26 failures, 19 of them the new temp-path checks. - The 7 remaining failures (MAXIMUM_ALLOWED CreateFile x6, `*.?` listing x1) are identical on main and are Wine-only, unrelated to this change. --- <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#339
No description provided.