Split a sandbox path into (`parent_directory`, basename). Examples: `"/sandbox/.bashrc"` -> `("/sandbox", ".bashrc")` `"/sandbox/sub/file"` -> `("/sandbox/sub", "file")` `"file.txt"` -> `(".", "file.txt")`
(path: &str)
| 805 | /// `"/sandbox/sub/file"` -> `("/sandbox/sub", "file")` |
| 806 | /// `"file.txt"` -> `(".", "file.txt")` |
| 807 | fn split_sandbox_path(path: &str) -> (&str, &str) { |
| 808 | match path.rfind('/') { |
| 809 | Some(0) => ("/", &path[1..]), |
| 810 | Some(pos) => (&path[..pos], &path[pos + 1..]), |
| 811 | None => (".", path), |
| 812 | } |
| 813 | } |
| 814 | |
| 815 | /// Writable root inside every sandbox. Used as the boundary for path-traversal |
| 816 | /// checks on sandbox-side source paths in download flows. |
no outgoing calls
no test coverage detected