From owner-freebsd-bugs Mon Jan 3 19: 0: 4 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 D9D42150C3 for ; Mon, 3 Jan 2000 19:00:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id TAA72462; Mon, 3 Jan 2000 19:00:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id DD69314FBA for ; Mon, 3 Jan 2000 18:50:02 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.9.3) id VAA11470; Mon, 3 Jan 2000 21:54:28 -0500 (EST) (envelope-from cjc) Message-Id: <200001040254.VAA11470@cc942873-a.ewndsr1.nj.home.com> Date: Mon, 3 Jan 2000 21:54:28 -0500 (EST) From: "Crist J. Clark" Reply-To: cjc@cc942873-a.ewndsr1.nj.home.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/15872: Y2k bug in at(1) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 15872 >Category: bin >Synopsis: Y2k bug in at(1) >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 3 19:00:01 PST 2000 >Closed-Date: >Last-Modified: >Originator: Crist J. Clark >Release: FreeBSD 3.4-STABLE i386 >Organization: >Environment: Present in all FreeBSD versions checked (2.x.x and 3.x). Also seen in other BSDs. >Description: There is a Y2k bug in at(1). The following portion of code can cause valid time specifications to return 'garbled time' errors, /* * assign_date() assigns a date, wrapping to next year if needed */ static void assign_date(struct tm *tm, long mday, long mon, long year) { if (year > 99) { if (year > 1899) year -= 1900; else panic("garbled time"); } ... When this function is passed the current year in tm_year format, 100, it will complain it is a garbled time. However, it is a legal value. >How-To-Repeat: Try to queue an atjob in the following manner, % at 10:30am wed at: garbled time However, that is a legal command line. >Fix: The parsetime.c code, which is excerpted above, is a _very_ complex piece of work. I hesitate to write a patch to fix this small problem since it might create greater ones. I leave it to someone with more familiarity with the code. (However, I am not sure why the 'year > 99' check is needed at all.) In the mean time, the previous command line can will work if you phrase it, % at 10:30 + 2 days You may need to try other convoluted constructions to work around other formats that might trigger the bug. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message