惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
量子位
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
爱范儿
爱范儿
博客园 - 【当耐特】
Vercel News
Vercel News
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
博客园 - 叶小钗
博客园_首页
V
Visual Studio Blog
宝玉的分享
宝玉的分享
B
Blog
MyScale Blog
MyScale Blog
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
V
V2EX

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(sandbox): support Windows drive-letter bind sources ·...
6607changchu · 2026-05-05 · via Recent Commits to openclaw:main

@@ -12,6 +12,8 @@ import { normalizeOptionalLowercaseString } from "../../shared/string-coerce.js"

1212

import { splitSandboxBindSpec } from "./bind-spec.js";

1313

import { SANDBOX_AGENT_WORKSPACE_MOUNT } from "./constants.js";

1414

import {

15+

getSandboxHostPathPolicyKey,

16+

isSandboxHostPathAbsolute,

1517

normalizeSandboxHostPath,

1618

resolveSandboxHostPathViaExistingAncestor,

1719

} from "./host-paths.js";

@@ -101,6 +103,7 @@ function parseBindTargetPath(bind: string): string {

101103102104

/**

103105

* Normalize a POSIX path: resolve `.`, `..`, collapse `//`, strip trailing `/`.

106+

* If it starts with the drive letter, convert it to the upper case.

104107

*/

105108

function normalizeHostPath(raw: string): string {

106109

return normalizeSandboxHostPath(raw);

@@ -115,10 +118,9 @@ function normalizeHostPath(raw: string): string {

115118

*/

116119

export function getBlockedBindReason(bind: string): BlockedBindReason | null {

117120

const sourceRaw = parseBindSourcePath(bind);

118-

if (!sourceRaw.startsWith("/")) {

121+

if (!isSandboxHostPathAbsolute(sourceRaw)) {

119122

return { kind: "non_absolute", sourcePath: sourceRaw };

120123

}

121-122124

const normalized = normalizeHostPath(sourceRaw);

123125

const blockedHostPaths = getBlockedHostPaths();

124126

const directReason = getBlockedReasonForSourcePath(normalized, blockedHostPaths);

@@ -141,8 +143,10 @@ function getBlockedReasonForSourcePath(

141143

if (sourceNormalized === "/") {

142144

return { kind: "covers", blockedPath: "/" };

143145

}

146+

const sourceKey = getSandboxHostPathPolicyKey(sourceNormalized);

144147

for (const blocked of blockedHostPaths) {

145-

if (sourceNormalized === blocked || sourceNormalized.startsWith(blocked + "/")) {

148+

const blockedKey = getSandboxHostPathPolicyKey(blocked);

149+

if (sourceKey === blockedKey || sourceKey.startsWith(`${blockedKey}/`)) {

146150

return { kind: "targets", blockedPath: blocked };

147151

}

148152

}

@@ -193,7 +197,7 @@ function normalizeAllowedRoots(roots: string[] | undefined): string[] {

193197

}

194198

const normalized = roots

195199

.map((entry) => entry.trim())

196-

.filter((entry) => entry.startsWith("/"))

200+

.filter(isSandboxHostPathAbsolute)

197201

.map(normalizeHostPath);

198202

const expanded = new Set<string>();

199203

for (const root of normalized) {

@@ -210,7 +214,9 @@ function isPathInsidePosix(root: string, target: string): boolean {

210214

if (root === "/") {

211215

return true;

212216

}

213-

return target === root || target.startsWith(`${root}/`);

217+

const rootKey = getSandboxHostPathPolicyKey(root);

218+

const targetKey = getSandboxHostPathPolicyKey(target);

219+

return targetKey === rootKey || targetKey.startsWith(`${rootKey}/`);

214220

}

215221216222

function getOutsideAllowedRootsReason(

@@ -274,7 +280,7 @@ function formatBindBlockedError(params: { bind: string; reason: BlockedBindReaso

274280

if (params.reason.kind === "non_absolute") {

275281

return new Error(

276282

`Sandbox security: bind mount "${params.bind}" uses a non-absolute source path ` +

277-

`"${params.reason.sourcePath}". Only absolute POSIX paths are supported for sandbox binds.`,

283+

`"${params.reason.sourcePath}". Only absolute POSIX or Windows drive-letter paths are supported for sandbox binds.`,

278284

);

279285

}

280286

if (params.reason.kind === "outside_allowed_roots") {