Repository navigation
Conversation
…Linux sandbox A writable workspace pinned only its own .git, so a nested repository or submodule could have its config and hooks changed from inside the sandbox, and a worktree pointer could name a gitdir the profile never mounted. Pin every .git under the workspace with the same read-only control entries, and refuse a worktree whose gitdir or shared directory is outside the workspace. A workspace with no repository keeps commands refused, because bwrap cannot deny creating .git by name.
|
Refreshed onto current The one design choice worth your call: a worktree whose gitdir is outside the workspace is refused rather than pinned read-only. Refusing keeps the promise that sandboxed commands cannot reach metadata the profile did not mount; pinning would keep worktree users working but mounts a path outside the workspace and needs |
|
Thank you for this, @eXsoR65. The TensorFold app's work is now handled separately from the engine work in this repo, and this PR has had no activity since 2026-11-06, so I'm closing it to keep the open list honest. If you'd like to take it up again, reopen it or open a new one against today's main and we'll look.
|
What this changes
Closes the two git gaps that kept the Linux command sandbox out of #1122. Refreshed onto
upstream/main1fae9d9c4. The bubblewrap backend isback on top of current
main, with nested repositories pinned and worktrees that reach outside theworkspace refused. It stays opt-in (
TENSORFOLD_LINUX_SANDBOX=1); Linux commands keep failingclosed without it.
Fixes #1693.
What was broken
.gitwas pinned. A repository nested under theworkspace, or a submodule, let a sandboxed command rewrite its
configand planthooks..gitis a file (gitdir: …), the real metadata can live outside theworkspace. The profile never mounted it, and the command ran anyway — unprotected, not refused.
What it does now
.gitunder the workspace is pinned like the root: writable bind, read-onlyconfig,config.worktree,hooks,info. The walk is bounded (2048 entries, depth 8) and refuses insteadof pinning a subset.
commondirlies outside the workspace is refused; so isa workspace with no repository, because bwrap cannot deny creating
.gitby name. Refusal returnscode 126 with the reason, and nothing runs.
pre-change worktree handling fails "Missing expected exception".
Receipt
21dd5495:npm test857/857 passed, 0 failed; typecheck clean;linux-port-docsguard clean;git diff --checkclean.config/hooksread-only, worktree refusal, network denial/allowing, cancellation.pass. No distro other than Debian 13.
desktop(macOS 15),desktop-linux,appimage-linux,mobile,zig,fmt,zig-windows,zig-macos-dev-tools,release-paths, and bothbenchmark-clientsjobs.atc check 1693reportsyourswith this pull request linked;atc overlapreports no conflicting pull requests for the seven changed files, though it marks itsown coverage incomplete (
invalidPulls,pullFilesLimit,pullFilesUnavailable,timeLimit).atc whofinds no open pull request or worktree touching any of the seven files.Limits
mount rule.