make_game: reject case aliases inside the game directory (MAKE-GAME-CASE-INSIDE-GUARD) #1627

Open
github-bot wants to merge 1 commit from github-bot/gh-1627 into main AGit
Owner

@⁠KoLolX3 on GitHub · 2026-11-25 06:16 UTC · original
KoLolX3:fix/make-game-case-inside-guard → main · +35 −1 · 2 files · 1 commits · open

Claimed in the coordination issue as: MAKE-GAME-CASE-INSIDE-GUARD (#1608)

What and why

On case-insensitive volumes such as APFS, different capitalization can make the output or work directory appear outside the game directory even when it is inside it. Compare destination ancestors by filesystem identity when the lexical check misses, including when the destination does not exist yet. Synthetic tests cover both options, nested future paths, and an unrelated sibling.

Tested

  • python -I tests/test_make_game_paths.py (6 tests, 2 Windows-only skips)
  • python -I scripts/run_semantic_tests.py tests/semantic (487 files, 6,279 tests, 0 files failed)
  • python -I tests/test_text_write_line_endings.py
  • python -m compileall -q make_game.py tools tests, python -I make_game.py --help, python -I scripts/check_no_game_data.py make_game.py tests/test_make_game_paths.py, and git diff --check
  • Linux; case-insensitive filesystem behavior simulated in the focused test. Native APFS was not available.

GPUs tested: n/a

AI-assisted: yes (OpenAI Codex)

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable.)
**@⁠KoLolX3** on GitHub · 2026-11-25 06:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1627) `KoLolX3:fix/make-game-case-inside-guard` → `main` · +35 −1 · 2 files · 1 commits · open Claimed in the coordination issue as: MAKE-GAME-CASE-INSIDE-GUARD (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why On case-insensitive volumes such as APFS, different capitalization can make the output or work directory appear outside the game directory even when it is inside it. Compare destination ancestors by filesystem identity when the lexical check misses, including when the destination does not exist yet. Synthetic tests cover both options, nested future paths, and an unrelated sibling. ### Tested - `python -I tests/test_make_game_paths.py` (6 tests, 2 Windows-only skips) - `python -I scripts/run_semantic_tests.py tests/semantic` (487 files, 6,279 tests, 0 files failed) - `python -I tests/test_text_write_line_endings.py` - `python -m compileall -q make_game.py tools tests`, `python -I make_game.py --help`, `python -I scripts/check_no_game_data.py make_game.py tests/test_make_game_paths.py`, and `git diff --check` - Linux; case-insensitive filesystem behavior simulated in the focused test. Native APFS was not available. GPUs tested: n/a AI-assisted: yes (OpenAI Codex) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (Not applicable.)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:58:36 +00:00
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-25 10:35 UTC · original

Independent verification (Windows, Python 3.11.9 -I -W error): path_is_within keeps the commonpath fast path and only on miss walks ancestors via os.path.samefile — catches case aliases on volumes where normcase doesn't fold (APFS) and non-existent destinations; termination at fs-root fixpoint verified, per-ancestor OSError ignored correctly. Probes inside/outside/self/sibling-prefix/relative/different-drive all correct. test_make_game_paths.py 6 OK (new case-alias test passes; APFS path covered via mock); compileall + line-endings + check_no_game_data + diff-check clean. AI-assisted verification.

**@⁠whoalin1** on GitHub · 2026-11-25 10:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1627#issuecomment-7159897807) Independent verification (Windows, Python 3.11.9 `-I -W error`): `path_is_within` keeps the commonpath fast path and only on miss walks ancestors via `os.path.samefile` — catches case aliases on volumes where normcase doesn't fold (APFS) and non-existent destinations; termination at fs-root fixpoint verified, per-ancestor OSError ignored correctly. Probes inside/outside/self/sibling-prefix/relative/different-drive all correct. `test_make_game_paths.py` 6 OK (new case-alias test passes; APFS path covered via mock); compileall + line-endings + check_no_game_data + diff-check clean. AI-assisted verification.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1627/head:github-bot/gh-1627'
git switch 'github-bot/gh-1627'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1627'
git switch 'github-bot/gh-1627'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1627'
git switch 'github-bot/gh-1627'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1627'
git switch 'main'
git merge --squash 'github-bot/gh-1627'
git switch 'main'
git merge --ff-only 'github-bot/gh-1627'
git switch 'main'
git merge 'github-bot/gh-1627'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.