From owner-freebsd-bugs Tue Jan 5 00:30:11 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA16592 for freebsd-bugs-outgoing; Tue, 5 Jan 1999 00:30:11 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA16581 for ; Tue, 5 Jan 1999 00:30:08 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id AAA20880; Tue, 5 Jan 1999 00:30:01 -0800 (PST) Received: from sraigw.sra.co.jp (sraigw.sra.co.jp [202.32.10.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA16498 for ; Tue, 5 Jan 1999 00:29:36 -0800 (PST) (envelope-from ishisone@sra.co.jp) Received: from sranhe.sra.co.jp (sranhe [133.137.44.3]) by sraigw.sra.co.jp (8.8.7/3.6Wbeta7-sraigw) with ESMTP id RAA05083 for ; Tue, 5 Jan 1999 17:29:08 +0900 (JST) Received: from srapc459.sra.co.jp (srapc459 [133.137.45.28]) by sranhe.sra.co.jp (8.8.7/3.6Wbeta7-srambox) with ESMTP id RAA13814 for ; Tue, 5 Jan 1999 17:28:59 +0859 (JST) Received: (from ishisone@localhost) by srapc459.sra.co.jp (8.8.8/3.4W-sra) id RAA29543; Tue, 5 Jan 1999 17:29:07 +0900 (JST) Message-Id: <199901050829.RAA29543@srapc459.sra.co.jp> Date: Tue, 5 Jan 1999 17:29:07 +0900 (JST) From: ishisone@sra.co.jp Reply-To: ishisone@sra.co.jp To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/9323: year 2000 problem with /usr/bin/touch Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 9323 >Category: bin >Synopsis: year 2000 problem with /usr/bin/touch >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 5 00:30:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Makoto Ishisone >Release: FreeBSD 2.2.7-RELEASE i386 >Organization: Software Research Associates, Inc. >Environment: >Description: When used in its obsolescent form (where the time is specified as the first argument), /usr/bin/touch doesn't treat the two-digit year specification correctly. Years in the range of 00-68 should be treated as 2000-2068 according to the online manual, but actually they are treated as 1900-1968. Here's an excerpt from the manual's `COMPATIBILITY' section: If the ``YY'' letter pair is in the range 69 to 99, the year is set to 1969 to 1999, otherwise, the year is set in the 21st century. >How-To-Repeat: Try following commands. You'll find that the modification time of the file is 1910, not 2010. % touch 0101000010 /tmp/touchme % ls -l /tmp/touchme >Fix: *** touch.c.org Fri Jul 17 16:25:26 1998 --- touch.c Tue Jan 5 16:10:45 1999 *************** *** 260,267 **** t->tm_mday = ATOI2(arg); t->tm_hour = ATOI2(arg); t->tm_min = ATOI2(arg); ! if (year) t->tm_year = ATOI2(arg); t->tm_isdst = -1; /* Figure out DST. */ tvp[0].tv_sec = tvp[1].tv_sec = mktime(t); --- 260,270 ---- t->tm_mday = ATOI2(arg); t->tm_hour = ATOI2(arg); t->tm_min = ATOI2(arg); ! if (year) { t->tm_year = ATOI2(arg); + if (t->tm_year < 69) + t->tm_year += 100; + } t->tm_isdst = -1; /* Figure out DST. */ tvp[0].tv_sec = tvp[1].tv_sec = mktime(t); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message