-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
exec-approvals: assertNoSymlinkParentsSync missing allowRootChildSymlink, breaks exec when ~/.openclaw is symlink #85890
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Bug:
assertNoExecApprovalsSymlinkParentsdoesn't passallowRootChildSymlink: trueEnvironment
Problem
When
~/.openclawis a symlink to another directory (e.g.,~/.local/openclaw), the exec-approvals module refuses to traverse it, causing all shell commands to fail globally across every agent.Error:
Root Cause
In
dist/exec-approvals-F42asPlK.js, the functionassertNoExecApprovalsSymlinkParentscallsassertNoSymlinkParentsSync(fromregular-file-6GdZVPgG.js) withallowOutsideRoot: truebut does not passallowRootChildSymlink: true.The
assertNoSymlinkParentsSyncfunction already supportsallowRootChildSymlink(line 51 ofregular-file-6GdZVPgG.js), which is specifically designed for the case where a home directory's immediate child is a symlink — exactly our scenario.Additional Issue
In the
ensureDirfunction (line 138),fs.lstatSync(dir)is used to check the directory itself. If the directory is accessed through a symlink, this also rejects it. The fix is to usefs.statSync(dir)(which follows symlinks) instead.Suggested Fix
Fix 1 — Pass
allowRootChildSymlink:Fix 2 — Use
statSyncfor directory check:Why This Matters
~/.openclawbeing a symlink is a common pattern:Without this fix, exec is completely broken for all agents, and the only workaround is manually patching the compiled JS file after every ClawX update.
Workaround
A launchd-based auto-repair script has been deployed that detects and patches the file on startup, but this is fragile and breaks on every ClawX update when the file hash changes.
Proposed Fix (minimal)