Fix file permissions passed to open(2) by the POSIX arch_open#612
Open
matejk wants to merge 1 commit into
Open
Fix file permissions passed to open(2) by the POSIX arch_open#612matejk wants to merge 1 commit into
matejk wants to merge 1 commit into
Conversation
The POSIX arch_open macro passed the Windows-style share flag as the mode argument of open(2) and ignored the actual permission argument. Files created by the file tape backend got mode 0200 (write-only), so a non-root user could not reopen records it had just written; mounting a freshly formatted file-backend volume failed with EDEV_RW_PERM. Running as root masked the problem.
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 POSIX
arch_openmacro passed the Windows-style share flag as the mode argument ofopen(2)and ignored the actual permission argument. Files created by the file tape backend get mode 0200 (write-only), so a non-root user cannot reopen records it has just written; mounting a freshly formatted file-backend volume fails withEDEV_RW_PERM. Running as root masks the problem.One commit, 4 lines. Prerequisite for the integration test suite (#611), which formats and mounts file-backend volumes as a regular user; #611 carries a duplicate of this commit so its CI is green standalone — git drops the duplicate whichever merges first.