Skip to content

Commit 3fe02b1

Browse files
fix(sandbox): stop advertising a sandbox override that does not exist
The unelevated ACL failure told the reader to re-run with `--sandbox forbid`. There is no such option: SandboxPreferenceForbid is an internal engine state with no flag behind it, so following the advice produced an unknown option and left them stuck on a failure they had just been told how to clear. A recovery instruction that does not work costs more than no instruction, because the reader spends time discovering it is wrong. Point at the real way out instead: turn the sandbox off in the user config, which is honored from global config only. The elevated-setup remedy beside it was already correct and stays. Reported by jatmn against the same string on #640. It predates both branches, having arrived with the unelevated fallback tier in #427.
1 parent d05ab35 commit 3fe02b1

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎internal/sandbox/windows_command_runner_windows.go‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,15 @@ func ensureWindowsUnelevatedSetup(config WindowsSandboxCommandConfig) error {
112112
return nil
113113
}
114114
if _, err := applyWindowsACLPlan(plan); err != nil {
115+
// Both remedies below are real. An earlier version offered `--sandbox
116+
// forbid`, which is not: SandboxPreferenceForbid is an internal engine
117+
// state with no flag behind it, so following that advice produced an
118+
// unknown option and left the reader stuck on a failure they had just been
119+
// told how to clear. A recovery instruction that does not work is worse
120+
// than none, because it costs the reader the time to discover that.
115121
return fmt.Errorf("apply unelevated workspace ACLs: %w — the workspace may be on a filesystem the current user does not own; "+
116-
"run `zero sandbox setup` from an elevated (Administrator) terminal, or re-run with `--sandbox forbid` to skip OS sandboxing", err)
122+
"run `zero sandbox setup` from an elevated (Administrator) terminal, "+
123+
`or turn the sandbox off in your user config with "sandbox": {"enabled": false}`, err)
117124
}
118125
return recordWindowsUnelevatedAppliedPlan(config.SandboxHome, applied)
119126
}

0 commit comments

Comments
 (0)