-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
463: Prevent parent directory from being opened without being preopened wasi r=MarkMcCaskey a=MarkMcCaskey resolves #462 Because the logic of opening a directory and traversing the tree are separate, we allowed one level of `..` to be opened beyond what was preopened The diff on github isn't clear, but this adds an if and then puts the previous logic in an else block Co-authored-by: Mark McCaskey <[email protected]>
- Loading branch information
Showing
8 changed files
with
122 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[test] | ||
fn test_fs_sandbox_test() { | ||
assert_wasi_output!( | ||
"../../wasitests/fs_sandbox_test.wasm", | ||
"fs_sandbox_test", | ||
vec![], | ||
"../../wasitests/fs_sandbox_test.out" | ||
); | ||
} |
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
mod _common; | ||
mod create_dir; | ||
mod file_metadata; | ||
mod fs_sandbox_test; | ||
mod hello; | ||
mod mapdir; | ||
mod quine; |
Binary file not shown.
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 @@ | ||
Reading the parent directory was okay? false |
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,10 @@ | ||
fn main() { | ||
#[cfg(target = "wasi")] | ||
let result = std::fs::read_dir(".."); | ||
#[cfg(not(target = "wasi"))] | ||
let result: Result<(), String> = Err("placeholder".to_string()); | ||
println!( | ||
"Reading the parent directory was okay? {:?}", | ||
result.is_ok() | ||
); | ||
} |
Binary file not shown.