Full_Name: Nick Cuccia Version: 1.1.2 OS: SunOS 4.1.4 URL: ftp://ftp.openldap.org/incoming/cuccia-990205.tmplout-y2k-patch Submission from: (NULL) (137.134.47.2) The macro YEAR(y) in libraries is used to convert the contents of the tm_year field of a struct tm to a four-digit year. While it succeeds when tm_year < 100, it incorrectly handles values >= 100. Note that in the year 2000 and beyond, the value contained in the tm_year field of SunOS (and most, if not all, other Unix and Unix-like systems) will be 100 or more. Given the current implementation of YEAR(y), the gtime() function (which calculates a time_t based when given a struct tm) will generate incorrect return values after 1/1/2000. I've placed a patch which fixes this in the URL included below. --Nick
moved from Incoming to Software Bugs
Nick, I think the bug is slightly larger... that is, text2time doesn't handle 4 digit years at all. Please review this patch: http://www.openldap.org/devel/cvsweb.cgi/libraries/libldap/tmplout.c.diff?r1=1.14&r2=1.15
Kurt, thanks for working on this. I haven't had a chance yet to go over the change, but a thought occured to me: The only place that YEAR() was invoked was in gtime(). Unless I'm missing something (and I understand that this code derives from the original UMich code), gtime() appears to be a re-implementation of the ANSI/ISO C and POSIX function: time_t mktime(struct tm *timeptr) (specifed in ANSI/ISO C, POSIX.1-1988, and the OpenUnix specifications; Cf. <http://www.opengroup.org/onlinepubs/7908799/xsh/mktime.html>). --Nick
changed notes changed state Open to Closed
Patched in 1.2.0