zhanghai / zhanghai/MaterialFiles
Extracting creates a directory even when not needed
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 9k
- Forks
- 736
- PR merge metrics
- No merged PRs in 30d
Description
Extracting archives from the context menu (three dots) causes Material Files to create a separate directory in the target location (presumably for tarbomb protection), even if there's only file (plain or directory) in the archive. This behavior can be confusing to users (have had a confused user report this to me).
Reproducing
-
Download the examples onto your device.
single_file.zip: Contains a single file namedfoosingle_dir.zip: Contains a single directory namedfoo, which contains filesfooandbar.
As you can see, neither example is a tarbomb.
-
In Material Files, open the context menu for each and extract them somewhere.
Observed behavior
The following directory structure for extracted single_file.zip:
single_file(directory)foo
The following directory structure for extracted single_dir.zip:
single_dir(directory)foo(directory)foobar
Expected behavior
The following directory structure for extracted single_file.zip:
foo
The following directory structure for extracted single_dir.zip:
foo(directory)foobar
For actual tarbombs, the behavior should remain as it is.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the context-menu extraction flow and reproduce the behavior with the supplied single_file.zip and single_dir.zip examples. Compare extraction handling for archives with one top-level file or directory against actual tarbombs; done means the two examples extract directly while tarbomb protection remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100