Materialize `opened`'s view into a fresh directory, as a sandbox does: every entry through the kernel's path-checked writer, then the cache.
(host: &Host, opened: &SandboxOpened)
| 448 | /// Materialize `opened`'s view into a fresh directory, as a sandbox does: |
| 449 | /// every entry through the kernel's path-checked writer, then the cache. |
| 450 | fn materialize(host: &Host, opened: &SandboxOpened) -> Vm { |
| 451 | let dir = TempDir::new().unwrap(); |
| 452 | let root = dir.path().join("work"); |
| 453 | std::fs::create_dir_all(&root).unwrap(); |
| 454 | let root = root.canonicalize().unwrap(); |
| 455 | let (entries, skeleton) = materialize_into(host, &opened.token, &root); |
| 456 | let cache = adopt(host, opened, &root, &skeleton); |
| 457 | Vm { |
| 458 | _dir: dir, |
| 459 | root, |
| 460 | cache, |
| 461 | entries, |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | fn materialize_into(host: &Host, token: &[u8], root: &Path) -> (u64, SandboxSkeleton) { |
| 466 | materialize_prefix_into(host, token, root, None) |
no test coverage detected