From gordon@sneaky.lerctr.org  Sun Jan  2 16:13:07 2000
Return-Path: <gordon@sneaky.lerctr.org>
Received: from hammy.lonestar.org (hammy.lonestar.org [206.138.224.67])
	by hub.freebsd.org (Postfix) with ESMTP id 06E1F150BA
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  2 Jan 2000 16:13:06 -0800 (PST)
	(envelope-from gordon@sneaky.lerctr.org)
Received: from gerbil.hammy.lonestar.org(src addr [206.138.224.66]) (2509 bytes) by hammy.lonestar.org
	via sendmail with P\:esmtp/R:bind_hosts/T:inet_zone_bind_smtp
	(sender: <gordon@sneaky.lerctr.org>) 
	id <m124v7R-00001TC@hammy.lonestar.org>
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 2 Jan 2000 18:13:05 -0600 (CST)
	(Smail-3.2.0.96 1997-Jun-2 #108 built 1999-Dec-20)
Received: from localhost (1942 bytes) by gerbil.hammy.lonestar.org
	via sendmail with P:stdio/R:smart_host/T:smtp
	(sender: <gordon>) (ident <gordon> using unix)
	id <m124v7Q-00002LC@gerbil.hammy.lonestar.org>
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 2 Jan 2000 18:13:04 -0600 (CST)
	(Smail-3.2.0.96 1997-Jun-2 #108 built 1999-Dec-20)
Message-Id: <m124v7Q-00002LC@gerbil.hammy.lonestar.org>
Date: Sun, 2 Jan 2000 18:13:04 -0600 (CST)
From: gordon@hammy.lonestar.org
Sender: gordon@sneaky.lerctr.org
Reply-To: gordon@hammy.lonestar.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: tar --newer-mtime flag has Y2K bug <Synopsis of the problem (one line)>
X-Send-Pr-Version: 3.2

>Number:         15853
>Category:       bin
>Synopsis:       tar --newer-mtime flag has Y2K bug
>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:   Sun Jan  2 16:20:00 PST 2000
>Closed-Date:    Sat Nov 17 11:14:35 PST 2001
>Last-Modified:  Sat Nov 17 11:15:21 PST 2001
>Originator:     Gordon Burditt
>Release:        FreeBSD 3.3-RELEASE i386
>Organization:
>Environment:

	FreeBSD 3.3-RELEASE
	

>Description:

	
	The tar --newer-mtime flag (specifically get_date in getdate.y)
	will no longer accept the date format "1 day ago 00:00:00"
	(handy for incremental backups) but if the date is before 
	Jan 1, 2000 00:00:00, it works.  It is not necessary for
	the "N days ago" to cross the 1999/2000 rollover for the
	failure to happen.

>How-To-Repeat:

	
	cd to some directory with a small number of files in it.
	% tar -cvf /dev/null --newer-mtime "1 day ago 00:00:00" .
	Observe that it complains about a bad date format.
	Set date to 31 Dec 1999 00:00:00 .
	Try same command line and observe that it works.

>Fix:
	
	

Index: getdate.y
===================================================================
RCS file: getdate.y,v
retrieving revision 1.3
retrieving revision 1.4
diff -c -r1.3 -r1.4
*** getdate.y	2000/01/01 23:28:19	1.3
--- getdate.y	2000/01/02 18:24:39	1.4
***************
*** 903,909 ****
      }
  
      tm = localtime(&now->time);
!     yyYear = tm->tm_year;
      yyMonth = tm->tm_mon + 1;
      yyDay = tm->tm_mday;
      yyTimezone = now->timezone;
--- 903,909 ----
      }
  
      tm = localtime(&now->time);
!     yyYear = tm->tm_year + 1900;
      yyMonth = tm->tm_mon + 1;
      yyDay = tm->tm_mday;
      yyTimezone = now->timezone;

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: steve 
Responsible-Changed-When: Sun Jan 2 17:28:37 PST 2000 
Responsible-Changed-Why:  
Misfiled PR. 
State-Changed-From-To: open->closed 
State-Changed-By: bmah 
State-Changed-When: Sat Nov 17 11:14:35 PST 2001 
State-Changed-Why:  
This appears to have been fixed (in a different way) in  
revision 1.4 of getdate.y. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=15853 
>Unformatted:
