Repository navigation
Make chmod +x stick, so builds can run inside the mount - #54
Open
franzjeger wants to merge 1 commit into
Open
franzjeger wants to merge 1 commit into
franzjeger wants to merge 1 commit into
Conversation
The mount reported a hardcoded 644 for every file and accepted chmod without doing anything. Marking a script executable silently did nothing: chmod reported success, ls -l kept saying 644, and running it failed with exit 126 — "found it, cannot execute it". Cargo writes a build script, marks it executable and runs it, so no Rust build could work inside the mount, and nothing in the error said why. setattr now honours the executable bit. Only that bit: OneDrive stores no POSIX mode, and read/write are governed by the mount options rather than by us — but exec is the one that decides whether a program runs. It is kept in two places, each for a different failure. On the cached copy, which getattr already stats for size and mtime, so reporting it costs nothing on a path a file manager hits constantly. And in the database, because a later download replaces the cached copy and the mode would go with it; it is re-applied after a download and carried across the ID change when an upload adopts the real OneDrive ID. The table is deliberately separate from `items`: the bit is local-only, it must survive the row being replaced during adoption, and delta sync must never touch it. Tests: a mount round trip doing what cargo does — write a script, chmod +x, stat it, run it, check its output. Confirmed to fail before the fix with "left: 0, right: 73", which is the missing 0o111. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XfrYQTqjBaP4gDF77Ux1wZ
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 mount reported a hardcoded
644for every file and acceptedchmodwithout doing anything.So marking a script executable silently did nothing:
chmodreported success,ls -lkept saying 644, and running it failed with exit 126 — the shell's "found it, cannot execute it". Cargo writes a build script, marks it executable and runs it, so no Rust build could work inside the mount, and nothing in the error said why.Same shape as the
fsyncbug in #50: an operation reporting success for something it did not do. That is worse than refusing, because there is nothing to debug.What changed
setattrhonours the executable bit. Only that bit — OneDrive stores no POSIX mode, and read/write are governed by the mount options rather than by us. But exec is the one that decides whether a program runs.It is kept in two places, each for a different failure mode:
getattralready stats it for size and mtime, so reporting the mode costs nothing on a path a file manager hits constantly.The
exec_bitstable is deliberately separate fromitems: the bit is local-only, it must survive the row being replaced during adoption, and delta sync must never touch it.Testing
A mount round trip doing exactly what cargo does — write a script,
chmod +x, stat it, run it, check its output.Confirmed to fail before the fix with
left: 0, right: 73— 73 is0o111, the bit that was not there.15 consecutive runs of the full mount suite pass.
cargo fmt,cargo clippy --workspace --all-targets -- -D warnings, andONEDRIVE_REQUIRE_FUSE=1 cargo test --workspacepass.Generated by Claude Code