Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Oct 2014 15:02:20 -0500
From:      Pedro Giffuni <pfg@freebsd.org>
To:        "Andrey A. Chernov" <ache@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, Antoine Brodin <antoine@freebsd.org>, David Carlier <david.carlier@hardenedbsd.org>
Subject:   New bug introduced in strptime (was Re: svn commit: r272273 - head/lib/libc/stdtime)
Message-ID:  <542C5DCC.8060406@freebsd.org>
In-Reply-To: <CAALwa8mOHXCe7xq44U6sNdSs0Arf_8hC9JQLqP4Y4=1%2Bp4spOg@mail.gmail.com>
References:  <201409282120.s8SLKLJs070469@svn.freebsd.org> <CAALwa8mOHXCe7xq44U6sNdSs0Arf_8hC9JQLqP4Y4=1%2Bp4spOg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello;

I can reproduce this. On FreeBSD 9.1 (no patch):

pfg@minotaur:~$ uname -a
FreeBSD minotaur.apache.org 9.1-RELEASE-p6 FreeBSD 9.1-RELEASE-p6 #0 
r254631: Thu Aug 22 13:59:50 UTC 2013 
root@loki.apache.org:/usr/obj/usr/src/sys/ASF  amd64

pfg@minotaur:~$ date -j -f  '%a, %e %b %Y %T %z' "Sat, 01 Aug 2009 
18:07:18 +0200" +%B
August


On my box with the patch applied:

$ date -j -f  '%a, %e %b %Y %T %z' "Sat, 01 Aug 2009 18:07:18 +0200" +%B
Failed conversion of ``Sat, 01 Aug 2009 18:07:18 +0200'' using format 
``%a, %e %b %Y %T %z''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] 
[-v[+|-]val[ymwdHMS]] ...
             [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]

Regards,

Pedro.


On 10/01/14 11:46, Antoine Brodin wrote:
> On Sun, Sep 28, 2014 at 11:20 PM, Pedro F. Giffuni <pfg@freebsd.org> wrote:
>> Author: pfg
>> Date: Sun Sep 28 21:20:20 2014
>> New Revision: 272273
>> URL: http://svnweb.freebsd.org/changeset/base/272273
>>
>> Log:
>>    Add strptime(3) support for %U and %W (take 2)
>>
>>    Add support for the missing POSIX-2001 %U and %W features: the
>>    existing FreeBSD strptime code recognizes both directives and
>>    validates that the week number lies in the permitted range,
>>    but then simply discards the value.
>>
>>    Initial support for the feature was written by Paul Green.
>>    David Carlier added the initial handling of tm_wday/tm_yday.
>>    Major credit goes to Andrey Chernov for detecting much of the
>>    brokenness, and rewriting/cleaning most of the code, making it
>>    much more robust.
>>
>>    Tested independently with the strptime test from the GNU C
>>    library.
>>
>>    PR:           137307
>>    MFC after:    1 month
>>    Relnotes:     yes
> Hi,
>
> It seems this change breaks some ports,  so please no MFC until this is fixed:
>
> http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p369565_s272290/logs/errors/latrine-1.0.0_1.log
> http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p369565_s272290/logs/errors/mongrel2-1.7.5_2.log
> http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p369565_s272290/logs/errors/deforaos-mailer-0.1.6_1.log
>
> Cheers,
>
> Antoine (portmgr hat on)
>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?542C5DCC.8060406>