source: trunk/third/kermit/PATCHES @ 10780

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