When you try to unzip a file with relative paths above the working directory (e.g. ../../foo
), you get this message:
warning: skipped "../" path component(s) in ../../foo
inflating: foo
The issue is, our software is creating these zips with relative paths during an installation, and if the installation goes wrong, we unzip them to put everything back the way it was. If the user has elected to store some data files "above" the normal installation directory, we end up with ../datafile
in the backup. This should be perfectly fine, and we want unzip to trust the archive and put the files back if we ask. Unfortunately, I can't find an option to tell unzip
to not worry about the ../
path components and unzip the archive exactly as it was created. Is there an option to unzip to do this?
Note that changing the way the zips are created is not possible at this time, so "Don't do it that way" is not an acceptable answer. We've got to play the hand we've been given. The target platform is RHEL 5.