mate-desktop / engrampa

A file archiver for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
108 stars 52 forks source link

Engrampa/file-roller follows directory symlinks #13

Open ghost opened 11 years ago

ghost commented 11 years ago

A CLI-invoked tar will store all symlinks as symlinks in the archive. For symlinks to directories this means that the contents of the linked-to directory are NOT included. Extracting such an archive will create an exact copy of the original directories/files structure - the symlinks are still symlinks.

When creating an archive engrampa/file-roller follows directory symlinks and includes the contents of the linked-to directories. The layouts of the resulting tars differ depending on the engrampa/file-roller version and the way it was invoked. Extracting some of these tars fails half-way through with tar errors, the other tars extract without messages. In all cases the extracts are NOT exact copies of the original directories/files structures - the directory symlinks are changed to normal directories containing the contents of the original linked-to directories. The symlinks to files are still symlinks.

Normally I build my kernels on Slackware Current. To compress /lib/modules/$KERNEL-VERSION I invoke ark 2.6.4 (using Trinity 3.5.13.1). The resultant tar.xz is 21.0 MB. As an experiment I also built a kernel on Salix 14.0. After invoking engrampa 1.4.0 I noticed that the resultant tar.xz was 50+ MB and still growing. The display showed that it was including files from /usr/src/linux-$VERSION. Obviously the /lib/modules/$KERNEL-VERSION/{build,source} directory symlinks were followed and their contents included.

A more managable recreation is as follows: 1) In a working directory create a directory "A" with a file "A.txt" in it. Likewise create a directory "B" with a file "B.txt" in it. Then in "A" create a symlink to "../B". 2) From the working directory issue "tar cvzf A.tar.gz A ; tar tvf A.tar.gz" : things are as expected. 3) In Thunar rightclick on the "A" directory choose "Create Archive..." to create an "AA.tar.gz" archive. Then issue "tar tvf AA.tar.gz" and see that the "B.txt" file is included as well. 4) Create an empty directory "Z" and try to extract the "AA.tar.gz" archive in it : the untar fails with "tar: A/A.lnk/B.txt: Cannot open: Not a directory".

engrampa

Actually things are even more complicated. Instead of going via Thunar (step 3 above) I invoked engrampa via the Start > Accessories > Archive Manager, created a new archive (AAA.tar.gz) and added the "A" directory to it. The layout of the resultant archive is different from that of the "AA" one. Extracting the archive gave no errors. In the extract the "A.lnk" is a normal directory with "B.txt" as a file.

See http://forums.mate-desktop.org/viewtopic.php?f=2&t=1430 for more details.

I tested different compression methods and saw the same symptoms. I tested different versions of engrampa/file-roller *) and saw comparable symptoms. In other words: the problem is generic to engrampa/file-roller.

*) Tested were: -- engrampa 1.4.0 on Mint Mate 14 -- file-roller 3.4.1 on Xubuntu 12.04 -- file-roller 3.6.1.1 on PartedMagic 2012_12_16.

Please advise. Kind regards, Dick

Nephiel commented 7 years ago

Still experiencing this issue with Engrampa 1.8.1.