From owner-freebsd-questions Mon Jan 3 18:38:36 2000 Delivered-To: freebsd-questions@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 B467514CE0 for ; Mon, 3 Jan 2000 18:38:27 -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 VAA11342; Mon, 3 Jan 2000 21:42:15 -0500 (EST) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <200001040242.VAA11342@cc942873-a.ewndsr1.nj.home.com> Subject: Re: "at 1:30am monday" gives "at: garbled time" after y2k rollover In-Reply-To: <200001032124.NAA12544@r2d2.netouch.net> from Alan Evans at "Jan 3, 2000 01:24:46 pm" To: Alan.Evans@netouch.com (Alan Evans) Date: Mon, 3 Jan 2000 21:42:15 -0500 (EST) Cc: freebsd-questions@FreeBSD.ORG Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Alan Evans wrote, > > I have several boxes with various versions of FreeBSD > (2.1, 2.1.6, 2.2.[2678], 3.2) and they all appear to have the > same problem with the "at" command. > > We have our weekly.local script on a 2.2.6 box schedule a > job to run on Monday morning at 1:30am. The scheduling happens > at the predictable time on Saturday mornings when /etc/weekly runs. > The scheduling command looks like this: > > at 1:30am Monday < /www/bin/process_logfiles.sh > EOF > > > Up until this past weekend, this had been working fine (4+ years). > Starting Saturday morning (1/1/2000), this particular feature of at > (using day of week) gives back "at: garbled time". The workaround > has been to change the example above to: > > at 1:30am +2 days < /www/bin/process_logfiles.sh > EOF > > > I tested out OpenBSD 2.6 as well and the bug appears there as well. > > FYI, Cool! A bona fide Y2k bug no one had caught! From /usr/src/at/parsetime.c, /* * 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"); } ... Since 'year' is the value of tm_year in a tm structure, the current value is 100. This registers as a "garbled time." That's actually quite funny since further down in this function there are specific mentions of making the function work for >2000. I don't see a PR for this. Sending one. I'd write a patch, but it would take me a long time to figure out just how many ways 'year' is used in this program. -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message