fix(registry): coreutils stat/chmod/ls show real permission bits#266
Draft
NathanFlurry wants to merge 2 commits into
Draft
fix(registry): coreutils stat/chmod/ls show real permission bits#266NathanFlurry wants to merge 2 commits into
NathanFlurry wants to merge 2 commits into
Conversation
Teach the VM's filesystem layer POSIX permission semantics so native C tools (vim, coreutils) behave like Linux: - wasi-libc patch exposes host permission bits through new host_fs.fd_mode / path_mode imports so stat/fstat/lstat return real mode bits (0644/0755) - chmod/fchmod implemented via the host_fs bridge (previously ENOSYS) - access() reflects the mode's rwx bits (X_OK no longer always succeeds) - truncate/ftruncate update the size stat reports; fd metadata stays coherent - fixes an intermittent EFAULT on create/write under wasm heap growth This fixes vim opening every file readonly and 'touch: Bad address', with a comprehensive fs_probe.c that is diffed 1:1 against native Linux.
|
🚅 Deployed to the secure-exec-pr-266 environment in secure-exec
|
b10da27 to
3fdd7fb
Compare
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.
Summary
host_fsmode/chmod imports.Validation
cd registry/native && make cmd/stat cmd/chmod cmd/ls cmd/touchjust registry-build coreutilscd registry/native && make clean-vendor && make vendor && ./scripts/patch-vendor.shjust shelltmux proof:statshows 0644,chmod 600,stat/stat -cshow 0600, andls -lshows-rw-------.cd agentos/packages/core && AGENTOS_WASM_SNAPSHOT_RUNNER=off AGENTOS_SIDECAR_BIN=/home/nathan/workspaces/shell/agentos/target/debug/agentos-sidecar pnpm exec vitest run tests/fs-native-parity.test.ts tests/vim-render.test.ts