Bug 2058964 - glibc: strptime fails to parse date with %z suffix [NEEDINFO]
Summary: glibc: strptime fails to parse date with %z suffix
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.9
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: glibc team
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-27 09:29 UTC by Spongman
Modified: 2023-07-18 14:17 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-04 14:27:13 UTC
Target Upstream Version:
Embargoed:
fweimer: needinfo? (piersh)


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-113919 0 None None None 2022-02-27 09:35:34 UTC
Sourceware 17886 0 P2 RESOLVED strptime should be able to parse "Z" as a timezone with %z 2022-02-27 14:34:49 UTC

Description Spongman 2022-02-27 09:29:02 UTC
$ cat a.c
#define _XOPEN_SOURCE
#include <stdio.h>
#include <time.h>

int main() {
    struct tm tm_ = {0};
    puts(strptime("20010203T040506Z", "%Y%m%dT%H%M%S%z", &tm_) ? "ok" : "error");
}

$ gcc a.c
$ ldd a.out
        linux-vdso.so.1 =>  (0x00007ffd09585000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fb67529a000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb675667000)
$ ls -l /lib64/libc.so.6
lrwxrwxrwx. 1 root root 12 Jun 21  2019 /lib64/libc.so.6 -> libc-2.17.so
$ ./a.out
error

this works on Debian 10.11 and Ubuntu 20.04

Comment 3 Florian Weimer 2022-02-27 14:34:49 UTC
Have you filed a customer support ticket for this issue?

  https://access.redhat.com/support/cases/

Thanks.

Red Hat Enterprise Linux 7 is in Maintenance Support 2 Phase:

  https://access.redhat.com/support/policy/updates/errata#Maintenance_Support_2_Phase

During this phase, only “Critical and Importantix impact Security Advisories (RHSAs) and selected (at Red Hat discretion) Urgent Priority Bug Fix Advisories (RHBAs)” are expected to be released, and this request for enhancement does not seem to fall under either category.


For context, this was fixed upstream in this commit:

commit 900f33e23eaa20c0587f5a191b632a606e7fba5d
Author: Vincent Bernat <Vincent.Bernat>
Date:   Thu Sep 17 09:55:04 2015 +0200

    time: in strptime(), make %z accept Z as a time zone [BZ #17886]
    
    In ISO 8601, the timezone can be 'Z' instead of using
    digits. 2014-08-17T12:33:12+0000 is often expressed as
    2014-08-17T12:33:12Z.

It made it into glibc 2.23, so it's not included in Red Hat Enterprise Linux 7, which is based on glibc 2.17.

Comment 5 Carlos O'Donell 2022-03-04 14:27:13 UTC
Red Hat Enterprise Linux 7 is in Maintenance Support 2 Phase and as such we are not considering moderate priority fixes.

Please consider Red Hat Enterprise Linux 8 since the bug is fixed in that release.

I'm marking this CLOSED/WONTFIX.


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