mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 22:01:24 +00:00
fix: handle Windows safe-bin exe names
This commit is contained in:
@@ -660,7 +660,11 @@ export function isSafeBinUsage(params: {
|
||||
if (params.safeBins.size === 0) return false;
|
||||
const resolution = params.resolution;
|
||||
const execName = resolution?.executableName?.toLowerCase();
|
||||
if (!execName || !params.safeBins.has(execName)) return false;
|
||||
if (!execName) return false;
|
||||
const matchesSafeBin =
|
||||
params.safeBins.has(execName) ||
|
||||
(process.platform === "win32" && params.safeBins.has(path.parse(execName).name));
|
||||
if (!matchesSafeBin) return false;
|
||||
if (!resolution?.resolvedPath) return false;
|
||||
const cwd = params.cwd ?? process.cwd();
|
||||
const exists = params.fileExists ?? defaultFileExists;
|
||||
|
||||
Reference in New Issue
Block a user