Repository navigation
calibrated_texture: publish the DDS with the bits of a plain open(), not the staging file's 0600 - #7628
Open
best2135 wants to merge 1 commit into
Open
calibrated_texture: publish the DDS with the bits of a plain open(), not the staging file's 0600#7628best2135 wants to merge 1 commit into
best2135 wants to merge 1 commit into
Conversation
…not 0600 export_file stages the DDS through tempfile.NamedTemporaryFile, which creates the file 0600, then os.link()s it (or os.replace()s it under --force) into place without restoring the mode. A new DDS came out 0600 instead of the umask's bits, and --force reset a 0640 file to 0600. Give the staged file file_mode.published_mode(target) first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue (claim).
export_fileintools/calibrated_texture.pystages the DDS intempfile.NamedTemporaryFile(created 0600), thenos.link()s it into place (oros.replace()s it under--force) without restoring the mode. So:open()gives under the umask (0644 under umask 022);--forceresets a file the user made 0640 to 0600.tools/file_mode.pyexists for exactly this, and the other staged writers use it (#1082). This callsos.chmod(tmp, published_mode(target))before the link or replace, as they do.Test: two new tests in
tests/test_calibrated_texture_extra.py, built by hand (no game data). They fakeLocalDecoder, so they run without NumPy. A new DDS getsfile_mode.new_file_mode(dir), and a--forcereplace of a 0640 file keeps 0640. Both fail onmainand pass with this change.Ran (Linux, Python 3.14.8, CPU only, no NumPy):
python -I tests/test_calibrated_texture_extra.py: 27 tests, OKpython -m compileall -q make_game.py tools tests: passpython -I scripts/check_no_game_data.pyon the changed files: passSkipped on Windows (
os.name == "nt"), where the POSIX bits don't apply. Same bug class as #7572, #7573, #7623, #7625 and #7626, but in different files, so the PRs don't overlap.AI-assisted (Claude Code).
🤖 Generated with Claude Code