Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Jan 2000 10:02:15 -0500
From:      chatila@faxmate.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/15820: A Y2K class bug when setting atime & mtime by sendfile's receive command
Message-ID:  <200001011502.KAA18965@mail0.faxmate.com>

next in thread | raw e-mail | index | archive | help
	Note: There was a bad value `<[' for the field `>Confidential:'.
	It was set to the default value of `yes'.


>Number:         15820
>Category:       ports
>Synopsis:       A Y2K class bug when setting atime & mtime by receive
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan  1 07:10:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Abdallah Chatila
>Release:        FreeBSD 3.4-RELEASE i386
>Organization:
<Organization of PR author (multiple lines)>
>Environment:

	<Relevant environment information (multiple lines)>

>Description:

	I've noticed that receive is not setting the atime & mtime properly
for files sent after year 1999.

>How-To-Repeat:

	Create a file and send it to yourself using sendfile command. Now
wait let say a minute and do receive; you'll see that the time displayed by
ls -l shows the current time and not the time at which the original file
were created.

If you repeat the above with a file created before 1999, everything works as
expected (i.e. the time displayed by ls -l of the received file will
correspond to the original).

>Fix:
	
This is a patch which fixes the problem.

--- src/getdate.c.orig	Mon Jan 27 14:31:37 1997
+++ src/getdate.c	Sat Jan  1 09:19:46 2000
@@ -1484,7 +1484,7 @@
     Year += 1900;
   DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
     ? 29 : 28;
-  if (Year < EPOCH || Year > 1999
+  if (Year < EPOCH
       || Month < 1 || Month > 12
       /* Lint fluff:  "conversion from long may lose accuracy" */
       || Day < 1 || Day > DaysInMonth[(int)--Month])

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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