Skip Menu |

This queue is for tickets about the IO-Compress-Zlib CPAN distribution.

Report information
The Basics
Id: 124545
Status: resolved
Priority: 0/
Queue: IO-Compress-Zlib

People
Owner: Nobody in particular
Requestors: bitcardbmw [...] lsmod.de
Cc:
AdminCc:

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



same as https://rt.cpan.org/Public/Bug/Display.html?id=124512 Please review/test/merge the below patch (not tested because of unrelated build problems) --- IO-Compress-Zlib-2.015.orig/lib/IO/Uncompress/Unzip.pm +++ IO-Compress-Zlib-2.015/lib/IO/Uncompress/Unzip.pm @@ -699 +699 @@ sub _dosToUnixTime - my $year = ( ( $dt >> 25 ) & 0x7f ) + 80; + my $year = ( ( $dt >> 25 ) & 0x7f ) + 1980;
On Fri Feb 23 09:14:01 2018, bmwiedemann wrote: Show quoted text
> same as > https://rt.cpan.org/Public/Bug/Display.html?id=124512 > > Please review/test/merge the below patch > (not tested because of unrelated build problems) > > --- IO-Compress-Zlib-2.015.orig/lib/IO/Uncompress/Unzip.pm > +++ IO-Compress-Zlib-2.015/lib/IO/Uncompress/Unzip.pm > @@ -699 +699 @@ sub _dosToUnixTime > - my $year = ( ( $dt >> 25 ) & 0x7f ) + 80; > + my $year = ( ( $dt >> 25 ) & 0x7f ) + 1980;
Thanks for the patch. Turns out that it isn't needed for this module because I use POSIX::mktime to convert the DOS time into Unix time. The issue existed in Archive::Zip because it uses Time::Local::timelocal. Below is the relevant part that refers to how the year is handled by mktime. The year ("year") is given in years since 1900; i.e., the year 1995 is 95; the year 2001 is 101.
Subject: Re: [rt.cpan.org #124545]
Date: Fri, 2 Mar 2018 18:52:04 +0000
To: bug-IO-Compress-Zlib [...] rt.cpan.org
From: "Bernhard M. Wiedemann" <bernhardout [...] lsmod.de>
On 2018-03-01 08:54, Paul Marquess via RT wrote: Show quoted text
> Thanks for the patch. Turns out that it isn't needed for this > module because I use POSIX::mktime to convert the DOS time into > Unix time. The issue existed in Archive::Zip because it uses > Time::Local::timelocal.
but IO-Compress-Zlib-2.015/lib/IO/Uncompress/Unzip.pm line 695 says use Time::Local 'timelocal'; and there is no mention of 'mktime' in the whole IO-Compress-Zlib-2.015/ directory - are we looking at different places?
On Fri Mar 02 14:06:50 2018, bernhardout@lsmod.de wrote: Show quoted text
> > > On 2018-03-01 08:54, Paul Marquess via RT wrote:
> > Thanks for the patch. Turns out that it isn't needed for this > > module because I use POSIX::mktime to convert the DOS time into > > Unix time. The issue existed in Archive::Zip because it uses > > Time::Local::timelocal.
> > but IO-Compress-Zlib-2.015/lib/IO/Uncompress/Unzip.pm line 695 says > > use Time::Local 'timelocal'; > > > and there is no mention of 'mktime' in the whole > IO-Compress-Zlib-2.015/ directory - are we looking at different places?
Hey Bernhard we are indeed looking in different places! The IO-Compress-Zlib distribution was retired in 2008. Everything was moved over to the IO-Compress module - and that's what is shipped with core Perl. Sorry, I didn't spot that you have raised the issue with a retired distribution. thanks Paul