Reject empty HOME envvar
This commit is contained in:
@@ -284,6 +284,25 @@ fn relative_ro_path_works() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn empty_home_rejected() {
|
||||
let output = sandbox(&[])
|
||||
.env("HOME", "")
|
||||
.args(["--", "true"])
|
||||
.output()
|
||||
.expect("agent-sandbox binary failed to execute");
|
||||
|
||||
assert!(
|
||||
!output.status.success(),
|
||||
"expected failure with empty HOME, but got success"
|
||||
);
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
assert!(
|
||||
stderr.to_lowercase().contains("home"),
|
||||
"expected error mentioning HOME, got: {stderr}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rw_missing_path_errors() {
|
||||
let output = sandbox(&["--rw", "/nonexistent/xyz"])
|
||||
|
||||
Reference in New Issue
Block a user