From peter.jeremy@auss2.alcatel.com.au  Thu Jan 14 21:24:38 1999
Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA18801
          for <FreeBSD-gnats-submit@FreeBSD.ORG>; Thu, 14 Jan 1999 21:24:37 -0800 (PST)
          (envelope-from peter.jeremy@auss2.alcatel.com.au)
Received: by border.alcanet.com.au id <40324>; Fri, 15 Jan 1999 16:22:38 +1100
Message-Id: <99Jan15.162238est.40324@border.alcanet.com.au>
Date: Fri, 15 Jan 1999 16:23:17 +1100
From: Peter Jeremy <peter.jeremy@auss2.alcatel.com.au>
Reply-To: peter.jeremy@alcatel.com.au
To: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Several cvs contrib files are not Y2K compliant
X-Send-Pr-Version: 3.2

>Number:         9501
>Category:       bin
>Synopsis:       Several cvs contrib files are not Y2K compliant
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 14 21:30:01 PST 1999
>Closed-Date:    Fri Jul 23 17:04:32 PDT 1999
>Last-Modified:  Fri Jul 23 17:08:38 PDT 1999
>Originator:     Peter Jeremy
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
Alcatel Australia
>Environment:

	

>Description:

1) The log.pl and sccs2rcs.csh scripts prepend `19' to the year resulting
   in a display 19100 for 2000.

2) The log_accum.pl script uses a two digit year in one place and
   in another place assumes that the tm_year is year within century
   rather than years since 1900.

>How-To-Repeat:

Code inspection

>Fix:
	
--- /3.0/src/contrib/cvs/contrib/log.pl	Fri May 16 08:46:07 1997
+++ ./log.pl	Fri Jan 15 14:46:37 1999
@@ -91,6 +91,7 @@
 @days = (Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday);
 
 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
+$year += 1900;
 
 # get a login name for the guy doing the commit....
 #
@@ -111,12 +112,12 @@
 # 
 print OUT "\n";
 print OUT "****************************************\n";
-print OUT "Date:\t$days[$wday] $mos[$mon] $mday, 19$year @ $hour:" . sprintf("%02d", $min) . "\n";
+print OUT "Date:\t$days[$wday] $mos[$mon] $mday, $year @ $hour:" . sprintf("%02d", $min) . "\n";
 print OUT "Author:\t$login\n\n";
 
 if (MAIL) {
 	print MAIL "\n";
-	print MAIL "Date:\t$days[$wday] $mos[$mon] $mday, 19$year @ $hour:" . sprintf("%02d", $min) . "\n";
+	print MAIL "Date:\t$days[$wday] $mos[$mon] $mday, $year @ $hour:" . sprintf("%02d", $min) . "\n";
 	print MAIL "Author:\t$login\n\n";
 }
 
--- /3.0/src/contrib/cvs/contrib/log_accum.pl	Fri May 16 08:46:07 1997
+++ ./log_accum.pl	Fri Jan 15 14:50:50 1999
@@ -172,12 +172,14 @@
 sub build_header {
     local($header);
     local($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
-    $header = sprintf("CVSROOT:\t%s\nModule name:\t%s\nRepository:\t%s\nChanges by:\t%s@%s\t%02d/%02d/%02d %02d:%02d:%02d",
+    if ($year >= 100)
+	$year += 1900;
+    $header = sprintf("CVSROOT:\t%s\nModule name:\t%s\nRepository:\t%s\nChanges by:\t%s@%s\t%04d/%02d/%02d %02d:%02d:%02d",
 		      $cvsroot,
 		      $modulename,
 		      $dir,
 		      $login, $hostdomain,
-		      $year%100, $mon+1, $mday,
+		      $year, $mon+1, $mday,
 		      $hour, $min, $sec);
 }
 
@@ -210,7 +212,7 @@
     ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst, $zone, $gmtoff) =
         ($TZ eq 'GMT') ? gmtime(time) : localtime(time);
 
-    $year += ($year < 70) ? 2000 : 1900;
+    $year += 1900;
 
     if ($gmtoff != 0) {
 	$tzoff = sprintf("%05d", ($gmtoff / 60) * 100);
--- /3.0/src/contrib/cvs/contrib/sccs2rcs.csh	Fri May 16 08:46:09 1997
+++ ./sccs2rcs.csh	Fri Jan 15 14:46:37 1999
@@ -177,7 +177,7 @@
         if ($status != 0) goto ERROR
 
         # get file into current dir and get stats
-        set date = `sccs prs -r$rev $file | grep "^D " | awk '{printf("19%s %s", $3, $4); exit}'`
+        set date = `sccs prs -r$rev $file | grep "^D " | awk '{printf("%d %s", ($3 < 1900) ? $3 + 1900 : $3, $4); exit}'`
         set author = `sccs prs -r$rev $file | grep "^D " | awk '{print $5; exit}'`
         echo ""
         echo "==> file $file, rev=$rev, date=$date, author=$author"
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: hoek 
State-Changed-When: Fri Jul 23 17:04:32 PDT 1999 
State-Changed-Why:  
Fixed some time ago by Danny in response to your bug report.  Thanks. 

[The log_accum.pl patch was not applied; I believe the reason for this is that 
displaying 00 for the year is not considered a bug and appears to have been  
the intentional behaviour by the original authors.] 
>Unformatted:
