Skip to content

tests: characterize macOS sandbox link writes#21845

Open
bolinfest wants to merge 1 commit intopr21819from
pr21845
Open

tests: characterize macOS sandbox link writes#21845
bolinfest wants to merge 1 commit intopr21819from
pr21845

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented May 8, 2026

Why

#21819 adds high-level coverage for sandboxed apply_patch and sandboxed fs/writeFile behavior around link aliases. This follow-up tests the lower-level macOS workspace-write sandbox directly so the boundary is explicit.

The important distinction is that writing an existing hard link inside the writable workspace preserves normal filesystem semantics, but that is not an arbitrary-write primitive by itself: the sandbox rejects creating a new hard link to a file outside the workspace, and it rejects symlink write-through to an outside target.

What Changed

Added macOS-only codex-exec sandbox tests that verify workspace-write:

  • allows writing through an existing hard link inside the workspace, mutating the shared inode;
  • rejects writing through an existing symlink to an outside file;
  • rejects creating a hard link to an outside file from inside the sandbox.

Testing

  • cargo test -p codex-exec macos_workspace_write
  • just fix -p codex-exec

Stack created with Sapling. Best reviewed with ReviewStack.

@bolinfest bolinfest requested a review from a team as a code owner May 8, 2026 23:15
@bolinfest bolinfest changed the base branch from main to pr21819 May 8, 2026 23:15
@bolinfest bolinfest changed the title tests: demonstrate macos hard-link sandbox escape tests: characterize macOS sandbox link writes May 9, 2026
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.

2 participants