mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-17 20:21:13 +00:00
fix(exec): ignore malformed drive-less windows exec paths
This commit is contained in:
committed by
Peter Steinberger
parent
a26f4d0f3e
commit
e6ce31eb54
@@ -45,6 +45,10 @@ function parseFirstToken(command: string): string | null {
|
||||
return match ? match[0] : null;
|
||||
}
|
||||
|
||||
function isDriveLessWindowsRootedPath(value: string): boolean {
|
||||
return process.platform === "win32" && /^:[\\/]/.test(value);
|
||||
}
|
||||
|
||||
function tryResolveRealpath(filePath: string | undefined): string | undefined {
|
||||
if (!filePath) {
|
||||
return undefined;
|
||||
@@ -176,6 +180,9 @@ function resolveExecutableCandidatePathFromResolution(
|
||||
return undefined;
|
||||
}
|
||||
const expanded = raw.startsWith("~") ? expandHomePrefix(raw) : raw;
|
||||
if (isDriveLessWindowsRootedPath(expanded)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!expanded.includes("/") && !expanded.includes("\\")) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user