Commit Graph

3 Commits

Author SHA1 Message Date
5c8f0231b3 file_mode: restore write permission before probe removal (FILE-MODE-PROBE-CLEANUP)
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
2026-11-24 17:17:09 +03:00
a1c943f8af Report writers: published files get the umask's bits, not mkstemp's 0600
awc_manifest, rsc8_audio and classify_carve stage their report in a 0600
temp file and os.replace it, so on POSIX the report ended up 0600.
rbf0_tree had its own copy of the umask(0)/umask(mask) read that file_mode
replaced (#750). All four now use file_mode.published_mode, and
tests/test_file_mode.py covers them with the other writers.
2026-11-22 12:11:24 +05:30
430265a0ed file_mode: find a new file's mode with a probe file, not by flipping the umask
glb_writer._output_mode and rtti_scan._report_mode read the umask with
os.umask(0) then os.umask(mask). The umask is process-wide, so any thread
creating a file in that window got mask 0. A probe file created with mode
0666 gives the same bits (and honours a directory's default ACL) without
changing anything. Raised by kapitche on #750 and #728.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:39:11 +05:30