Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 945048 Details for
Bug 1149375
Time::Local patch for year 2038 on 64 bit breaks timelocal
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Upstream fix ported to Time-Local-1.11 as delivered by perl-5.8.8
Time-Local-1.11-Do-not-attempt-to-extend-range-of-allowable-epoch-va.patch (text/plain), 3.69 KB, created by
Petr Pisar
on 2014-10-08 15:00:08 UTC
(
hide
)
Description:
Upstream fix ported to Time-Local-1.11 as delivered by perl-5.8.8
Filename:
MIME Type:
Creator:
Petr Pisar
Created:
2014-10-08 15:00:08 UTC
Size:
3.69 KB
patch
obsolete
>From 814715891ffc43e59c17269767a740ff78ad9e36 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> >Date: Wed, 8 Oct 2014 16:50:41 +0200 >Subject: [PATCH] Do not attempt to extend range of allowable epoch values >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This is a part of upstream commit > >commit 1c71e5bc5b789414e43c53776cc396aeeeda48fc >Author: Dave Rolsky <autarch@urth.org> >Date: Fri Mar 31 09:11:34 2006 +0000 > > revert lots of earlier changes about extending range around edges > merge warn with croak > doc tweaks to remove suggestion that nocheck versions should be used for doing datetime math > >ported to Time-Local-1.11. > >Time::Local patched to allow 64-bit time values on 64-bit platforms, see ><https://bugzilla.redhat.com/show_bug.cgi?id=1057047>, revealed a timelocal() >call produced warnings about undefined values: > >$ perl -Ilib -w -MTime::Local -e 'print timelocal(0,0,0,1,0,0), qq{\n};' >Use of uninitialized value in integer addition (+) at lib/Time/Local.pm line 81.[...] >946681200 > ><https://bugzilla.redhat.com/show_bug.cgi?id=1149375> > >Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com> >--- > lib/Time/Local.pm | 37 ++++++++++--------------------------- > 1 file changed, 10 insertions(+), 27 deletions(-) > >diff --git a/lib/Time/Local.pm b/lib/Time/Local.pm >index 199706f..30faa39 100644 >--- a/lib/Time/Local.pm >+++ b/lib/Time/Local.pm >@@ -24,27 +24,15 @@ my $Century = $NextCentury - 100; > my $SecOff = 0; > > my (%Options, %Cheat, %Min, %Max); >-my ($MinInt, $MaxInt); >+my ($MaxInt); > > if ($^O eq 'MacOS') { > # time_t is unsigned... > $MaxInt = (1 << (8 * $Config{ivsize})) - 1; >- $MinInt = 0; > } else { > $MaxInt = ((1 << (8 * $Config{ivsize} - 2))-1)*2 + 1; >- $MinInt = -$MaxInt - 1; >- >- # On Win32 (and others?) time_t appears to be signed, but negative >- # epochs still don't work. - XXX - this is experimental >- $MinInt = 0 >- unless defined ((localtime(-1))[0]); > } >- >-$Max{Day} = ($MaxInt >> 1) / 43200; >-$Min{Day} = $MinInt ? -($Max{Day} + 1) : 0; >- >-$Max{Sec} = $MaxInt - 86400 * $Max{Day}; >-$Min{Sec} = $MinInt - 86400 * $Min{Day}; >+my $MaxDay = int( ( $MaxInt - ( 86400 / 2 ) ) / 86400 ) - 1; > > # Determine the EPOC day for this machine > my $Epoc = 0; >@@ -124,16 +112,14 @@ sub timegm { > my $days = _daygm(undef, undef, undef, $mday, $month, $year); > my $xsec = $sec + $SecOff + 60*$min + 3600*$hour; > >- unless ($Options{no_range_check} >- or ($days > $Min{Day} or $days == $Min{Day} and $xsec >= $Min{Sec}) >- and ($days < $Max{Day} or $days == $Max{Day} and $xsec <= $Max{Sec})) >- { >- warn "Day too small - $days > $Min{Day}\n" if $days < $Min{Day}; >- warn "Day too big - $days > $Max{Day}\n" if $days > $Max{Day}; >- warn "Sec too small - $days < $Min{Sec}\n" if $days < $Min{Sec}; >- warn "Sec too big - $days > $Max{Sec}\n" if $days > $Max{Sec}; >- $year += 1900; >- croak "Cannot handle date ($sec, $min, $hour, $mday, $month, $year)"; >+ unless ($Options{no_range_check} or abs($days) < $MaxDay) { >+ my $msg = ''; >+ $msg .= "Day too big - $days > $MaxDay\n" if $days > $MaxDay; >+ >+ $year += 1900; >+ $msg .= "Cannot handle date ($sec, $min, $hour, $mday, $month, $year)"; >+ >+ croak $msg; > } > > no integer; >@@ -149,9 +135,6 @@ sub timegm_nocheck { > > > sub timelocal { >- # Adjust Max/Min allowed times to fit local time zone and call timegm >- local ($Max{Day}, $Max{Sec}) = _zoneadjust($Max{Day}, $Max{Sec}, $MaxInt); >- local ($Min{Day}, $Min{Sec}) = _zoneadjust($Min{Day}, $Min{Sec}, $MinInt); > my $ref_t = &timegm; > > # Calculate first guess with a one-day delta to avoid localtime overflow >-- >1.9.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1149375
:
945048
|
948549