fix(cli): allows extracting files without separate directory entries

Some zip files do not list directories separately from files. For example, a zip might contain `dir/file.txt` without a corresponding entry for just `dir/`. This should be okay, so we just create the leading paths for the files we extract as necessary.

Also adds tests for the expected and dangerous path cases of `extract_zip`.
This commit is contained in:
Brian Donovan committed 2023-08-04 21:28:09 -07:00
1 parent 14e7c50478
commit 03e02591ec
4 files changed
+56 -2

No files matched your search

+3
View File
@@ -97,3 +97,6 @@ plugin = ["mlua"]
[[bin]]
path = "src/main.rs"
name = "dx"
[dev-dependencies]
tempfile = "3.3"