Repository navigation
🐛 fix(rw): close a link directory an ACL opened - #898
Merged
Merged
Conversation
An inherited NFSv4 ACL on ZFS gives the mkdtemp link directory group access, which the private-mode check read as a swapped-in directory, so every acquire in such a directory failed. An empty link directory is now chmod 0700 through its descriptor; one that stays open, as under aclmode=restricted, fails with an error naming the fix. Fixes tox-dev#897
gaborbernat
enabled auto-merge (squash)
October 30, 2026 18:53
gaborbernat
disabled auto-merge
October 30, 2026 19:20
This was referenced Nov 2, 2026
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.
On ZFS with NFSv4 ACLs and
aclinherit=passthrough, as on the reporter's TrueNAS system, everyReadWriteLockacquire in a group-writable directory failed withlink directory ... was replaced while opening. 🐛 #897 hit it through Paperless-ngx 3.4.0, which moved to filelock 4.2.4. With this change those locks work. The only remaining case is a directory whose ACL refuses chmod; it now fails with an error that says what to change.In such a directory, SQLite connects through a link inside a private directory beside the lock database. The inherited ACL overrides the 0700 mode that directory is created with, and the privacy check took the result for a directory another process had swapped in. The lock now closes a freshly created, empty link directory to its owner through its open descriptor before using it. A same-account directory that already has content is still refused as swapped in, and one owned by another account is refused as before.
Behavior by
aclmodediscard,groupmask,passthrough: locks work, and group members can no longer create names in the link directory.restricted, which refuses chmod on a non-trivial ACL: the error now names the parent directory to make writable by its owner only, the workaround from ReadWriteLock fails with "link directory ... was replaced while opening" on NFSv4-ACL filesystems #897, in place of the misleading "replaced" message.Fixes #897