Subject: Y2K bug in ftp(1)
Index:	 src/ucb/ftp/cmds.c

Description:
	Another Y2K bug found. This time in the ftp client.
	
	There is a "newer" command that is supposed to only download a 
	file if it is more recent than the file on the current system

Repeat-By:
	Use the ftp "newer" command with files having dates that cross Y2K

	Or the (usual) alternate method:  Observation ;)
	
Fix:
	The fix, thanks to bqt@softjar.se, is trival and obvious.

	Cut where indicated and save to /tmp/479.patch

	Then:

cd /
patch -p0 < /tmp/479.patch
cd usr/src/ucb/ftp
make install
make clean

	This and previous updates to 2.11BSD are available at the following
	locations:
	
	ftp://ftp.dfupdate.se/pub/pdp11/2.11BSD
	https://www.tuhs.org/Archive/Distributions/UCB/2.11BSD/Patches/
	ftp://ftp.2bsd.com/2.11BSD

---------------------------cut here--------------------
*** ./usr/src/ucb/ftp/cmds.c.old	Fri Oct  3 00:43:44 1997
--- ./usr/src/ucb/ftp/cmds.c	Mon Oct 31 10:55:57 2022
***************
*** 16,22 ****
   */
  
  #if	!defined(lint) && defined(DOSCCS)
! static char sccsid[] = "@(#)cmds.c	5.18.1 (2.11BSD) 1997/10/2";
  #endif
  
  /*
--- 16,22 ----
   */
  
  #if	!defined(lint) && defined(DOSCCS)
! static char sccsid[] = "@(#)cmds.c	5.18.2 (2.11BSD) 2022/10/31";
  #endif
  
  /*
***************
*** 590,613 ****
  					    &yy, &mo, &day, &hour, &min, &sec);
  					tm = gmtime(&stbuf.st_mtime);
  					tm->tm_mon++;
! 					if (tm->tm_year > yy%100)
  						return (1);
! 					else if (tm->tm_year == yy%100) {
! 						if (tm->tm_mon > mo)
! 							return (1);
! 					} else if (tm->tm_mon == mo) {
! 						if (tm->tm_mday > day)
! 							return (1);
! 					} else if (tm->tm_mday == day) {
! 						if (tm->tm_hour > hour)
! 							return (1);
! 					} else if (tm->tm_hour == hour) {
! 						if (tm->tm_min > min)
! 							return (1);
! 					} else if (tm->tm_min == min) {
! 						if (tm->tm_sec > sec)
! 							return (1);
! 					}
  				} else {
  					fputs(reply_string, stdout);
  					verbose = overbose;
--- 590,617 ----
  					    &yy, &mo, &day, &hour, &min, &sec);
  					tm = gmtime(&stbuf.st_mtime);
  					tm->tm_mon++;
! 					if (tm->tm_year > yy - 1900)
  						return (1);
! 					if (tm->tm_year == yy - 1900) {
! 					  if (tm->tm_mon > mo)
! 					    return (1);
! 					  if (tm->tm_mon == mo) {
! 					    if (tm->tm_mday > day)
! 					      return (1);
! 					    if (tm->tm_mday == day) {
! 					      if (tm->tm_hour > hour)
! 					        return (1);
! 					      if (tm->tm_hour == hour) {
! 					        if (tm->tm_min > min)
! 						  return (1);
! 						if (tm->tm_min == min) {
! 						  if (tm->tm_sec > sec)
! 						    return (1);
!                                                 }
!                                               }
!                                             }
!                                           }
!                                         }
  				} else {
  					fputs(reply_string, stdout);
  					verbose = overbose;
*** ./VERSION.old	Sun Oct  9 16:13:54 2022
--- ./VERSION	Mon Oct 31 07:35:35 2022
***************
*** 1,5 ****
! Current Patch Level: 478
! Date: October 9, 2022
  
  2.11 BSD
  ============
--- 1,5 ----
! Current Patch Level: 479
! Date: October 31, 2022
  
  2.11 BSD
  ============