Use faccessat in traversed_secure_open#1477
Merged
squell merged 2 commits intotrifectatechfoundation:mainfrom Mar 10, 2026
Merged
Use faccessat in traversed_secure_open#1477squell merged 2 commits intotrifectatechfoundation:mainfrom
squell merged 2 commits intotrifectatechfoundation:mainfrom
Conversation
afcedca to
6a9a6df
Compare
squell
approved these changes
Mar 5, 2026
Member
|
This is still marked as draft, maybe it can be marked as ready for review? |
6a9a6df to
d79d9df
Compare
The owner of a file can modify file permissions and as such effectively has write permission, even if write permission is currently disabled in the file permissions. og-sudo also checks this.
d79d9df to
c29d64e
Compare
Collaborator
Author
|
Both commits now contain a test for their respective change. |
This performs all access checks a real open would do, not just the unix permission checks that we previously manually did. This way ACLs are taken into account as well as any mandatory access control that applies. For testing we still use the old checks as faccessat can't be used to test with arbitrary users when the unit tests run as regular user.
c29d64e to
e548465
Compare
squell
approved these changes
Mar 10, 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.
This performs all access checks a real open would do, not just the unix permission checks that we previously manually did. This way ACLs are taken into account as well as any mandatory access control that applies.
Also check if user is the owner. The owner of a file can modify file permissions and as such effectively has write permission, even if write permission is currently disabled in the file permissions.
Still needs a test that this actually fixes the ACL issue.
Fixes #1339