Skip Menu |
 

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

Report information
The Basics
Id: 115258
Status: new
Priority: 0/
Queue: Archive-Zip

People
Owner: Nobody in particular
Requestors: dwheeler [...] cpan.org
Cc:
AdminCc:

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



MIME-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
X-Spam-Status: No, score=-2.867 tagged_above=-99.9 required=10 tests=[AWL=-0.967, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1] autolearn=ham
X-Mailer: Apple Mail (2.3124)
X-Spam-Flag: NO
Message-ID: <51CBE982-C94F-4AF4-A33E-8FC6DE079B0A [...] cpan.org>
content-type: text/plain; charset="utf-8"
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -2.867
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 90D4C2401FB for <cpan-bug+Archive-Zip [...] hipster.bestpractical.com>; Sat, 11 Jun 2016 03:15:25 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uaxICve2r-IQ for <cpan-bug+Archive-Zip [...] hipster.bestpractical.com>; Sat, 11 Jun 2016 03:15:24 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id E93F8240114 for <bug-Archive-Zip [...] rt.cpan.org>; Sat, 11 Jun 2016 03:15:23 -0400 (EDT)
Received: (qmail 27081 invoked by alias); 11 Jun 2016 07:15:23 -0000
Received: from pb-smtp2.pobox.com (HELO sasl.smtp.pobox.com) (64.147.108.71) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sat, 11 Jun 2016 00:15:13 -0700
Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 6CEF524F9E for <bug-Archive-Zip [...] rt.cpan.org>; Sat, 11 Jun 2016 03:15:07 -0400 (EDT)
Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 6442824F9D for <bug-Archive-Zip [...] rt.cpan.org>; Sat, 11 Jun 2016 03:15:07 -0400 (EDT)
Received: from [10.0.1.11] (unknown [73.164.241.57]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id BDE4A24F9C for <bug-Archive-Zip [...] rt.cpan.org>; Sat, 11 Jun 2016 03:15:06 -0400 (EDT)
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] pobox.com
Delivered-To: cpan-bug+Archive-Zip [...] hipster.bestpractical.com
Subject: extractToFileNamed Fails for Symlink to Directory
Return-Path: <dwheeler [...] cpan.org>
X-RT-Mail-Extension: archive-zip
X-Original-To: cpan-bug+Archive-Zip [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from :content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; s=sasl; bh=dO51pucXfmYaABFT05s10efyFow=; b=WqZ 0kBQAQXsueIdbhOQhKkxMn3gHhBMIs0tkQJPrBmr5GBfMXBSU+npdr5AxB2M63UR YQvuOwCGM8GMrU1MZM6s/rAeqJe6NKtQW0NQIipcm0mKeGr+Xbx+05VzGhR87NSk NeCsMWbuQo0Ji2guoEzqmOWIH5qgFgCirsBX+XB4=
Date: Sat, 11 Jun 2016 00:15:04 -0700
X-Spam-Level:
To: bug-Archive-Zip [...] rt.cpan.org
X-Pobox-Relay-ID: 399976FA-2FA4-11E6-BE3A-EE617A1B28F4-76319746!pb-smtp2.pobox.com
Content-Transfer-Encoding: quoted-printable
From: "David E. Wheeler" <dwheeler [...] cpan.org>
X-RT-Original-Encoding: utf-8
X-RT-Interface: Email
Content-Length: 2023
Download (untitled) / with headers
text/plain 1.9k
Given the script below, if you download and run it on this file: http://api.pgxn.org/dist/cat_tools/0.1.0/cat_tools-0.1.0.zip You’ll see warnings like this: binmode() on closed filehandle GEN69 at /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/darwin-2level/IO/File.pm line 199. print() on closed filehandle GEN69 at /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/darwin-2level/IO/Handle.pm line 420. IO error: write error during copy : Bad file descriptor at /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Archive/Zip/Member.pm line 1107. Archive::Zip::Member::_writeData(Archive::Zip::ZipFileMember=HASH(0x7ffc6c9d3918), IO::File=GLOB(0x7ffc6c02c388)) called at /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Archive/Zip/Member.pm line 1033 Archive::Zip::Member::extractToFileHandle(Archive::Zip::ZipFileMember=HASH(0x7ffc6c9d3918), IO::File=GLOB(0x7ffc6c02c388)) called at /Users/david/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Archive/Zip/Member.pm line 498 Archive::Zip::Member::extractToFileNamed(Archive::Zip::ZipFileMember=HASH(0x7ffc6c9d3918), "/var/folders/zb/_t6g74x117qb5yq9tpqd259r0000gq/T/nbCmm9gICo/c"...) called at /Users/david/bin/try line 21 It appears to choke on the symlink `cat_tools-0.1.0/test/pgxntool`, which points to a directory within the zip file, `../pgxntool/test/pgxntool`. Maybe FileMember needs some smarts for handling a symlink to a directory? Here’s the script: #!/usr/bin/env perl -w use v5.20; use warnings; use utf8; use Archive::Zip qw(:ERROR_CODES); use File::Temp qw(tempdir); use File::Spec::Functions qw(catfile); my $file = shift or die "Usage: $0 ZIPFILE\n"; my $zip = Archive::Zip->new; if ($zip->read($file) != AZ_OK) { die "Error reading $file\n"; } my $dest_dir = tempdir; foreach my $member ($zip->members) { my $fn = catfile $dest_dir, split m{/} => $member->fileName; if ($member->extractToFileNamed($fn) != AZ_OK) { die "Error extracting $file\n"; } }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.