Commit 660e1ed
committed
fix(harness): strip Windows drive prefix in SANDBOXED resolveSandboxed
LocalFilesystemModeTest expected SANDBOXED mode to silently re-root
absolute paths under the workspace (returning a "not found" error from
read), but Windows drive-letter paths like "C:\Users\...\secret.txt"
slipped past the leading-"/" peel and stayed absolute, so cwd.resolve()
returned the original absolute path and the !startsWith(cwd) check
threw SecurityException.
Strip the drive prefix ("C:\" / "C:/") in resolveSandboxed so the
remainder is a relative path that resolves under cwd the same way Unix
absolute inputs do. No-op on Unix; matches the test's documented
"absolute path becomes a non-existent relative under the root" intent.1 parent 1719031 commit 660e1ed
1 file changed
Lines changed: 13 additions & 1 deletion
File tree
- agentscope-harness/src/main/java/io/agentscope/harness/agent/filesystem/local
agentscope-harness/src/main/java/io/agentscope/harness/agent/filesystem/local/LocalFilesystem.java
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
615 | | - | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
616 | 618 | | |
617 | 619 | | |
618 | 620 | | |
619 | 621 | | |
620 | 622 | | |
621 | 623 | | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
622 | 634 | | |
623 | 635 | | |
624 | 636 | | |
| |||
0 commit comments