Bug 1313677 - timelocal() thinks the year 2100 is a leap year
Summary: timelocal() thinks the year 2100 is a leap year
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: perl
Version: 5.11
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: perl-maint-list
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-02 08:09 UTC by Karsten Weiss
Modified: 2017-04-18 21:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-18 21:56:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Upstream fix ported to perl-5.8.8 (4.32 KB, patch)
2016-03-09 15:00 UTC, Petr Pisar
no flags Details | Diff

Description Karsten Weiss 2016-03-02 08:09:37 UTC
Description of problem:

perl's timelocal() thinks the year 2100 is a leap year but it is not.

2100 is divisible by 100 but not by 400.

Version-Release number of selected component (if applicable):

perl-5.8.8-43.el5_11

How reproducible:


Steps to Reproduce:
1. /usr/bin/perl -e 'use Time::Local; printf("%s\n", timelocal(0, 10, 10, 29, 2-1, 2100));'
2.
3.

Actual results:

"4107575400"

Expected results:

"Day '29' out of range 1..28 at -e line 1."

Additional info:

RHEL 6.7 and 7.2 are fine.

Comment 1 Petr Pisar 2016-03-02 09:37:40 UTC
Thank you for the report. If this issue is serious for you, please contact Red Hat support. Only this way it gets proper attention from management approving fixes for so old piece of software as RHEL 5 is.

Comment 2 Petr Pisar 2016-03-09 13:38:06 UTC
This was fixed in upstream with commits:

commit 447c14e7f0e515ee6cffca2bfbae6b3939302c68
Author: Dave Rolsky <autarch>
Date:   Sun Jan 21 16:15:37 2007 +0000

    Fix leap year calculations in Time::Local so they work outside of
    32-bit epoch range.

commit e6b6ec4dfc86ff6c5e56706950e81a18059b68e5
Author: Dave Rolsky <autarch>
Date:   Wed Jan 24 02:59:56 2007 +0000

    Fix major leap-year brokenness.

and a minor fix for tests on platforms with unsigned epoch value:

commit d9722d455d5b8d5aa524df3358ba5ccc2ed3d424
Author: Dave Rolsky <autarch>
Date:   Mon Jan 22 15:42:55 2007 +0000

    Fix test count on platforms that don't support negative epochs.

commit bb5afc9de848f95125a7786d0f9e6183cff99041
Author: Dave Rolsky <autarch>
Date:   Thu Jan 25 19:20:49 2007 +0000

    Fix the test count for Win32 and other annoying platforms.

Comment 3 Petr Pisar 2016-03-09 15:00:46 UTC
Created attachment 1134556 [details]
Upstream fix ported to perl-5.8.8

Comment 4 Chris Williams 2017-04-18 21:56:22 UTC
Red Hat Enterprise Linux 5 shipped it's last minor release, 5.11, on September 14th, 2014. On March 31st, 2017 RHEL 5 exited Production Phase 3 and entered Extended Life Phase. For RHEL releases in the Extended Life Phase, Red Hat  will provide limited ongoing technical support. No bug fixes, security fixes, hardware enablement or root-cause analysis will be available during this phase, and support will be provided on existing installations only.  If the customer purchases the Extended Life-cycle Support (ELS), certain critical-impact security fixes and selected urgent priority bug fixes for the last minor release will be provided.  For more details please consult the Red Hat Enterprise Linux Life Cycle Page:
https://access.redhat.com/support/policy/updates/errata

This BZ does not appear to meet ELS criteria so is being closed WONTFIX. If this BZ is critical for your environment and you have an Extended Life-cycle Support Add-on entitlement, please open a case in the Red Hat Customer Portal, https://access.redhat.com ,provide a thorough business justification and ask that the BZ be re-opened for consideration of an errata. Please note, only certain critical-impact security fixes and selected urgent priority bug fixes for the last minor release can be considered.


Note You need to log in before you can comment on or make changes to this bug.