From owner-freebsd-bugs Thu Mar 30 22:10: 6 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id C916437B7D4 for ; Thu, 30 Mar 2000 22:10:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id WAA98248; Thu, 30 Mar 2000 22:10:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from vortex.jcmax.com (vortex.jcmax.com [204.69.248.1]) by hub.freebsd.org (Postfix) with ESMTP id 7791F37B6A1 for ; Thu, 30 Mar 2000 22:02:55 -0800 (PST) (envelope-from cr@jcmax.com) Received: from plasma.jcmax.com (plasma.jcmax.com [204.69.248.13]) by vortex.jcmax.com (8.9.3/8.9.3) with ESMTP id BAA03898 for ; Fri, 31 Mar 2000 01:02:53 -0500 (EST) (envelope-from cr@jcmax.com) Received: (from cr@localhost) by plasma.jcmax.com (8.9.3/8.9.3) id BAA48184; Fri, 31 Mar 2000 01:02:53 -0500 (EST) (envelope-from cr@jcmax.com) Message-Id: <200003310602.BAA48184@plasma.jcmax.com> Date: Fri, 31 Mar 2000 01:02:53 -0500 (EST) From: Cyrus Rahman Reply-To: cr@jcmax.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/17704: at(1) is not y2k compliant Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 17704 >Category: bin >Synopsis: at(1) is not y2k compliant >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 30 22:10:01 PST 2000 >Closed-Date: >Last-Modified: >Originator: Cyrus Rahman >Release: FreeBSD 4.0-STABLE i386 >Organization: >Environment: >Description: At(1) uses the following code in assign_date() to convert three possible year formats to the format used by a tm structure: if (year > 99) { if (year > 1899) year -= 1900; else panic("garbled time"); } If year contains: the last two digits of the current year, or the actual value of the year, all is well. However, if year contains: the tm_year value of a year after the year 1999 (e.g. 100) the code calls panic(). >How-To-Repeat: Try using dates specifying a weekday, for which the parser passes a tm_year to assign_date(): sh> at 01:15 Sunday at: garbled time >Fix: Instead of passing three different year formats into assign_date() and hoping it figures out what to do with them, convert the year to the actual value first in the one place where this is not done: *** parsetime.c.old Thu Mar 30 22:29:14 2000 --- parsetime.c Thu Mar 30 22:24:19 2000 *************** *** 495,501 **** tm->tm_wday = wday; ! assign_date(tm, mday, tm->tm_mon, tm->tm_year); break; case NUMBER: --- 495,501 ---- tm->tm_wday = wday; ! assign_date(tm, mday, tm->tm_mon, tm->tm_year + 1900); break; case NUMBER: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message