diff options
Diffstat (limited to 'src/sandbox/loopback.rs')
| -rw-r--r-- | src/sandbox/loopback.rs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/sandbox/loopback.rs b/src/sandbox/loopback.rs index 8a3c229..1173562 100644 --- a/src/sandbox/loopback.rs +++ b/src/sandbox/loopback.rs @@ -19,9 +19,6 @@ impl LoopbackBackend { impl SandboxBackend for LoopbackBackend { fn acquire(&self, spec: &SandboxSpec) -> Result<Arc<dyn Sandbox>> { - // The "pool" is this machine: acquire always succeeds, instantly, and - // the TTL is a promise the loopback sandbox does not have to keep - // because there is nothing to leak — the process dies with the hub. let blobs = blob_root(&self.cfg).join(safe_name(&spec.task)); fs::create_dir_all(&blobs)?; Ok(Arc::new(LoopbackSandbox { @@ -55,9 +52,6 @@ impl Sandbox for LoopbackSandbox { if cmd.argv.is_empty() { return Err(Error::invalid("sandbox command has no argv[0]")); } - // Expand `blob:<digest>` argv elements to the staged blob's path — - // the loopback sandbox's blob dir is "inside the sandbox" as much as - // anything here is. An unstaged blob is a caller bug and fails closed. let mut argv: Vec<String> = Vec::with_capacity(cmd.argv.len()); for a in &cmd.argv { match a.strip_prefix("blob:") { @@ -79,8 +73,6 @@ impl Sandbox for LoopbackSandbox { if let Some(dir) = &cmd.cwd { c.current_dir(dir); } - // The shim protocol lives here, not in the steps: a step that cannot - // tell loopback from a remote sandbox is the property under test. self.cfg.child_env(&mut c); let out = c.output()?; on_log(&out.stdout); @@ -101,16 +93,11 @@ impl Sandbox for LoopbackSandbox { } fn destroy(&self) -> Result<()> { - // Nothing to reclaim: the sandbox is this process. Blob scratch is - // disposable staging and falls to `gc` like the rest of `staging/`. Ok(()) } } impl LoopbackSandbox { - /// Digests double as blob filenames, so they must be path-safe. The digests - /// this codebase produces are hex or `hex-sig`; anything else is a caller - /// bug (or, later, a hostile sandbox) and fails closed. fn blob_path(&self, digest: &str) -> Result<PathBuf> { if digest.is_empty() || digest.len() > 128 { return Err(Error::invalid(format!("blob digest {digest:?} is not usable"))); @@ -126,7 +113,6 @@ fn blob_root(cfg: &Config) -> PathBuf { cfg.staging_dir().join("blobs") } -/// Filesystem-safe name for a task id, same spirit as `config::slug`. fn safe_name(s: &str) -> String { s.chars() .map(|c| if c.is_ascii_alphanumeric() { c.to_ascii_lowercase() } else { '-' }) |
