mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 20:38:27 +00:00
fix(security): harden allow-always wrapper persistence
This commit is contained in:
@@ -36,6 +36,22 @@ describe("system run command helpers", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("extractShellCommandFromArgv unwraps known dispatch wrappers before shell wrappers", () => {
|
||||
expect(extractShellCommandFromArgv(["/usr/bin/nice", "/bin/bash", "-lc", "echo hi"])).toBe(
|
||||
"echo hi",
|
||||
);
|
||||
expect(
|
||||
extractShellCommandFromArgv([
|
||||
"/usr/bin/timeout",
|
||||
"--signal=TERM",
|
||||
"5",
|
||||
"zsh",
|
||||
"-lc",
|
||||
"echo hi",
|
||||
]),
|
||||
).toBe("echo hi");
|
||||
});
|
||||
|
||||
test("extractShellCommandFromArgv supports fish and pwsh wrappers", () => {
|
||||
expect(extractShellCommandFromArgv(["fish", "-c", "echo hi"])).toBe("echo hi");
|
||||
expect(extractShellCommandFromArgv(["pwsh", "-Command", "Get-Date"])).toBe("Get-Date");
|
||||
|
||||
Reference in New Issue
Block a user