Sandbox writableRoots hardcoded — no way to add extra writable dirs for SDK toolchains / 沙箱可写根目录无法附加(SDK工具链) #4307
Replies: 2 comments
|
Another concrete use case: multi-repository development. I often work on projects split across sibling repositories where two repositories need to be writable, while other sibling repositories should remain intentionally non-writable. With the current single-root Support for additional writable roots would solve this cleanly while preserving least privilege, e.g.: workspaceRoot: /home/user/src/project/repo-a
extraWritableRoots:
- /home/user/src/project/repo-b |
|
Confirming the Windows case, and offering a workaround that is available today. The Windows rung does not need a mount setYou traced the hardcoded three-entry So for the SDK-toolchain case ( VerifiedWindows 11, session in I granted a git directory outside the workspace and then
Limits, stated plainly
ImplementationIncludes a test asserting byte-parity against DSH's own I still think the declarative |
Uh oh!
There was an error while loading. Please reload this page.
Sandbox writableRoots is hardcoded — cannot add extra writable directories for SDK toolchains
沙箱可写根目录硬编码 — 无法附加额外可写目录(SDK 工具链场景)
中文 / Chinese
问题: 会话沙箱的可写目录(writableRoots)被硬编码为三处:
workspaceRoot+/tmp+os.tmpdir()(dsh-sandbox/lib/index.js的 writableRoots 实现), 没有"附加可写目录"配置项。场景: 在最小化工作区(workspaceRoot = 项目目录)下, 使用 SDK 编译(flutter / go / dart 等):
PUB_CACHE/TMPDIR可以用环境变量重定向到项目内, 但 SDK 自身的 cache 路径是写死的(如 flutter 的$FLUTTER_ROOT/bin/cache/engine.stamp/engine.realm, 由 flutter 脚本pwd -P推导真实 SDK 路径), 无法用 env 重定向请求: 在 sandbox-policy(或 fs-sandbox)配置中支持附加可写根目录(如
extraWritableRoots: ["/home/user/flutter"]), 让用户在保持工作区最小化的前提下, 放行特定工具链目录的写入。这会比"复制 SDK 进项目"和"每次审批升级"都更实用。English / English
Problem: The sandbox's writable roots (
writableRoots) are hardcoded to exactly three entries —workspaceRoot+/tmp+os.tmpdir()(see thewritableRootsimplementation indsh-sandbox/lib/index.js). There is no configuration for additional writable directories.Scenario: With a minimal workspace (workspaceRoot = the project directory), compiling with an SDK (flutter / go / dart etc.):
PUB_CACHE/TMPDIRcan be redirected into the project via env vars, but the SDK's own cache path is hardcoded (e.g. flutter's$FLUTTER_ROOT/bin/cache/engine.stamp/engine.realm, resolved by flutter'spwd -Pto the real SDK path), so env redirection does not cover itRequest: Support additional writable roots in sandbox-policy (or fs-sandbox) configuration, e.g.
extraWritableRoots: ["/home/user/flutter"], so users can allow specific toolchain directories without enlarging the workspace root. This would be far more practical than copying SDKs into projects or approving every compile.All reactions