mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 19:44:59 +00:00
fix(test): use NTFS junctions and platform guards for symlink tests on Windows (openclaw#28747) thanks @arosstale
Verified: - pnpm install --frozen-lockfile - pnpm test src/agents/apply-patch.test.ts src/agents/sandbox/fs-bridge.test.ts src/agents/sandbox/validate-sandbox-security.test.ts src/infra/archive.test.ts Co-authored-by: arosstale <117890364+arosstale@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -120,7 +120,13 @@ describe("archive utils", () => {
|
||||
await withArchiveCase("zip", async ({ workDir, archivePath, extractDir }) => {
|
||||
const outsideDir = path.join(workDir, "outside");
|
||||
await fs.mkdir(outsideDir, { recursive: true });
|
||||
await fs.symlink(outsideDir, path.join(extractDir, "escape"));
|
||||
// Use 'junction' on Windows — junctions target directories without
|
||||
// requiring SeCreateSymbolicLinkPrivilege.
|
||||
await fs.symlink(
|
||||
outsideDir,
|
||||
path.join(extractDir, "escape"),
|
||||
process.platform === "win32" ? "junction" : undefined,
|
||||
);
|
||||
|
||||
const zip = new JSZip();
|
||||
zip.file("escape/pwn.txt", "owned");
|
||||
|
||||
Reference in New Issue
Block a user