From owner-freebsd-ports Sat Jan 1 7:10: 3 2000 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id B1BDF14D52 for ; Sat, 1 Jan 2000 07:10:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id HAA02121; Sat, 1 Jan 2000 07:10:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from mail0.faxmate.com (mail0.faxmate.com [205.250.252.67]) by hub.freebsd.org (Postfix) with ESMTP id B6F3F14E32 for ; Sat, 1 Jan 2000 07:02:18 -0800 (PST) (envelope-from chatila@faxmate.com) Received: (from chatila@localhost) by mail0.faxmate.com (8.9.3/8.9.3/Debian/GNU) id KAA18965; Sat, 1 Jan 2000 10:02:15 -0500 Message-Id: <200001011502.KAA18965@mail0.faxmate.com> Date: Sat, 1 Jan 2000 10:02:15 -0500 From: chatila@faxmate.com Reply-To: chatila@faxmate.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/15820: A Y2K class bug when setting atime & mtime by sendfile's receive command Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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: >Environment: >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