2

I zipped the public folder inside a shared hosting file system, using the command:

zip -r file.zip ../public

and it created a file.zip in the private directory.

I then downloaded the file.zip and using FTP copied it into another site using the same file structure and tried to unzip it.

The unzipping won't work, it gives a message skipping insecure entry for every file.

What is the cause of this and how do I successfully unzip the files?

  • The so-called insecure entries all start with “..”, is that right? – dhag Oct 6 '17 at 22:59
  • yes. They all start with "../public/" – Osama Alsadi Oct 7 '17 at 2:10
1

The only option in the man page I see that might allow this is -^. You should have created the zip with zip -r private/file.zip public from the parent directory directory, instead of from the private directory.

0

zip is skipping all entries in the archive because extracting them would write to the parent directory.

The zip utility stores the file path along with the file content in the archives that it creates, and you archived files in ...

Unpacking the archive is considered "unsafe" as it may have unwanted or surprising consequences.

Create the archive again, but this time from the parent directory of the directory that you are archiving.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.