Skip to content

Commit

Permalink
Test why CI fails namespace creation
Browse files Browse the repository at this point in the history
  • Loading branch information
cd-work committed Sep 26, 2023
1 parent 45cf6cc commit a785e58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ impl Sandbox for LinuxSandbox {
}

// Use landlock only if namespaces failed.
if namespace_result.is_ok() {
return Ok(());
}
namespace_result.unwrap();
println!("NAMESPACE OK");
// if namespace_result.is_ok() {
// return Ok(());
// }

// Apply landlock rules.
let status = self.landlock.restrict_self()?;
Expand Down
1 change: 1 addition & 0 deletions tests/fs_without_landlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ fn main() {
// Access to the private file is prohibited.
let result = fs::read_to_string(private_path);
assert!(result.is_err());
panic!();
}

#[cfg(not(target_os = "linux"))]
Expand Down

0 comments on commit a785e58

Please sign in to comment.