Bug 335411 - hardlinks arent handled correctly
Summary: hardlinks arent handled correctly
Status: CONFIRMED
Alias: None
Product: ark
Classification: Applications
Component: plugins (show other bugs)
Version: 2.19
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Ragnar Thomsen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-27 12:36 UTC by lasse.schuirmann
Modified: 2016-03-10 10:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lasse.schuirmann 2014-05-27 12:36:03 UTC
Hardlinks seem not to be handled correctly.

See this bug report: https://code.google.com/p/libarchive/issues/detail?id=362

More information about hardlinks and libarchive:
https://github.com/libarchive/libarchive/wiki/Hardlinks

We have this problem also on gnome-boxes and Gnomes file-roller. I'll post the links to the appropriate bug reports once they exist; no need for double work.
(This problem occurs also with nome-oxes and Gnome file-roller

Reproducible: Always

Steps to Reproduce:
1. Download http://download.fedoraproject.org/pub/fedora/linux/releases/20/Fedora/x86_64/iso/Fedora-20-x86_64-DVD.iso
2. Open the ISO
3. Try to extract /isolinux/initrd.img (link to images/pxeboot/initrd.img)
Actual Results:  
An error occurs.

Expected Results:  
Should extract the linked file images/pxeboot/initrd.img
Comment 1 lasse.schuirmann 2014-05-27 12:40:03 UTC
See also:
https://bugzilla.gnome.org/show_bug.cgi?id=730818
https://bugzilla.gnome.org/show_bug.cgi?id=720741
as they have the same problem.
Comment 2 lasse.schuirmann 2015-05-04 07:41:33 UTC
Please note that I solved the hardlink problem for GNOME Boxes in vala, see https://bug730640.bugzilla-attachments.gnome.org/attachment.cgi?id=282158 for my code. Would probably just need simple translation from vala to whateveryouuse for this to work in ark. (Just grep for hardlink in the source.)
Comment 3 Raphael Kubo da Costa 2015-05-17 13:31:25 UTC
Hi Lasse,

Thanks for the report. By "an error occurs" I guess you mean Ark currently silently fails to extract anything in the steps you've described, right?

I'm not sure I agree that the expected result should be that the destination file should be extracted though; I'm tending to just follow what both libarchive's bsdtar and GNU tar do and show an error message if one tries to extract a hard link without extracting the destination as well.
Comment 4 lasse.schuirmann 2015-05-18 14:38:42 UTC
(In reply to Raphael Kubo da Costa from comment #3)
> Hi Lasse,
> 
> Thanks for the report. By "an error occurs" I guess you mean Ark currently
> silently fails to extract anything in the steps you've described, right?

Correct.

> I'm not sure I agree that the expected result should be that the destination
> file should be extracted though; I'm tending to just follow what both
> libarchive's bsdtar and GNU tar do and show an error message if one tries to
> extract a hard link without extracting the destination as well.

Well IIRC essentially on the filesystem a hardlink shouldn't differ from the real file so from that perspective there is no difference between the "original" and the "hardling", this difference gets only introduced when packing it into the archive. So IMO that should mirrored back to the filesystem as it was originally.