GNOME Bugzilla – Bug 686061
does not extract hardlinks from a tarball
Last modified: 2012-10-13 14:10:12 UTC
file-roller 3.6.0 does not extract hardlinks from a tarball. It only extracts one of the hardlinked files, and silently skips other hardlinks from the archive. Prepare an archive with hardlinks: $ mkdir file-roller-archive $ touch file-roller-archive/a $ ln file-roller-archive/a file-roller-archive/b $ ls -lh file-roller-archive total 0 -rw-r--r-- 2 blino blino 0 Oct 13 00:56 a -rw-r--r-- 2 blino blino 0 Oct 13 00:56 b $ tar cvvf file-roller-archive.tar file-roller-archive/ drwxr-xr-x blino/blino 0 2012-10-13 00:56 file-roller-archive/ -rw-r--r-- blino/blino 0 2012-10-13 00:56 file-roller-archive/b hrw-r--r-- blino/blino 0 2012-10-13 00:56 file-roller-archive/a link to file-roller-archive/b Now extract the archive with file-roller, keeping directory structure. $ rm -rf file-roller-archive $ file-roller file-roller-archive.tar $ ls -lh file-roller-archive total 0 -rw-r--r-- 1 blino blino 0 Oct 13 00:56 b The "a" hardlinked file is missing. The tar utility correctly extracts both hardlinked files: $ rm -rf file-roller-archive $ tar xvvf file-roller-archive.tar drwxr-xr-x blino/blino 0 2012-10-13 00:56 file-roller-archive/ -rw-r--r-- blino/blino 0 2012-10-13 00:56 file-roller-archive/b hrw-r--r-- blino/blino 0 2012-10-13 00:56 file-roller-archive/a link to file-roller-archive/b $ ls -lh file-roller-archive total 0 -rw-r--r-- 2 blino blino 0 Oct 13 00:56 a -rw-r--r-- 2 blino blino 0 Oct 13 00:56 b
This seems to happen in the libarchive code, using libarchive-3.0.4
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Confirmed it works with your 3 last patches, both with my simplified test case and with a more complicated archive having a file hardlinked 4 times (p4v.tgz from perforce.com). Thank you very much for fixing it so fast!