Skip to content

fix: respect ACL write access when the owner write bit is absent - #728

Open
jackwalkerlabs wants to merge 2 commits into
tox-dev:mainfrom
jackwalkerlabs:fix/acl-writability
Open

fix: respect ACL write access when the owner write bit is absent#728
jackwalkerlabs wants to merge 2 commits into
tox-dev:mainfrom
jackwalkerlabs:fix/acl-writability

Conversation

@jackwalkerlabs

@jackwalkerlabs jackwalkerlabs commented Sep 8, 2026

Copy link
Copy Markdown

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.open succeed, 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,type passes: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant