fix: respect ACL write access when the owner write bit is absent - #728
Open
jackwalkerlabs wants to merge 2 commits into
Open
fix: respect ACL write access when the owner write bit is absent#728jackwalkerlabs wants to merge 2 commits into
jackwalkerlabs wants to merge 2 commits into
Conversation
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.
The lock preflight rejects any existing file without its owner-write mode bit, even when group permissions or an ACL allow the current user to write it. Consult the OS access decision before rejecting those files. Keep the writable-mode fast path so normal soft-lock contention does not mistake a concurrently removed marker for a permission error.
Reproduced with a real temporary macOS file: mode 0400 plus an ACL granting the current user write lets
os.opensucceed, but the original FileLock preflight raises PermissionError. With the fix, acquisition succeeds. Added regressions for ACL/group/other access and retained read-only/mtime tests, skipping the latter for root as real access allows root to write them.Validation:
tox r -e 3.12,fix,typepasses: 1,290 tests, 55 capability skips, 100% line and branch coverage including tests, all repository hooks, and ty. The real ACL acquisition also passes.Implemented and locally validated with OpenAI Codex.
Issue tracking: Found during source inspection; no matching open issue was identified for this fix.