Skip Menu |

This queue is for tickets about the Archive-Tar CPAN distribution.

Report information
The Basics
Id: 2485
Status: resolved
Priority: 0/
Queue: Archive-Tar

People
Owner: Nobody in particular
Requestors: imacat [...] mail.imacat.idv.tw
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.23
Fixed in: (no value)



Subject: Archive::Tar Does Not Handle A Proper Hard Link Name
Dear Jos Boumans, Hi. This is imacat. I found a bug in your Archive-Tar (0.23) that does not handle a proper hard link name. In your Archive/Tar/Std.pm line 133, you have: link $entry->{linkname}, $file or $^W && carp ("Hard linking ", $entry->{linkname}, " to ", $entry->{name}, ", failed.\n"); At that time cwd is the directory of that processing file, but $entry->{linkname} is a relative path to the archive root. This link doomed to fail. To fix it, I suggest either turn $entry->{linkname} to absolute, or temporary move back to the archive root to do the "link". Sorry, I don't know how to do this in simple in the current Archive-Tar, so I did not include a patch for this. It's better to leave this to you. ^^; I found this problem while I was working on my Locale::Maketext::Gettext. I mistakenly included 2 hard link test suite files in my release, and CPAN testers report failures. I tried several platforms but still unable to reproduce that error. Finally I notice that CPAN tester uses CPANPLUS, CPANPLUS uses Archive-Tar, and the test suite hard link files are not extracted from Archive-Tar. It's my mistake to include these hard links files in my release. But This hard link problem should also be reported and be fixed in Archive-Tar.
Date: Sat, 3 May 2003 11:51:29 +0200
Subject: Re: [cpan #2485] Archive::Tar Does Not Handle A Proper Hard Link Name
From: "Jos I. Boumans" <kane [...] dwim.org>
To: bug-Archive-Tar [...] rt.cpan.org
RT-Send-Cc:
On Saturday, May 3, 2003, at 09:23 Europe/Amsterdam, Guest via RT wrote: Show quoted text
> I found a bug in your Archive-Tar (0.23)
which means it was in 0.22 for 3 years ;) Archive::Tar 0.23 is just a 'quick fix' on 0.22 -- all it does is fall back to archive::tar 0.076 on Win32, since the Fcntl macros used in 0.22 don't exist on win32. Show quoted text
> At that time cwd is the directory of that processing file, but > $entry->{linkname} is a relative path to the archive root. This link > doomed to fail.
I've been working on a new, and totally rewritten version of archive::tar that is less errorprone. You can find it on the CPAN, as version 0.99_05: http://search.cpan.org/author/KANE/Archive-Tar/lib/Archive/Tar.pm please be so kind to see if the problem you are having still persists in 0.99_05, and if so send me a test case that excercises the problem so i can fix it for the next release. Regards, -- Jos Boumans "You know you are never more indignant in life than when you're shopping at a store you feel is beneath you and one of the other customers mistakes you for one of the employees of that store." - Dennis Miller CPANPLUS http://cpanplus.sf.net
Actually, it turns out that only Archive::Tar->extract_archive wasn't handling the hardlinks properly. $tar->extract would have done the right thing. The patch that fixes this is the following: ==== //member/kane/archive-tar-new/lib/Archive/Tar.pm#23 - /Users/kane/p4/ other/archive-tar-new/lib/Archive/Tar.pm ==== 287c287,288 < $self->_extract_file( $entry ) if $extract && $entry->is_file; --- Show quoted text
> $self->_extract_file( $entry ) if $extract && !$entry->is_longlink > && !$entry->is_unknown && !$entry->is_label;
which will of course be in 0.99_06 when it's released.