mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 02:42:43 +00:00
refactor(exec): split host flows and harden safe-bin trust
This commit is contained in:
@@ -29,6 +29,7 @@ type TrustedSafeBinCache = {
|
||||
};
|
||||
|
||||
let trustedSafeBinCache: TrustedSafeBinCache | null = null;
|
||||
const STARTUP_PATH_ENV = process.env.PATH ?? process.env.Path ?? "";
|
||||
|
||||
function normalizeTrustedDir(value: string): string | null {
|
||||
const trimmed = value.trim();
|
||||
@@ -74,7 +75,7 @@ export function getTrustedSafeBinDirs(
|
||||
} = {},
|
||||
): Set<string> {
|
||||
const delimiter = params.delimiter ?? path.delimiter;
|
||||
const pathEnv = params.pathEnv ?? process.env.PATH ?? process.env.Path ?? "";
|
||||
const pathEnv = params.pathEnv ?? STARTUP_PATH_ENV;
|
||||
const key = buildTrustedSafeBinCacheKey(pathEnv, delimiter);
|
||||
|
||||
if (!params.refresh && trustedSafeBinCache?.key === key) {
|
||||
|
||||
Reference in New Issue
Block a user