From 0f4fafe701e6a439056fd6a6456d6c1fb7bf5088 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Fri, 9 Oct 2026 19:00:54 +0000 Subject: [PATCH] test(portal): point the relative escape link at the planted directory The relative link in the race test climbed one level too high, so it pointed at a directory that does not exist and could not catch a read that left the granted directory. --- crates/weft-file-portal/src/main.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/weft-file-portal/src/main.rs b/crates/weft-file-portal/src/main.rs index ecbace2..5becfcb 100644 --- a/crates/weft-file-portal/src/main.rs +++ b/crates/weft-file-portal/src/main.rs @@ -385,7 +385,8 @@ fn write(root: &Root, rest: &Path, data: &[u8]) -> Result { .map_err(Response::err)?; static NEXT: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); // Unique within this portal by the counter, and across restarts by the - // start time, so a file left by an earlier instance does not collide. + // time of its first write, so a file left by an earlier instance does + // not collide. static STARTED: std::sync::OnceLock = std::sync::OnceLock::new(); let started = STARTED.get_or_init(|| { std::time::SystemTime::now() @@ -620,11 +621,7 @@ mod tests { let swapper = { let (granted, outside, stop) = (granted.clone(), dir.join("outside"), stop.clone()); std::thread::spawn(move || { - let targets = [ - PathBuf::from("real"), - outside, - PathBuf::from("../../outside"), - ]; + let targets = [PathBuf::from("real"), outside, PathBuf::from("../outside")]; for target in targets.iter().cycle() { if stop.load(std::sync::atomic::Ordering::Relaxed) { break;