Subject: "Fixed" .tar.Z file of wu-ftpd-2.4 now on wuarchive

From: Andrew Robert Ellsworth <[email-masked]>
Date: Tue, 5 Dec 1995 16:42:27 -0600 (CST)

After receiving a couple of reports from people with older versions of 
tar saying that they couldn't untar the distribution, I decided to re-tar 
it with the backwards-compatibility switch.  For those of you who were 
having problems, please try this new tarfile.  For those of you for whom 
the tarfile worked fine, you can ignore this message.

Please note that the CHECKSUMS file had to be updated when the file was 
re-tarred, as a slightly different tarring method was used.  Sorry for 
any inconvenience.

Andy Ellsworth             | "...The wind was not the beginning.  There are
[email-masked]         | neither beginnings nor endings to the turning of
Assistant Admin, wuarchive | the Wheel of Time.  But it was _a_ beginning..."
http://cec.wustl.edu/~are1 |           --The Wheel of Time saga, Robert Jordan

---

From: Vidiot <[email-masked]>
Date: Tue, 5 Dec 1995 17:28:21 -0600 (CST)

The patches that were previously released still haven't been incorporated into
the latest beta 8 release.  Unfortunatley I don't remember who did them,
because I chopped the headers when I made the patch file.

Here is the complete patch:

***** CUT HERE for ftp.c.patch *****
*** ftpd.c.dist	Thu Oct 26 22:58:59 1995
--- ftpd.c	Thu Oct 26 23:08:30 1995
***************
*** 44,45 ****
--- 44,46 ----
  #include <sys/types.h>
+ #include <sys/uio.h>
  #include <sys/param.h>
***************
*** 130,131 ****
--- 131,134 ----
  
+ extern int timeout;
+ 
  /* File containing login names NOT to be used on this machine. Commonly used
***************
*** 233,234 ****
--- 236,238 ----
  extern int authenticated;
+ static void TPtoolong();
  
***************
*** 1078,1079 ****
--- 1082,1099 ----
  
+ static void
+ TPtoolong()
+ {
+     time_t now;
+ 
+     reply(421,
+       "Timeout (%d seconds): closing control connection.", timeout);
+     (void) time(&now);
+     if (logging) {
+         syslog(LOG_INFO,
+             "User %s timed out after %d seconds at %.24s",
+             (pw ? pw -> pw_name : "unknown"), timeout, ctime(&now));
+     }
+     dologout(1);
+ }
+ 
  int
***************
*** 1992,1993 ****
--- 2012,2014 ----
      byte_count = 0;
+     (void) signal(SIGALRM, TPtoolong);
      if (size != (off_t) - 1)
***************
*** 2000,2003 ****
            fromlen = sizeof(from);
! 
          s = accept(pdata, (struct sockaddr *) &from, &fromlen);
          if (s < 0) {
--- 2021,2025 ----
            fromlen = sizeof(from);
! 	alarm(timeout);
          s = accept(pdata, (struct sockaddr *) &from, &fromlen);
+ 	alarm(0);
          if (s < 0) {
***************
*** 2067,2068 ****
--- 2089,2091 ----
  {
+ 
      register int c,
***************
*** 2073,2075 ****
--- 2096,2101 ----
  
+     (void) signal(SIGALRM, TPtoolong);
+ 
      transflag++;
+ 
      if (setjmp(urgcatch)) {
***************
*** 2081,2082 ****
--- 2107,2109 ----
      case TYPE_A:
+         alarm(timeout);
          while ((c = getc(instr)) != EOF) {
***************
*** 2087,2088 ****
--- 2114,2116 ----
                  (void) putc('\r', outstr);
+ 		alarm(timeout);
              }
***************
*** 2089,2092 ****
              (void) putc(c, outstr);
!         }
          fflush(outstr);
          transflag = 0;
--- 2117,2121 ----
              (void) putc(c, outstr);
! 	}
          fflush(outstr);
+ 	alarm(0);
          transflag = 0;
***************
*** 2119,2121 ****
          while ((cnt = read(filefd, buf, (u_int) blksize)) > 0 &&
!                write(netfd, buf, cnt) == cnt)
              byte_count += cnt;
--- 2148,2150 ----
          while ((cnt = read(filefd, buf, (u_int) blksize)) > 0 &&
!                TPwrite(netfd, buf, cnt) == cnt)
              byte_count += cnt;
***************
*** 2139,2140 ****
--- 2168,2170 ----
      transflag = 0;
+     alarm(0);
      perror_reply(426, "Data connection");
***************
*** 2144,2145 ****
--- 2174,2176 ----
      transflag = 0;
+     alarm(0);
      perror_reply(551, "Error on input file");
***************
*** 2164,2166 ****
--- 2195,2200 ----
  
+     (void) signal(SIGALRM, TPtoolong);
+ 
      transflag++;
+ 
      if (setjmp(urgcatch)) {
***************
*** 2173,2175 ****
      case TYPE_L:
!         while ((cnt = read(fileno(instr), buf, sizeof buf)) > 0) {
              if (write(fileno(outstr), buf, cnt) != cnt)
--- 2207,2209 ----
      case TYPE_L:
!         while ((cnt = TPread(fileno(instr), buf, sizeof buf)) > 0) {
              if (write(fileno(outstr), buf, cnt) != cnt)
***************
*** 2189,2190 ****
--- 2223,2225 ----
      case TYPE_A:
+ 	alarm(timeout);
          while ((c = getc(instr)) != EOF) {
***************
*** 2191,2194 ****
              byte_count++;
!             if (c == '\n')
                  bare_lfs++;
              while (c == '\r') {
--- 2226,2231 ----
              byte_count++;
!             if (c == '\n') {
                  bare_lfs++;
+ 	        alarm(timeout);
+ 	     }
              while (c == '\r') {
***************
*** 2198,2199 ****
--- 2235,2237 ----
                      (void) putc('\r', outstr);
+ 		    alarm(timeout);
                      if (c == '\0' || c == EOF)
***************
*** 2206,2207 ****
--- 2244,2246 ----
          fflush(outstr);
+ 	alarm(0);
          if (ferror(instr))
***************
*** 2224,2225 ****
--- 2263,2265 ----
      transflag = 0;
+     alarm(0);
      perror_reply(426, "Data Connection");
***************
*** 2229,2230 ****
--- 2269,2271 ----
      transflag = 0;
+     alarm(0);
      perror_reply(452, "Error writing file");
***************
*** 3273 ****
--- 3314,3339 ----
  #endif /* ULTRIX_AUTH */
+ 
+ 
+ int TPwrite(fd, buf, nbyte)
+      int fd;
+      char *buf;
+      int nbyte;
+ {
+   int cnt;
+   alarm(timeout);
+   cnt = write(fd, buf, nbyte);
+   alarm(0);
+   return cnt;
+ }
+ 
+ int TPread(fd, buf, nbyte)
+      int fd;
+      char *buf;
+      int nbyte;
+ {
+   int cnt;
+   alarm(timeout);
+   cnt = read(fd, buf, nbyte);
+   alarm(0);
+   return cnt;
+ }
***** END OF PATCH FILE*****

MB
-- 
System Administrator - FT/MS - Madison WI. <URL:http://www.ftms.com/>
e-mail: [email-masked]
phone: (608) 273-8262  fax: (608) 273-8719  voice-mail: (800) 426-6488 ext 6293
Visit - <URL:http://www.cdsnet.net/vidiot/>  (Your link to Star Trek and UPN)