From owner-freebsd-bugs Tue Jul 9 18:20:06 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id SAA23039 for bugs-outgoing; Tue, 9 Jul 1996 18:20:06 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id SAA23012; Tue, 9 Jul 1996 18:20:03 -0700 (PDT) Resent-Date: Tue, 9 Jul 1996 18:20:03 -0700 (PDT) Resent-Message-Id: <199607100120.SAA23012@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, Received:"from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id SAA22966 for" ; Tue, 9 Jul 1996 18:19:55.-0700 (PDT) Received: from zombie.ncsc.mil (zombie.ncsc.mil [144.51.15.1]) by who.cdrom.com (8.6.12/8.6.11) with ESMTP id SAA07407 for ; Tue, 9 Jul 1996 18:19:38 -0700 Received: (from sjr@localhost) by zombie.ncsc.mil (8.6.11/8.6.11) id VAA13250 for FreeBSD-gnats-submit@freebsd.org; Tue, 9 Jul 1996 21:18:02 -0400 Message-Id: <199607100118.VAA13250@zombie.ncsc.mil> Date: Tue, 9 Jul 1996 21:18:02 -0400 From: "Stephen J. Roznowski" To: FreeBSD-gnats-submit@freebsd.org Subject: misc/1380: Year 2000 breakage with tm_year Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1380 >Category: misc >Synopsis: Year 2000 breakage with tm_year >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jul 9 18:20:01 PDT 1996 >Last-Modified: >Originator: Stephen J. Roznowski >Organization: >Release: FreeBSD 2.2-960612-SNAP i386 >Environment: >Description: Several programs have a hardcoded 19 in responses for the year. This will break in 4 years... This was fixed in NetBSD as PR misc/2308. (I think that I have the same changes as were finally committed) >How-To-Repeat: find /usr/src -type f -print | xargs grep '19%' >Fix: As I stated in the NetBSD PR: "There is also similiar code in "gnu/usr.bin/rcs/lib/rcstime.c", but I'm less sure of the proper fix there." *** usr.bin/yacc/test/ftp.tab.c.orig Tue Jul 9 16:57:53 1996 --- usr.bin/yacc/test/ftp.tab.c Tue Jul 9 17:00:13 1996 *************** *** 1467,1474 **** struct tm *gmtime(); t = gmtime(&stbuf.st_mtime); reply(213, ! "19%02d%02d%02d%02d%02d%02d", ! t->tm_year, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); } } --- 1467,1474 ---- struct tm *gmtime(); t = gmtime(&stbuf.st_mtime); reply(213, ! "%04d%02d%02d%02d%02d%02d", ! 1900+t->tm_year, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); } } *** usr.bin/yacc/test/ftp.y.orig Tue Jul 9 16:59:03 1996 --- usr.bin/yacc/test/ftp.y Tue Jul 9 16:59:33 1996 *************** *** 455,462 **** struct tm *gmtime(); t = gmtime(&stbuf.st_mtime); reply(213, ! "19%02d%02d%02d%02d%02d%02d", ! t->tm_year, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); } } --- 455,462 ---- struct tm *gmtime(); t = gmtime(&stbuf.st_mtime); reply(213, ! "%04d%02d%02d%02d%02d%02d", ! 1900+t->tm_year, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); } } *** libexec/ftpd/ftpcmd.y.orig Tue Jul 9 17:00:30 1996 --- libexec/ftpd/ftpcmd.y Tue Jul 9 17:00:49 1996 *************** *** 491,498 **** struct tm *t; t = gmtime(&stbuf.st_mtime); reply(213, ! "19%02d%02d%02d%02d%02d%02d", ! t->tm_year, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); } } --- 491,498 ---- struct tm *t; t = gmtime(&stbuf.st_mtime); reply(213, ! "%04d%02d%02d%02d%02d%02d", ! 1900+t->tm_year, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); } } *** usr.bin/make/targ.c.orig Tue Jul 9 17:01:00 1996 --- usr.bin/make/targ.c Tue Jul 9 17:01:22 1996 *************** *** 467,475 **** parts = localtime(&time); ! sprintf (buf, "%d:%02d:%02d %s %d, 19%d", parts->tm_hour, parts->tm_min, parts->tm_sec, ! months[parts->tm_mon], parts->tm_mday, parts->tm_year); return(buf); } --- 467,475 ---- parts = localtime(&time); ! sprintf (buf, "%d:%02d:%02d %s %d, %d", parts->tm_hour, parts->tm_min, parts->tm_sec, ! months[parts->tm_mon], parts->tm_mday, 1900+parts->tm_year); return(buf); } *** gnu/usr.sbin/isdn/load/load.c.orig Tue Jul 9 17:18:28 1996 --- gnu/usr.sbin/isdn/load/load.c Tue Jul 9 17:18:56 1996 *************** *** 71,78 **** tt = time(NULL); t = localtime(&tt); ! sprintf(buf, "%.2d%.2d%.2d%.2d%.2d19%.2d", t->tm_hour, ! t->tm_min, t->tm_sec, t->tm_mday, t->tm_mon + 1, t->tm_year); if (ioctl(f, NICCY_SET_CLOCK, buf) < 0) { --- 71,78 ---- tt = time(NULL); t = localtime(&tt); ! sprintf(buf, "%.2d%.2d%.2d%.2d%.2d%.4d", t->tm_hour, ! t->tm_min, t->tm_sec, t->tm_mday, t->tm_mon + 1, 1900+t->tm_year); if (ioctl(f, NICCY_SET_CLOCK, buf) < 0) { *** gnu/usr.sbin/isdn/misc/stime.c.orig Tue Jul 9 17:19:09 1996 --- gnu/usr.sbin/isdn/misc/stime.c Tue Jul 9 17:19:24 1996 *************** *** 38,45 **** } tt = time(NULL); t = localtime(&tt); ! sprintf(buf, "%.2d%.2d%.2d%.2d%.2d19%.2d", t->tm_hour, ! t->tm_min, t->tm_sec, t->tm_mday, t->tm_mon + 1, t->tm_year); if (ioctl(f, NICCY_SET_CLOCK, buf) < 0) { --- 38,45 ---- } tt = time(NULL); t = localtime(&tt); ! sprintf(buf, "%.2d%.2d%.2d%.2d%.2d%.4d", t->tm_hour, ! t->tm_min, t->tm_sec, t->tm_mday, t->tm_mon + 1, 1900+t->tm_year); if (ioctl(f, NICCY_SET_CLOCK, buf) < 0) { >Audit-Trail: >Unformatted: