Skip to content

Commit

Permalink
Fix tests failing with missing /lib(64)
Browse files Browse the repository at this point in the history
  • Loading branch information
cd-work committed Sep 26, 2023
1 parent 9e98f7a commit d03c9ba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/exec.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::fs;
use std::path::PathBuf;
use std::process::Command;

use birdcage::{Birdcage, Exception, Sandbox};
Expand All @@ -7,8 +8,12 @@ fn main() {
let mut birdcage = Birdcage::new().unwrap();
birdcage.add_exception(Exception::ExecuteAndRead("/usr/bin/true".into())).unwrap();
birdcage.add_exception(Exception::ExecuteAndRead("/usr/lib".into())).unwrap();
birdcage.add_exception(Exception::ExecuteAndRead("/lib64".into())).unwrap();
birdcage.add_exception(Exception::ExecuteAndRead("/lib".into())).unwrap();
if PathBuf::from("/lib64").exists() {
birdcage.add_exception(Exception::ExecuteAndRead("/lib64".into())).unwrap();
}
if PathBuf::from("/lib64").exists() {
birdcage.add_exception(Exception::ExecuteAndRead("/lib".into())).unwrap();
}
birdcage.lock().unwrap();

// Check for success when executing `true`.
Expand Down

0 comments on commit d03c9ba

Please sign in to comment.