mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 05:48:39 +00:00
fix(macos): enforce path-only exec allowlist patterns
This commit is contained in:
@@ -5,7 +5,6 @@ enum ExecAllowlistMatcher {
|
||||
guard let resolution, !entries.isEmpty else { return nil }
|
||||
let rawExecutable = resolution.rawExecutable
|
||||
let resolvedPath = resolution.resolvedPath
|
||||
let executableName = resolution.executableName
|
||||
|
||||
for entry in entries {
|
||||
let pattern = entry.pattern.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
@@ -14,8 +13,6 @@ enum ExecAllowlistMatcher {
|
||||
if hasPath {
|
||||
let target = resolvedPath ?? rawExecutable
|
||||
if self.matches(pattern: pattern, target: target) { return entry }
|
||||
} else if self.matches(pattern: pattern, target: executableName) {
|
||||
return entry
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user