From chatila@faxmate.com  Sat Jan  1 07:02:20 2000
Return-Path: <chatila@faxmate.com>
Received: from mail0.faxmate.com (mail0.faxmate.com [205.250.252.67])
	by hub.freebsd.org (Postfix) with ESMTP id B6F3F14E32
	for <FreeBSD-gnats-submit@freebsd.org>; 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
Subject: A Y2K class bug when setting atime & mtime by sendfile's receive command
X-Send-Pr-Version: 3.2

>Number:         15820
>Category:       ports
>Synopsis:       A Y2K class bug when setting atime & mtime by receive
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan  1 07:10:01 PST 2000
>Closed-Date:    Thu Mar 9 12:02:09 PST 2000
>Last-Modified:  Thu Mar  9 12:02:43 PST 2000
>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:

From: Ade Lovett <ade@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, chatila@faxmate.com, sec@42.org
Cc:  
Subject: Re: ports/15820: A Y2K class bug when setting atime & mtime by receive
Date: Thu, 9 Mar 2000 10:44:28 -0600

 Please, please explicitly state which port when submitting a PR,
 there are over 3100 of them now :)
 
 That aside, I've done some digging with the net/sendfile port, and
 it would appear that a number of things have changed.
 
 Please review the following patch - it brings the port up to the
 latest release, follows the MASTER_SITE change (which fixes the
 distfile survey failure here) and cleans up other bogons in the port
 (I'm still not overly impressed by some of the stuff in the PLIST).
 
 MAINTAINER also cc'd on this.
 
 -aDe
 
 cvs diff: Diffing .
 Index: Makefile
 ===================================================================
 RCS file: /home/src/FreeBSD/ports/net/sendfile/Makefile,v
 retrieving revision 1.12
 diff -u -r1.12 Makefile
 --- Makefile	1999/08/30 14:24:08	1.12
 +++ Makefile	2000/03/09 16:33:26
 @@ -6,12 +6,10 @@
  # $FreeBSD: ports/net/sendfile/Makefile,v 1.12 1999/08/30 14:24:08 peter Exp $
  #
  
 -DISTNAME=	sendfile-19990215
 +DISTNAME=	sendfile-20000102
  PKGNAME=	sendfile-2.1
  CATEGORIES=	net
 -MASTER_SITES=   ftp://ftp.uni-stuttgart.de/pub/unix/comm/sendfile/current/ \
 -		ftp://infodrom.north.de/pub/unix/network/sendfile/ \
 -		ftp://ftp.fu-berlin.de/unix/network/sendfile/current/
 +MASTER_SITES=   ftp://ftp.belwue.de/pub/unix/sendfile/current/
  
  MAINTAINER=	sec@42.org
  
 @@ -24,8 +22,6 @@
  		wlock.1
  MAN7=		fetchfile.7
  MAN8=		sendfiled.8
 -
 -post-install:
 -	@(cd ${PREFIX}/man/man1; ${LN} -sf utf7encode.1.gz utf7decode.1.gz)
 +MLINKS=		utf7encode.1 utf7decode.1
  
  .include <bsd.port.mk>
 cvs diff: Diffing files
 Index: files/md5
 ===================================================================
 RCS file: /home/src/FreeBSD/ports/net/sendfile/files/md5,v
 retrieving revision 1.6
 diff -u -r1.6 md5
 --- files/md5	1999/02/23 15:25:34	1.6
 +++ files/md5	2000/03/09 16:30:52
 @@ -1 +1 @@
 -MD5 (sendfile-19990215.tar.gz) = 89d142b12ce005599842f11c59e840cc
 +MD5 (sendfile-20000102.tar.gz) = 4deaa00bf9a2e3f1c15abb54b30f2de0
 cvs diff: Diffing patches
 cvs diff: Diffing pkg
 Index: pkg/PLIST
 ===================================================================
 RCS file: /home/src/FreeBSD/ports/net/sendfile/pkg/PLIST,v
 retrieving revision 1.4
 diff -u -r1.4 PLIST
 --- pkg/PLIST	1999/02/23 15:25:34	1.4
 +++ pkg/PLIST	2000/03/09 16:33:45
 @@ -13,9 +13,7 @@
  etc/rc.d/sendfiled.sh
  etc/sendfile.cf
  etc/sendfile.deny
 -man/man1/utf7decode.1.gz
  sbin/sendfiled
 -
  @exec mkdir -p /var/spool/sendfile/OUTGOING /var/spool/sendfile/LOG
  @exec chmod 755 /var/spool/sendfile
  @exec chmod 1777 /var/spool/sendfile/OUTGOING
 @@ -25,7 +23,6 @@
  @exec echo -e 'saft\tstream\ttcp\tnowait\troot\t/usr/local/sbin/sendfiled sendfiled' >> /etc/inetd.conf
  @exec echo -e 'saft\t\t487/tcp\t# simple asynchronous file transfer'>>/etc/services
  @exec kill -HUP `ps auxw|awk '$11 == "inetd" { print $2 } '`
 -
  @unexec perl -pi.bak -e '/^saft/ && ($_="")' /etc/inetd.conf
  @unexec kill -HUP `ps auxw|awk '$11 == "inetd" { print $2 } '`
  @unexec rm -R /var/spool/sendfile
 
 -- 
 Ade Lovett, Austin, TX.
 

From: Stefan `Sec` Zehl <sec@42.org>
To: Ade Lovett <ade@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org, chatila@faxmate.com
Subject: Re: ports/15820: A Y2K class bug when setting atime & mtime by receive
Date: Thu, 9 Mar 2000 19:56:20 +0100

 On Thu, Mar 09, 2000 at 10:44:28AM -0600, Ade Lovett wrote:
 > Please, please explicitly state which port when submitting a PR,
 > there are over 3100 of them now :)
 > 
 > That aside, I've done some digging with the net/sendfile port, and
 > it would appear that a number of things have changed.
 > 
 > Please review the following patch - it brings the port up to the
 > latest release, follows the MASTER_SITE change (which fixes the
 > distfile survey failure here) and cleans up other bogons in the port
 > (I'm still not overly impressed by some of the stuff in the PLIST).
 > 
 > MAINTAINER also cc'd on this.
 
 Please. I have already submitted an update of this port 5 days ago. It's
 PR ports/17917 (update of net/sendfile port by maintainer).
 Just commit this, it contains all this (besides MLINKS which i didn't
 know till now. I will fix this in the next version)
 
 CU,
     Sec
 -- 
 Just to confirm, I se my modem's pccard.conf driver setting to sio1
 (from sio2) and I got the required panic. Cool!
 
State-Changed-From-To: open->closed 
State-Changed-By: ade 
State-Changed-When: Thu Mar 9 12:02:09 PST 2000 
State-Changed-Why:  
Update to the port from PR 17197 also fixes this. 
>Unformatted:
