aonez / Keka

The macOS & iOS file archiver
https://www.keka.io
4.72k stars 237 forks source link

ZIP extraction containing backwards slashes \ in path names #1502

Open strauhmanis opened 3 weeks ago

strauhmanis commented 3 weeks ago

Hello Jorge,

Configuration

Describe the bug

Keka incorrectly extracts paths / folders.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://github.com/Tranquiliti/CustomizableStarSystems/releases
  2. Download CustomizableStarSystems-v2.1.0.zip
  3. Extract the file with Keka
  4. See error

Expected behavior

Keka should extract the paths / folders in the same way as does macOS built-in Archive Utility.

Screenshots

See the attached screenshots of the archive extracted both with Keka and the Archive Utility.

Thank you Keka macOS14

gingerbeardman commented 3 weeks ago

Interesting!

% file CustomizableStarSystems-v2.1.0.zip 
CustomizableStarSystems-v2.1.0.zip: Zip archive data, at least v2.0 to extract, compression method=store

These fail for me:

This fails in a different way

These work:

aonez commented 2 weeks ago

This is fixed in the 2.1.1 release of CustomizableStarSystems. The issue is in the ZIP itself that is using backwards slashes \ instead of forward slashes / in the path names. As stated in the APPNOTE.txt:

   4.4.17 file name: (Variable)

       4.4.17.1 The name of the file, with optional relative path.
       The path stored MUST NOT contain a drive or
       device letter, or a leading slash.  All slashes
       MUST be forward slashes '/' as opposed to
       backwards slashes '\' for compatibility with Amiga
       and UNIX file systems etc.  If input came from standard
       input, there is no file name field. 

The bundled archiver and MacZip are converting those slashes. This can have unexpected results, even if in this case "fixed" the bad crafted ZIP file.