[Windows] workspace-write 沙箱在数据盘工作区完全不可用:SetNamedSecurityInfoW failed (Win32 5) #7750
Replies: 1 comment 1 reply
Verified against source — and the boundary is right (re-derived, not taken on trust)Thanks for this one: it is the first report in this family that supplies both a version boundary and a remedy narrower than the one I had been printing. Both check out, and I have adopted the second. I re-derived the boundary per tag rather than reading it off the summary — same spirit as your unpacking, but from source:
So flag The gate is
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
正文
标题
分类:Bug reports | 标签:windows(若有)
正文
在数据盘(D:/E: 等根目录仅授予
Authenticated Users: Modify的卷)上把工作区设为workspace-write后,该工作区内所有 shell 命令都无法执行——连Write-Output "hello"都跑不了。失败发生在沙箱初始化阶段,而非命令被拒:Win32 5=ERROR_ACCESS_DENIED。该路径 fail-closed,因此整个会话不可用。用户视角就是:勾了"工作区可写",却什么都做不了,也没有任何提示告诉为什么。根因:
Modify的掩码是0x1301BF,按定义不含WRITE_DAC(0x40000) 与WRITE_OWNER(0x80000)。而自0.1.7-alpha.1起,沙箱为修复越界删除引入了 Low 完整性标签——标签位于 SACL,写入需要WRITE_OWNER。源码注释已写明前提:问题在于 "a Full-control workspace" 是隐含假设:数据盘工作区只有
Modify,而"目录所有者"身份只隐含READ_CONTROL+WRITE_DAC,不足以写 SACL。C 盘用户目录给的是(F)(FullControl),所以那边正常——差异纯粹来自默认 ACL。版本边界(逐版本解包确认):
0.1.5-rc.x/0.1.6-alpha.x用标志4(仅 DACL),0.1.7-alpha.1起改为20(DACL + LABEL)。这解释了为何内置0.1.5-rc.2的第三方桌面端没有此问题——这是可用性回归,代价换来越界删除的修复。临时规避(无需管理员,只要你是该目录所有者):
(OI)(CI)可继承,会传播到已存在的子孙目录,每个工作区一条即可。授权后实测:工作区内可写、工作区外写入被拒(隔离生效)、工作区外读取正常。建议:不建议回退 0.1.7 的删除约束(那会重新引入越界删除)。缺口在于检测与沟通——建议加前置检查,在报错中给出
WRITE_OWNER提示与修复命令,而非抛裸Win32 5。完整报告(含逐版本比对、实测输出、最小复现脚本)见附件
dsh-windows-workspace-write-writeowner-report.md。Post body (English)
Title
Body
With a workspace on a data volume (a non-system volume whose root grants
Authenticated Users: Modify), every shell command fails under theworkspace-writepreset — evenWrite-Output "hello". The failure is at sandbox bring-up, not a per-command rejection:Win32 5isERROR_ACCESS_DENIED; the path is fail-closed, so the whole session is unusable. From the user's side: workspace-write is enabled and nothing works, with no explanation.Root cause:
Modifyis0x1301BF, which by definition excludesWRITE_DAC(0x40000) andWRITE_OWNER(0x80000). Since0.1.7-alpha.1the sandbox writes a Low integrity label to fix out-of-workspace deletion — the label lives in the SACL, and writing a SACL requiresWRITE_OWNER. The source comment states the prerequisite:"A Full-control workspace" is an implicit assumption: data-volume workspaces have only
Modify, and owner-implicit rights (READ_CONTROL+WRITE_DAC) are not enough to write a SACL. C: profile directories grant(F)(FullControl), hence the discrepancy — the difference is purely the default ACL.Version boundary (confirmed by unpacking every release):
0.1.5-rc.x/0.1.6-alpha.xpass flag4(DACL only); from0.1.7-alpha.1it is20(DACL + LABEL). This explains why third-party desktops bundling0.1.5-rc.2are unaffected — a usability regression traded for the deletion fix.Workaround (no elevation needed if you own the directory):
(OI)(CI)propagates to existing descendants, so one command per workspace suffices. Verified after granting: writes inside succeed, writes outside are denied (confinement works), reads outside still work.Suggestion: do not revert the 0.1.7 deletion confinement (that would reintroduce out-of-workspace deletion). The gap is detection and communication — add a pre-flight check and surface the
WRITE_OWNERrequirement plus the fix command instead of a rawWin32 5.Full report (per-version comparison, measured output, minimal repro script) attached as
dsh-windows-workspace-write-writeowner-report.md.All reactions