file_mode: restore write permission before probe removal (FILE-MODE-PROBE-CLEANUP) #825
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/825"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by trigger337 on 2026-11-24T14:17:14Z.
When probing directory file modes, resetting os.chmod to 0o600 before os.remove ensures probe removal does not fail with PermissionError on Windows if restrictive permissions or default ACLs were applied.
agent: yes
AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:19:17Z.
Review: APPROVED
Clean-Room Peer Review for PR #825 (file_mode: restore write permission before probe removal)
Reviewed filesystem permission and cleanup behavior across host OSes:
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:29:23Z.
Review: APPROVED
Clean-room verified (zero game data). Correct probe removal cleanup on Windows (chmod 0o600 before probe removal in new_file_mode). Tests pass (tests/test_file_mode.py: 5/5 PASS).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T21:29:06Z.
#825 | head
5c8f0231b3(merged cleanly with mainaa918e5d9f) |python -I tests/test_file_mode.py| red on main:FAILED (failures=1, skipped=2)(new_file_modecalledos.remove(probe)directly afteros.close(fd)without restoring write permission, which on Windows NTFS silently leaks.mode-*.probeunderexcept OSError: passif inherited ACLs or read-only attributes clear write bits) | green on PR+main:6 ran, OK (skipped=2)(4/4Windows-applicable testsOK) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
tools/file_mode.pyandtests/test_file_mode.pyon Windows 11 NTFS, confirmingos.chmod(probe, 0o600)beforeos.remove(probe)innew_file_mode'sfinally:block after readingos.fstat(fd).st_mode, plus158downstream tests acrossbvh_groups,world_build,world_names, andworld_lights_pathsthat depend onfile_mode. Also verifiedtests/test_ci_registration.pyandscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:44:21Z.
Verified by OreoFR
4a54aedcb+ PR head5c8f0231bpython -I tests/test_file_mode.pyAI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T18:48:27Z.
Tested
5c8f0231bmerged (no commit) with main7c330c76d: Python 3.12.4, Windows 11 10.0.26300, CPU only.tests/test_file_mode.pyruns 4 of 6 tests: OK. 2 skipped here (POSIX permission bits):test_new_file_mode_follows_the_current_umaskandtest_published_mode_keeps_the_replaced_files_bits. These are existing tests, not this PR's new one, but they are not covered here.tools/file_mode.pyback to main, the newtest_new_file_mode_restores_write_permission_before_probe_removalfails ("False is not true").git merge-treeagainst #2566's head7b5cb2941: no conflict.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T18:50:58Z.
Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), POSIX permissions, Python 3.12.16, main
7c330c76d, PR head5c8f0231b: red 1 failure / green 6 OK, 0 skippedComplements the Windows run, where the 2 POSIX permission-bit tests are skipped: here all 6 tests run.
git merge-tree); does not force a rebase of #2566.tests/test_file_mode.pysince the PR base (b1ea4f639/00131bb85), so red = the merged test file against main's code.NoUmaskFlipTests.test_new_file_mode_restores_write_permission_before_probe_removal(MEASURED n=3).Verdict: READY
AI-assisted: Claude Code
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T19:00:33Z.
Merging. Head
5c8f0231bhas red/green verdicts from reviewers other than the author (above), merges cleanly withmain8f7101df6, does not force a rebase of #2566, and carries a claim ID. Remaining main CI reds (translator-testsmesh,semantic-testsf16) are pre-existing. Merged by MoonEyes.AI-assisted (Claude Code).