about summary refs log tree commit diff
path: root/tvix/glue/src/tvix_store_io.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-12-31T16·54+0200
committerclbot <clbot@tvl.fyi>2024-01-01T00·52+0000
commitfdd7817aad18346197a521593bdafdae4045aeb6 (patch)
tree8fe76c1d68966eb88a7ca175a9038004eee9583c /tvix/glue/src/tvix_store_io.rs
parent20c98a51bf36ff6e74c4e62275ff31e7c43802c3 (diff)
feat(nix-compat/store_path): build_ca_path may fail r/7299
Change-Id: Ia74ee870f38b7966501458bace541092256c3213
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10509
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/glue/src/tvix_store_io.rs')
-rw-r--r--tvix/glue/src/tvix_store_io.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/tvix/glue/src/tvix_store_io.rs b/tvix/glue/src/tvix_store_io.rs
index 41cae97ebf52..5c255d5a30c3 100644
--- a/tvix/glue/src/tvix_store_io.rs
+++ b/tvix/glue/src/tvix_store_io.rs
@@ -326,7 +326,12 @@ async fn import_path_with_pathinfo(
         .to_str()
         .expect("path must be valid unicode");
 
-    let output_path = store_path::build_nar_based_store_path(&nar_sha256, name);
+    let output_path = store_path::build_nar_based_store_path(&nar_sha256, name).map_err(|_| {
+        std::io::Error::new(
+            std::io::ErrorKind::InvalidData,
+            format!("invalid name: {}", name),
+        )
+    })?;
 
     // assemble a new root_node with a name that is derived from the nar hash.
     let root_node = root_node.rename(output_path.to_string().into_bytes().into());