Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12042 closed bug (fixed)

zip and unzip do not handle symbolic links correctly

Reported by: markh Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: - General Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Problem with unzip: Trying to unzip the file attached to this ticket results in the following output:

Archive: libz.zip

linking: libz.so

error: zipfile probably corrupt (segmentation violation)

This unzips properly on BeOS. There are 2 symbolic links in the file that link to the third (real) file in the zip.

Problem with zip: Trying to create a zip with a symbolic link results in a file with only regular files. Steps to reproduce:

  • Create a folder named test
  • Create a file in this folder (for example with a simple touch command)
  • Create a symbolic link to the file
  • Zip the folder and all contents with the zip command (for example: zip -r test.zip test
  • Unzip the zipfile again.

You now have two regular files instead of one regular file with one symbolic link pointing to it.

Attachments (1)

libz.zip (38.1 KB ) - added by markh 4 years ago.

Download all attachments as: .zip

Change History (8)

by markh, 4 years ago

Attachment: libz.zip added

comment:1 by pulkomandy, 4 years ago

I think this is already fixed in the current unzip recipe in HaikuDepot, but the package in the repos is out of date.

comment:2 by markh, 4 years ago

Can this be updated, so I can test if it is fixed?

in reply to:  1 comment:3 by luroh, 4 years ago

Replying to pulkomandy:

I think this is already fixed in the current unzip recipe in HaikuDepot

Fwiw, Humdinger and I tried but failed to create x86 and x86_64 builds of unzip 6.10c11.

comment:4 by markh, 4 years ago

As a bit of extra information: Just tested this in R1/alpha4 and there it works fine.

comment:5 by korli, 4 years ago

Resolution: fixed
Status: newclosed
  1. The symptom of the problem with zip is normal. That's the standard behaviour of zip without the option -y.
  2. The unzip problem should be fixed in hrev49146.

comment:6 by markh, 4 years ago

That indeed fixes the unzip problem. Regarding the zip problem: Does zipomatic use zip to zip the files? Because it does not seem to work correctly. If I try to zip a directory using zipomatic, it only zips the file with the same name as the directory and places the resulting zipfile in the directory I wanted to zip.

comment:7 by korli, 4 years ago

See here, it uses zip with "-ry" as first argument.

Note: See TracTickets for help on using tickets.