-
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.
Ignore lockdown errors for invalid paths (#65)
This fixes an issue where locking down the Linux sandbox would fail if a path was deleted after adding the exception but before locking down the sandbox.
- Loading branch information
Showing
5 changed files
with
29 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
use birdcage::{Birdcage, Exception, Sandbox}; | ||
use tempfile::NamedTempFile; | ||
|
||
use crate::TestSetup; | ||
|
||
pub fn setup() -> TestSetup { | ||
// Create temporary file. | ||
let tempfile = NamedTempFile::new().unwrap(); | ||
|
||
// Setup sandbox exceptions. | ||
let mut sandbox = Birdcage::new(); | ||
sandbox.add_exception(Exception::Read(tempfile.path().into())).unwrap(); | ||
|
||
tempfile.close().unwrap(); | ||
|
||
TestSetup { sandbox, data: String::new() } | ||
} | ||
|
||
pub fn validate(_data: String) { | ||
// We just want to test sandbox creation worked. | ||
} |
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