From 7f3ccd722c261974852da858a7af0e069178a744 Mon Sep 17 00:00:00 2001 From: Frando Date: Wed, 2 Jul 2025 10:33:03 +0200 Subject: [PATCH] fix: create parent dir when exporting from mem store --- src/store/mem.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/store/mem.rs b/src/store/mem.rs index df9783ab..94033eee 100644 --- a/src/store/mem.rs +++ b/src/store/mem.rs @@ -745,6 +745,15 @@ async fn export_path_impl( tx: &mut mpsc::Sender, ) -> io::Result<()> { let ExportPathRequest { target, .. } = cmd; + if !target.is_absolute() { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + "path is not absolute", + )); + } + if let Some(parent) = target.parent() { + std::fs::create_dir_all(parent)?; + } // todo: for partial entries make sure to only write the part that is actually present let mut file = std::fs::File::create(target)?; let size = entry.0.state.borrow().size();