Skip to content

Fix file permissions passed to open(2) by the POSIX arch_open#612

Open
matejk wants to merge 1 commit into
LinearTapeFileSystem:mainfrom
matejk:fix/file-backend-permissions
Open

Fix file permissions passed to open(2) by the POSIX arch_open#612
matejk wants to merge 1 commit into
LinearTapeFileSystem:mainfrom
matejk:fix/file-backend-permissions

Conversation

@matejk

@matejk matejk commented Jun 12, 2026

Copy link
Copy Markdown

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 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 with EDEV_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.

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.
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