home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv192.zip / patches < prev    next >
Text File  |  1996-12-28  |  16KB  |  475 lines

  1. C-KERMIT 6.0 PATCHES
  2.  
  3. Most recent update: Wed Dec 18 11:44:34 1996
  4.  
  5. This file contains source-level patches to C-Kermit 6.0.192.
  6.  
  7. You can apply these patches if you have source code and the necessary C
  8. compiler and libraries to build a new executable.  There is no need to apply
  9. any patch if it does not apply to your configuration, or if the symptom does
  10. not affect you or your users.
  11.  
  12. Each patch is self-contained and independent from the others.  Line numbers
  13. correspond to the source-code files of the 6.0.192 release.
  14.  
  15. The patches included in this file are believed to be safe, but come with no
  16. guarantees.  They appear in chronological order as email messages separated by
  17. lines of underscores.
  18.  
  19. CONTENTS:
  20.  
  21. Number Domain           Description
  22.  0001   UNIX             C-Kermit mishandles timestamps on very old files
  23.  0002    Solaris 2.5++    Compilation error on Solaris 2.5 with Pro C
  24.  0003    VMS              CKERMIT.INI Fix for VMS
  25.  0004    VMS/VAX/UCX 2.0  C-Kermit 6.0 can't TELNET on VAX/VMS with UCX 2.0
  26.  0005    All              C-Kermit Might Send Packets Outside Window
  27.  0006    All              MOVE from SEND-LIST does not delete original files
  28.  0007    Solaris 2.5++    Higher serial speeds on Solaris 2.5
  29.  0008   All              C-Kermit application file name can't contain spaces
  30.  
  31. Legend:
  32.  ++ means "and above"
  33. ____________________
  34. X-Patch-Number: 0001
  35. Date: Sun, 1 Dec 1996 22:16:56 -0800
  36. From: Paul Eggert <eggert@twinsun.com>
  37. To: kermit-support@columbia.edu
  38. Subject: C-Kermit mishandles timestamps on very old files
  39.  
  40. C-Kermit 6.0.192 rejects files whose timestamps are before 1970-01-01
  41. local time.  But every Unix can represent files with timestamps before
  42. that.  It's common, for example, in the US/Pacific time zone to have a
  43. file with timestamp 1969-12-31 16:00:00 local time, since this equals
  44. 1970-01-01 00:00:00 UTC.  And many Unixes can represent times before
  45. the epoch, e.g. on Solaris 2.5.1:
  46.  
  47.   $ uname -a
  48.   SunOS shade 5.5.1 Generic_103640-03 sun4u sparc SUNW,Ultra-1
  49.   $ echo $TZ
  50.   UTC0
  51.   $ ls -l test
  52.   -rw-rw-r--   1 eggert   eggert         0 Dec 13  1901 test
  53.  
  54. It is certainly not a requirement of the ANSI C Library, or of Posix,
  55. that timestamps before 1970 cannot be represented.  Here is a patch:
  56.  
  57. RCS file: RCS/ckufio.c,v
  58. retrieving revision 6.0.192.0
  59. retrieving revision 6.0.192.1
  60. diff -c -r6.0.192.0 -r6.0.192.1
  61. *** ckufio.c    1996/11/23 19:27:13    6.0.192.0
  62. --- ckufio.c    1996/12/02 06:07:54    6.0.192.1
  63. ***************
  64. *** 2659,2666 ****
  65.       yy = time_stamp->tm_year;        /* Year - 1900 */
  66.       yy += 1900;
  67.       debug(F101,"zdatstr year","",yy);
  68. -     if (yy < 1970)            /* By definition of C library */
  69. -       return("");
  70.   
  71.       if (time_stamp->tm_mon  < 0 || time_stamp->tm_mon  > 11)
  72.         return("");
  73. --- 2659,2664 ----
  74. [It is not known if this patch is safe on all UNIX platforms.]
  75. ____________________
  76. X-Patch-Number: 0002
  77. Date: Mon, 02 Dec 1996 13:47:13 -0500
  78. To: kermit-support@columbia.edu
  79. Subject: Compilation error on Solaris 2.5 with Pro C
  80. From: "David J. Fiander" <davidf@worf.mks.com>
  81.  
  82. I defined CK_ENVIRONMENT and found that the prototype for tn_snenv() in
  83. ckcnet.h conflicted with the function definition in ckcnet.c.  the former
  84. declared the first parameter to be a CHAR * (i.e. an unsigned char *),
  85. while the latter declared to be a char * (i.e. signed char *).  The
  86. Pro C compiler treats this as an error.  I changed the function definition
  87. in ckcnet.c to declare the parameter as a CHAR * and the problem was
  88. resolved.
  89.  
  90. - David
  91.  
  92. [Note: This problem does not occur with standard builds.
  93. Resolution: CK_ENVIRONMENT, which controls the use of TELNET
  94. NEW-ENVIRONMENT protocol, is not supported in the UNIX version of
  95. C-Kermit 6.0.192.  The type mismatch is a mistake, however.]
  96. ____________________
  97. X-Patch-Number: 0003
  98. Date: Tue, 3 Dec 96 10:56:50 EST
  99. From: Mike Freeman <freeman@WATSUN.CC.COLUMBIA.EDU>
  100. Subject: CKERMIT.INI Fix for VMS
  101.  
  102. A minor fix to CKERMIT.INI from the 6-Sep release is shown below. 
  103. Needed to get C-Kermit 6(192) to run on my Vax/VMS system with VmS
  104. V5.5-2 and VAX C V3.1.
  105.  
  106. *** $ker:ckermit.ini;-1
  107. --- $ker:ckermit.ini;
  108. **************
  109. *** 680,686
  110.   
  111.   ; In VMS and OpenVMS, allow for system-wide site customizations
  112.   
  113. ! if equal "\v(system)" "VMS" {
  114.       xif exist CKERMIT_INI:CKERMIT.SYS {
  115.       echo Executing CKERMIT_INI:CKERMIT.SYS
  116.       take CKERMIT_INI:CKERMIT.SYS
  117. --- 680,686 -----
  118.   
  119.   ; In VMS and OpenVMS, allow for system-wide site customizations
  120.   
  121. ! xif equal "\v(system)" "VMS" {
  122.       xif exist CKERMIT_INI:CKERMIT.SYS {
  123.       echo Executing CKERMIT_INI:CKERMIT.SYS
  124.       take CKERMIT_INI:CKERMIT.SYS
  125.  
  126. MIke Freeman                    | Internet: freeman@watsun.cc.columbia.edu
  127. Amateur Radio Calsign: K7UIJ    | */ PGP Public Key Available */
  128. ____________________
  129. X-Patch-Number: 0004
  130. Date: Thu, 5 Dec 1996 15:20:00 EST
  131. From: Frank da Cruz <fdc@columbia.edu>
  132. Subject: C-Kermit 6.0 can't TELNET on VAX/VMS with UCX 2.0
  133.  
  134. PROBLEM:
  135.  
  136. On VAX/VMS systems with early versions of DEC TCP/IP (UCX), "set host" and
  137. "telnet" commands might fail with "Connection refused", even though the system
  138. (UCX) TELNET program to the same host works correctly.
  139.  
  140. DIAGNOSIS:
  141.  
  142. If you don't specify a port, Kermit substitutes the service name "telnet" and
  143. then asks UCX to look it up; similary, if you specify a port by name, rather
  144. than number, Kermit asks UCX to look it up.
  145.  
  146. On VAX/VMS with DEC TCP/IP UCX 2.0, 2.0A, 2.0B, or 2.0C, the getservbyname()
  147. function fails to return the port number in network byte order as it should,
  148. and instead returns the number with its bytes swapped (e.g. 5888 instead of
  149. 23).  Then Kermit tries to connect to port 5888 on the host; most hosts will
  150. refuse the connection; if they don't, you probably didn't reach a Telnet port
  151. anyway.
  152.  
  153. This bug was fixed in UCX 2.0D and thereafter.  However, there is no way for
  154. Kermit to know which version of UCX is being used.
  155.  
  156. WORKAROUND:
  157.  
  158. Specify the port number (not name) in your SET HOST or TELNET command, e.g.:
  159.  
  160.   set host xyzcorp.com 23
  161.  
  162. CURE:
  163.  
  164. A new command:
  165.  
  166.   SET TCP UCX-PORT-BUG { ON, OFF }
  167.  
  168. It is OFF by default, so UCX versions of VMS C-Kermit will work with all
  169. latter-day versions of UCX with no special effort.  But if you have an old
  170. UCX system, and you tell C-Kermit to "set host" or "telnet" and it says
  171. "Connection refused", tell it to SET TCP UCX-PORT-BUG ON and try again.  If
  172. this works, then put this command into your (or the system-wide) CKERMIT.INI
  173. file.  The following patch adds this command to VMS versions of C-Kermit that
  174. were built for UCX support.  It has already been applied to the CKVV55-UCX20
  175. binary in the Kermit archive.
  176.  
  177. PATCH:
  178.  
  179. *** /w/pub/ftp/kermit/f/ckcnet.c    Wed Nov 27 19:54:46 1996
  180. --- ./ckcnet.c    Wed Dec  4 17:14:41 1996
  181. ***************
  182. *** 1,4 ****
  183. ! char *cknetv = "Network support, 6.0.078, 6 Sep 1996";
  184.   
  185.   /*  C K C N E T  --  Network support  */
  186.   
  187. --- 1,4 ----
  188. ! char *cknetv = "Network support, 6.0.079, 4 Dec 1996";
  189.   
  190.   /*  C K C N E T  --  Network support  */
  191.   
  192. ***************
  193. *** 960,965 ****
  194. --- 960,967 ----
  195.   extern VOID C$$SOCK_TRANSLATE();
  196.   #endif /* CK_ANSIC */
  197.   
  198. + int ucx_port_bug = 0;            /* Explained below */
  199.   struct servent *
  200.   my_getservbyname (service, proto) char *service, *proto; {
  201.       static struct servent sent;
  202. ***************
  203. *** 1007,1035 ****
  204.       C$$SOCK_TRANSLATE(&s.sb.st[0]);
  205.       return NULL;
  206.       }
  207. -     /* sent.s_port is returned by UCX in network byte order. */
  208. -     /* Calling htons here swaps the bytes, which ruins everything. */
  209. -     /* Oh yeah?  WHICH VERSION of UCX???  Let's try this... */
  210. - #ifndef __alpha /* Maybe it should be __DECC, or some version thereof... */
  211.   /*
  212. !   Hunter says: "In fact, the "#ifndef __alpha" isn't even needed, since
  213. !   my_getservbyname() isn't included if "__DECC" is defined, and that's
  214. !   always defined on Alpha."  But if it doesn't hurt either, better not risk
  215. !   taking it out.
  216.   */
  217. ! #ifndef TCPWARE
  218. ! #define DO_HTONS
  219. ! #endif /* TCPWARE */
  220. ! #endif /* __alpha */
  221. ! #ifdef DO_HTONS
  222.       sent.s_port = htons(sent.s_port);
  223. !     debug(F111,"UCX getservbyname","port",ntohs(sent.s_port));
  224. ! #else
  225. !     debug(F111,"UCX getservbyname","port",sent.s_port);
  226. ! #endif /* DO_HTONS */
  227.       return &sent;
  228.   }
  229.   #endif /* __DECC */
  230. --- 1009,1028 ----
  231.       C$$SOCK_TRANSLATE(&s.sb.st[0]);
  232.       return NULL;
  233.       }
  234.   /*
  235. !   sent.s_port is supposed to be returned by UCX in network byte order.
  236. !   However, UCX 2.0 through 2.0C did not do this; 2.0D and later do it.
  237. !   But there is no way of knowing which UCX version, so we have a user-settable
  238. !   runtime variable.  Note: UCX 2.0 was only for the VAX.
  239.   */
  240. !     debug(F101,"UCX getservbyname port","",sent.s_port);
  241. !     debug(F101,"UCX getservbyname ntohs(port)","",ntohs(sent.s_port));
  242. !     if (ucx_port_bug) {
  243.       sent.s_port = htons(sent.s_port);
  244. !     debug(F100,"UCX-PORT-BUG ON: swapping bytes","",0);
  245. !     debug(F101,"UCX swapped port","",sent.s_port);
  246. !     debug(F101,"UCX swapped ntohs(port)","",ntohs(sent.s_port));
  247. !     }
  248.       return &sent;
  249.   }
  250.   #endif /* __DECC */
  251. *** /w/pub/ftp/kermit/f/ckuus3.c    Sun Nov 24 19:20:50 1996
  252. --- ./ckuus3.c    Wed Dec  4 16:58:49 1996
  253. ***************
  254. *** 3031,3036 ****
  255. --- 3031,3046 ----
  256.         success = recvbuf(z);
  257.         return(success);
  258.   #endif /* SO_RCVBUF */
  259. + #ifdef VMS
  260. + #ifdef DEC_TCPIP
  261. +     case XYTCP_UCX: {            /* UCX 2.0 port swabbing bug */
  262. +     extern int ucx_port_bug;
  263. +     return(success = seton(&ucx_port_bug));
  264. +     }
  265. + #endif /* DEC_TCPIP */
  266. + #endif /* VMS */
  267.      default:
  268.         return(0);
  269.      }
  270. *** /w/pub/ftp/kermit/f/ckuusr.c    Sun Nov 24 19:20:51 1996
  271. --- ./ckuusr.c    Wed Dec  4 17:12:50 1996
  272. ***************
  273. *** 1098,1103 ****
  274. --- 1098,1108 ----
  275.   #ifdef SO_SNDBUF
  276.      "sendbuf", XYTCP_SENDBUF, 0,
  277.   #endif /* SO_SNDBUF */
  278. + #ifdef VMS
  279. + #ifdef DEC_TCPIP
  280. +    "ucx-port-bug", XYTCP_UCX, 0,
  281. + #endif /* DEC_TCPIP */
  282. + #endif /* VMS */
  283.      "",0,0
  284.   };
  285.   int ntcpopt = (sizeof(tcpopt) / sizeof(struct keytab));
  286. *** /w/pub/ftp/kermit/f/ckuusr.h    Sun Nov 24 19:20:52 1996
  287. --- ./ckuusr.h    Wed Dec  4 16:59:18 1996
  288. ***************
  289. *** 803,808 ****
  290. --- 803,809 ----
  291.   #define  XYTCP_LINGER    3  /* Linger */
  292.   #define  XYTCP_RECVBUF   4  /* Receive Buffer Size */
  293.   #define  XYTCP_KEEPALIVE 5  /* Keep Alive packets */
  294. + #define  XYTCP_UCX       6  /* UCX 2.0 port swabbing bug */
  295.   
  296.   #define XYMSK  83       /* MS-DOS Kermit compatibility options */
  297.   #define  MSK_COLOR 0    /*  Terminal color handling   */
  298. ____________________
  299. X-Patch-Number: 0005
  300. Date: Mon, 9 Dec 1996 17:00:56 EST
  301. From: Frank da Cruz <fdc@columbia.edu>
  302. Subject: C-Kermit Might Send Packets Outside Window
  303.  
  304. PROBLEM:
  305.  
  306. When sending a file with a window size greater than 1 under conditions of
  307. packet loss, C-Kermit might send packets outside the current window.  This
  308. should not cause file corruption, and in many cases (depending on the Kermit
  309. implementation on the receiving end), it won't even cause a noticable problem,
  310. but in other cases it might cause the transfer to stop unnecessarily.
  311.  
  312. CURE:
  313.  
  314. In the ckcfn2.c module, replace the nxtpkt() function with this new one:
  315.  
  316. /*  N X T P K T  --  Next Packet  */
  317. /*
  318.   Get packet number of next packet to send and allocate a buffer for it.
  319.   Returns:
  320.     0 on success, with global pktnum set to the packet number;
  321.    -1 on failure to allocate buffer (fatal);
  322.    -2 if resulting packet number is outside the current window. 
  323. */
  324. int
  325. nxtpkt() {                /* Called by file sender */
  326.     int j, n, x;
  327.  
  328.     debug(F101,"nxtpkt pktnum","",pktnum);
  329.     debug(F101,"nxtpkt winlo ","",winlo);
  330.     n = (pktnum + 1) % 64;        /* Increment packet number mod 64 */
  331.     debug(F101,"nxtpkt n","",n);
  332.     x = chkwin(n,winlo,wslots);        /* Don't exceed window boundary */
  333.     debug(F101,"nxtpkt chkwin","",x);
  334.     if (x)
  335.       return(-2);
  336.  
  337.     j = getsbuf(n);            /* Get a buffer for packet n */
  338.     if (j < 0) {
  339.     debug(F101,"nxtpkt getsbuf failure","",j);
  340.     return(-1);
  341.     }
  342.     pktnum = n;          
  343.     return(0);
  344. }
  345.  
  346. ____________________
  347. X-Patch-Number: 0006
  348. Date: Wed, 11 Dec 1996 12:26:00 EST
  349. From: Frank da Cruz <fdc@columbia.edu>
  350. Subject: MOVE from SEND-LIST does not delete original files
  351.  
  352. If you build up a list of files to be sent using ADD SEND-LIST and then
  353. give a SEND command with no operands, it sends the files in the send list.
  354. If you give a MOVE command with no operands, it does the same thing.  But
  355. unlike SEND, MOVE should delete each original after sending it successfully;
  356. in C-Kermit 6.0.192, it does not.
  357.  
  358. Here's the patch:
  359.  
  360. *** /w/pub/ftp/kermit/f/ckuusr.c    Sun Nov 24 19:20:51 1996
  361. --- ckuusr.c    Wed Dec 11 12:39:01 1996
  362. ***************
  363. *** 2863,2868 ****
  364. --- 2863,2870 ----
  365.               sndsrc = nfils;    /* Like MSEND */
  366.               addlist = 1;    /* But using a different list... */
  367.               filenext = filehead;
  368. +             if (cx == XXMOVE)
  369. +               moving = 1;
  370.               sstate = 's';
  371.               goto sendend;
  372.           } else {        /* Oops, no list. */
  373.  
  374. ____________________
  375. X-Patch-Number: 0007
  376. Date: Thu, 12 Dec 1996 21:11:47 -0500
  377. From: "Richard L. Hamilton" <rlhamil@mindwarp.smart.net>
  378. Subject: Higher serial speeds on Solaris 2.5
  379.  
  380. Here's how I hacked up C-Kermit 6.0 for more of the speeds that
  381. Solaris >= 2.5 supports.
  382.  
  383. This was with the following make command, to get rid of references
  384. to unsupported speeds as well as to help get some of the additional
  385. speeds.  POSIX is a must, 'cause setting speeds > 38400 without
  386. the cfsetospeed() and similar functions is a pain.  The #ifndef VANILLA
  387. was just so I could turn off all my hacks real easily, and it and the
  388. corresponding #endif should probably be removed.
  389.  
  390. make solaris2xg KFLAGS="-DCK_DSYSINI -DCK_INI_B -DCK_WREFRESH -DPOSIX
  391. -DNOB_3600 -DNOB_7200 -DBPS_134 -DBPS_1800 -DBPS_57K -DBPS_76K
  392. -DBPS_115K -DBPS_230K"
  393.  
  394. diff ckutio.c.orig ckutio.c
  395. 4605c4605,4616
  396. ---
  397. > #ifndef VANILLA
  398. > #ifdef SOLARIS
  399. > #ifdef POSIX
  400. > #ifdef BPS_76K
  401. >       case 7680: s = B76800; break;
  402. > #endif /* BPS_76K */
  403. > #ifdef BPS_230K
  404. >       case 23040: s = B230400; break;
  405. > #endif /* BPS_230K */
  406. > #endif /* POSIX */
  407. > #endif /* SOLARIS */
  408. > #endif /* VANILLA */
  409. 4951a4963,4974
  410. > #ifndef VANILLA
  411. > #ifdef SOLARIS
  412. > #ifdef POSIX
  413. > #ifdef BPS_76K
  414. >       case B76800: ss = 76800L; break;
  415. > #endif /* BPS_76K */
  416. > #ifdef BPS_230K
  417. >       case B230400: ss = 230400L; break;
  418. > #endif /* BPS_230K */
  419. > #endif /* POSIX */
  420. > #endif /* SOLARIS */
  421. > #endif /* VANILLA */
  422. diff ckuus3.c.orig ckuus3.c
  423. 328a329,331
  424. > #ifdef BPS_1800
  425. >   "1800", 180, 0,
  426. > #endif /* BPS_1800 */
  427.  
  428. ____________________
  429. X-Patch-Number: 0008
  430. Date: Wed, 18 Dec 1996 11:42:00 EST
  431. From: Frank da Cruz <fdc@columbia.edu>
  432. Subject: C-Kermit application file name can't contain spaces
  433.  
  434. When the first command-line argument to C-Kermit is a filename, C-Kermit 
  435. should execute the commands from the file, e.g.
  436.  
  437.   kermit filename
  438.  
  439. But if the filename contains spaces, this doesn't work in version 6.0, even
  440. if the filename is properly quoted to the shell:
  441.  
  442.   kermit "this is a file name"
  443.  
  444. Here is the patch:
  445.  
  446. *** /w/pub/ftp/kermit/f/ckuus4.c    Sun Nov 24 19:20:50 1996
  447. --- ckuus4.c    Wed Dec 18 11:40:46 1996
  448. ***************
  449. *** 636,642 ****
  450.   */
  451.           cmdini();            /* Allocate command buffers etc */
  452.           cmini(0);            /* Initialize them */
  453. !         strcpy(cmdbuf,yargv[1]);    /* Stuff filename into command buf */
  454.           strcat(cmdbuf,"\r\r");    /* And some carriage returns */
  455.           if ((y = cmifip("","",&s,&x,0,takepath,xxstring)) < 0)
  456.             doexit(BAD_EXIT,xitsta);
  457. --- 636,642 ----
  458.   */
  459.           cmdini();            /* Allocate command buffers etc */
  460.           cmini(0);            /* Initialize them */
  461. !         sprintf(cmdbuf,"{%s}",yargv[1]); /* Put filename in command buf */
  462.           strcat(cmdbuf,"\r\r");    /* And some carriage returns */
  463.           if ((y = cmifip("","",&s,&x,0,takepath,xxstring)) < 0)
  464.             doexit(BAD_EXIT,xitsta);
  465.  
  466. __________________________________
  467. (End of C-Kermit 6.0 PATCHES file)
  468.