Repository navigation
Replies: 2 comments
|
One coupling is worth having in hand before this gets fixed, because the obvious fix is a one-liner that breaks something else on Windows.
So the two changes have to land together, and the shape that does both is per-child rather than per-process-tree: do not hand the variable to ordinary children, and set it explicitly on the sandbox-runner invocation when (and only when) Two smaller readings from the same source that your report implies but does not need to restate: the outer subprocess runner's image is irrelevant to this (Electron outside + node ACL runner succeeds; node outside + Electron ACL runner fails — the image that mints the restricted token is what decides), and a token inherited from an Electron parent is harmless on its own. Both are measured, so if a candidate fix is tested by swapping one of those instead, the test is measuring something else. |
|
补充独立复现、一处必须同时改的耦合,以及对两条修法建议的两点校正。 1) 独立复现(不同系统版本、不同机器) 楼主是 Windows 10 22H2 (19045),我这里是 Windows 11 26H2 (26300.9711) —— 跨版本一致;
一行复现: 补一条楼主没覆盖的路径:「显式选应用」走的是 2) 与沙箱的耦合(同意 argzero):修法必须是 per-child,且两处一起改
把树里所有相关点列出来,形状就清楚了:
3) 两点校正
4) 赞同两点: English summary: independently reproduced on Windows 11 26H2 (build 26300) and on a second Windows machine; |
Uh oh!
There was an error while loading. Please reload this page.
Summary
DSH Desktop 在自己进程的环境里设置了
ELECTRON_RUN_AS_NODE=1,该变量被所有子进程继承(工具子进程、以及「打开方式」的启动器链路)。任何 Electron 应用在这种环境下启动时都会退化成纯 Node.js、随即退出,GUI 永远不会出现。而 Windows 自带的启动器(
cmd /c start、rundll32 url.dll,FileProtocolHandler)仍然返回退出码 0,所以整个失败是静默的——用户只看到一句通用文案 "打开失败,请重试"(path.openError)。受影响场景:所有从 DSH 内启动的 Electron 系编辑器/IDE,例如 VS Code / VS Code Insiders / VSCodium、Cursor、Windsurf、Zed。
Reproduction
环境:DSH Desktop
0.2.0-rc.2,Windows10.0.26200,VS Code1.141.0。任选一个 Electron 应用,下面用 VS Code。启动 DSH Desktop,从它派生出的任意 shell 里确认变量已泄漏:
它没有被持久化到任何地方,仅存在于 DSH 进程内:
用与 DSH 启动器相同的方式启动目标程序(这条命令也等价于点击「打开方式 → VS Code」):
对照实验——只从子进程环境中移除这一个变量,其余完全不变:
Current behavior
第 2 步(变量存在)拿到
bad option:改用普通路径参数时,栈信息直接暴露它跑的是 Node.js,而不是 VS Code:
事后
Get-Process -Name Code为 0 —— 进程从未存活。第 3 步(仅移除该变量)则完全正常,VS Code 启动并打开了目标文件夹:
Get-Process -Name Code→ 9 个进程。单变量对照即恢复正常,把原因锁定在这个变量上。
补充:同一个「打开方式」菜单里的 「文件资源管理器」是可以正常工作的,因为它复用已在运行的 Explorer 实例(
/select通过 COM 转发),不需要新建 Electron 进程——这与上述结论一致。Expected behavior
ELECTRON_RUN_AS_NODE不应被进程级导出;它只应对真正需要 Node 语义的那一次 spawn 生效。Environment
0.2.0-rc.2(安装器版本;内置 CLIdsh --version→0.2.0-rc.2)10.0.2620024.18.11.141.0(2a59476c9bfcb90b3ddc372c36762471b7dfad1c,x64)All reactions