Add opt-in no_default_permissions mount option (read foreign-uid files without root) - #155
Open
moonsoup wants to merge 2 commits into
Open
Add opt-in no_default_permissions mount option (read foreign-uid files without root)#155moonsoup wants to merge 2 commits into
moonsoup wants to merge 2 commits into
Conversation
macOS FUSE implementations (macFUSE, FUSE-T) declare the getxattr operation with an extra trailing `uint32_t position` argument — the Darwin resource-fork xattr convention. Assigning the shared 4-arg op_getxattr to .getxattr then fails to compile with an incompatible-function-pointer-type error (ref upstream issue alperakcan#143). Add an __APPLE__-only shim that accepts and ignores `position` and defers to the existing op_getxattr. No behavior change on Linux/BSD; ext2 has no resource-fork concept, so dropping `position` is correct. The #ifdef keeps the non-Darwin build using the 4-arg op_getxattr unchanged. Tested: builds and mounts read-only on macOS 26.5.1 (Apple Silicon, Darwin 25.5.0), macFUSE 5.2, Apple clang; read-only verification passes on ext2/ext3/ext4 throwaway images. Single-environment test only; broader platform testing not yet done. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
By default fuse-ext2 mounts with the kernel's `default_permissions`, which enforces the on-disk mode/owner bits. When reading a filesystem recovered from another machine, files are often owned by a uid that does not exist on the host, so the mounting user is denied access to their own recovered data and must fall back to mounting everything as root. Add an opt-in `-o no_default_permissions` that omits `default_permissions`, letting the (root-privileged) fuse-ext2 daemon serve those files to the mounting user regardless of the foreign on-disk uid. Off by default — the kernel still enforces permissions unless explicitly requested. To allow this, `default_permissions` is now appended in parse_mount_options() rather than hardcoded in def_opts, so it can be conditionally suppressed. Tested on macOS 26.5.1 / macFUSE 5.2: a mode-0750 file owned by a foreign uid (1000) is unreadable by the local user under a default mount but readable with -o no_default_permissions; read-only verification still passes on ext2/ext3/ext4. Single-environment test only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
moonsoup
added a commit
to moonsoup/fuse-ext2
that referenced
this pull request
Jul 5, 2026
Replaces the outdated README (osxfuse references, a 100-line copy-paste /opt/gnu build script, obscure caveats) with a focused install + usage guide: - Install via `brew install moonsoup/fuse-ext2/fuse-ext2` (new tap) or from source with the macFUSE/e2fsprogs flags that actually work on current macOS. - Read-only mount usage, incl. the no_default_permissions option for reading drives recovered from another machine. - Points to the upstream PRs (alperakcan#154, alperakcan#155) for the fixes. Also gitignore autoconf backup junk (config.*~) and CLAUDE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Adds an opt-in
-o no_default_permissionsmount option.By default fuse-ext2 mounts with the kernel's
default_permissions, whichenforces the on-disk mode/owner bits. When reading a filesystem recovered from
another machine, files are often owned by a uid that doesn't exist on the host,
so the mounting user is denied access to their own recovered data and has to
fall back to mounting everything as root.
With
-o no_default_permissions,default_permissionsis omitted, letting the(root-privileged) fuse-ext2 daemon serve those files to the mounting user
regardless of the foreign on-disk uid. It's off by default — the kernel still
enforces permissions unless explicitly requested. To make this possible,
default_permissionsis now appended inparse_mount_options()rather thanhardcoded in
def_opts, so it can be conditionally suppressed.Testing
On macOS 26.5.1 / macFUSE 5.2: a mode-0750 file owned by a foreign uid (1000)
is unreadable by the local user under a default mount, and readable with
-o no_default_permissions. Read-only verification still passes onext2/ext3/ext4. Single-environment test only.
Note
This branch is based on #154 (the macOS getxattr build fix) and includes that
commit, since the tree doesn't compile on macOS without it. If #154 merges
first I'll rebase so this shows only the
no_default_permissionschange.