-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes an issue with the Linux sandbox where invalid paths would only cause an error during `Birdcage::lock`, at which point the consumer cannot handle or ignore this error anymore since the sandbox creation has already been attempted.
- Loading branch information
Showing
5 changed files
with
48 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use std::path::PathBuf; | ||
|
||
use birdcage::error::Error; | ||
use birdcage::{Birdcage, Exception, Sandbox}; | ||
|
||
fn main() { | ||
let mut birdcage = Birdcage::new(); | ||
|
||
// Add a path that doesn't exist. | ||
let result = birdcage.add_exception(Exception::Read("/does/not/exist".into())); | ||
|
||
// Ensure it is appropriately reported that exception was NOT added. | ||
match result { | ||
Err(Error::InvalidPath(path)) => assert_eq!(path, PathBuf::from("/does/not/exist")), | ||
_ => panic!("expected path error"), | ||
} | ||
|
||
// Ensure locking is always successful. | ||
birdcage.lock().unwrap(); | ||
} |