mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 14:18:26 +00:00
fix: harden allow-always shell multiplexer wrapper handling
This commit is contained in:
@@ -57,6 +57,11 @@ describe("system run command helpers", () => {
|
||||
expect(extractShellCommandFromArgv(["pwsh", "-Command", "Get-Date"])).toBe("Get-Date");
|
||||
});
|
||||
|
||||
test("extractShellCommandFromArgv unwraps busybox/toybox shell applets", () => {
|
||||
expect(extractShellCommandFromArgv(["busybox", "sh", "-c", "echo hi"])).toBe("echo hi");
|
||||
expect(extractShellCommandFromArgv(["toybox", "ash", "-lc", "echo hi"])).toBe("echo hi");
|
||||
});
|
||||
|
||||
test("extractShellCommandFromArgv ignores env wrappers when no shell wrapper follows", () => {
|
||||
expect(extractShellCommandFromArgv(["/usr/bin/env", "FOO=bar", "/usr/bin/printf", "ok"])).toBe(
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user