mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 14:50:34 +00:00
fix: harden sandbox fs dash-path regression coverage (#25891) (thanks @albertlieyingadrian)
This commit is contained in:
@@ -123,6 +123,17 @@ describe("sandbox fs bridge shell compatibility", () => {
|
||||
expect(readPath).toContain("file_1095---");
|
||||
});
|
||||
|
||||
it("resolves dash-leading basenames into absolute container paths", async () => {
|
||||
const bridge = createSandboxFsBridge({ sandbox: createSandbox() });
|
||||
|
||||
await bridge.readFile({ filePath: "--leading.txt" });
|
||||
|
||||
const readCall = findCallByScriptFragment('cat -- "$1"');
|
||||
expect(readCall).toBeDefined();
|
||||
const readPath = readCall ? getDockerPathArg(readCall[0]) : "";
|
||||
expect(readPath).toBe("/workspace/--leading.txt");
|
||||
});
|
||||
|
||||
it("resolves bind-mounted absolute container paths for reads", async () => {
|
||||
const sandbox = createSandbox({
|
||||
docker: {
|
||||
|
||||
Reference in New Issue
Block a user