Stop --chdir from binding the working directory read-write

This commit is contained in:
2026-11-17 20:37:01 +01:00
parent 352ead2bf5
commit 4b801f811e
8 changed files with 72 additions and 21 deletions
+2 -2
View File
@@ -65,7 +65,7 @@ fn chdir_override() {
let dir = TempDir::new().expect("failed to create temp dir");
let dir_str = dir.path().to_str().unwrap();
let output = Sandbox::new(&["--chdir", dir_str])
let output = Sandbox::new(&["--ro", dir_str, "--chdir", dir_str])
.args(["--", "bash", "-c", "pwd"])
.output()
.expect("agent-sandbox binary failed to execute");
@@ -82,7 +82,7 @@ fn chdir_under_hardened_tmp() {
let dir = TempDir::new().expect("failed to create temp dir");
let dir_str = dir.path().to_str().unwrap();
let output = Sandbox::new(&["--hardened", "--chdir", dir_str])
let output = Sandbox::new(&["--hardened", "--rw", dir_str, "--chdir", dir_str])
.args(["--", "bash", "-c", "pwd && touch ./ok && echo done"])
.output()
.expect("agent-sandbox binary failed to execute");