Issue 294 - y2k
Summary: y2k
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-09-17 19:56 UTC by hby@umich.edu
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description hby@umich.edu 1999-09-17 19:56:16 UTC
Full_Name: howard b young
Version: 1.2.7
OS: solaris 2.6
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (141.211.144.18)


We where testing some finger stuff and encounted what seemed to be a problem in

reporting dates > year 2000. Tacked it down to the file
libraries/libldap/tmplout.c,
module time2text. The following seems to fix the problem. (In the cases of 14
digit 
times the offset from 1900 hundred was determined then thrown away. For 12
digit
times the standard y2k hack was not being use.)

-- tmplout.c.org       Tue Mar  2 13:30:05 1999
+++ tmplout.c   Fri Sep 17 15:19:02 1999
@@ -895,13 +895,20 @@
 
     p = ldtimestr;
 
-       if( ndigits == 14) {
-               /* came with a century */
-               /* POSIX says tm_year should be year - 1900 */
-       t.tm_year = 100 * GET2BYTENUM( p ) - 1900;
-               p += 2;
-       }
-    t.tm_year = GET2BYTENUM( p ); p += 2;
+    if( ndigits == 14) {
+        /* came with a century */
+        /* POSIX says tm_year should be year - 1900 */
+        t.tm_year = 100 * GET2BYTENUM( p ) - 1900;
+        p += 2;
+        t.tm_year += GET2BYTENUM( p ); p += 2;
+    }
+    else
+    {
+        t.tm_year = GET2BYTENUM( p ); p += 2;
+        /* Y2K hack  - 2 digit years < 70 are 21st century */
+        if (t.tm_year < 70) 
+            t.tm_year += 100;
+    }
 
     t.tm_mon = GET2BYTENUM( p ) - 1; p += 2;
     t.tm_mday = GET2BYTENUM( p ); p += 2;



Comment 1 Kurt Zeilenga 1999-09-17 20:12:14 UTC
Applied to -devel and OPENLDAP_REL_ENG_1_2, please test.

At 07:56 PM 9/17/99 GMT, hby@umich.edu wrote:
>Full_Name: howard b young
>Version: 1.2.7
>OS: solaris 2.6
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (141.211.144.18)
>
>
>We where testing some finger stuff and encounted what seemed to be a problem in
>
>reporting dates > year 2000. Tacked it down to the file
>libraries/libldap/tmplout.c,
>module time2text. The following seems to fix the problem. (In the cases of 14
>digit 
>times the offset from 1900 hundred was determined then thrown away. For 12
>digit
>times the standard y2k hack was not being use.)
>
>-- tmplout.c.org       Tue Mar  2 13:30:05 1999
>+++ tmplout.c   Fri Sep 17 15:19:02 1999
>@@ -895,13 +895,20 @@
> 
>     p = ldtimestr;
> 
>-       if( ndigits == 14) {
>-               /* came with a century */
>-               /* POSIX says tm_year should be year - 1900 */
>-       t.tm_year = 100 * GET2BYTENUM( p ) - 1900;
>-               p += 2;
>-       }
>-    t.tm_year = GET2BYTENUM( p ); p += 2;
>+    if( ndigits == 14) {
>+        /* came with a century */
>+        /* POSIX says tm_year should be year - 1900 */
>+        t.tm_year = 100 * GET2BYTENUM( p ) - 1900;
>+        p += 2;
>+        t.tm_year += GET2BYTENUM( p ); p += 2;
>+    }
>+    else
>+    {
>+        t.tm_year = GET2BYTENUM( p ); p += 2;
>+        /* Y2K hack  - 2 digit years < 70 are 21st century */
>+        if (t.tm_year < 70) 
>+            t.tm_year += 100;
>+    }
> 
>     t.tm_mon = GET2BYTENUM( p ) - 1; p += 2;
>     t.tm_mday = GET2BYTENUM( p ); p += 2;
>
>
>
>
>
>
Comment 2 Kurt Zeilenga 1999-09-17 20:16:10 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 3 Kurt Zeilenga 1999-12-10 17:25:15 UTC
changed notes
changed state Test to Closed
Comment 4 OpenLDAP project 2014-08-01 21:06:53 UTC
Applied fix to devel and OPENLDAP_REL_ENG_1_2
released with 1.2.8