home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckc072.zip / ckvker.bwr < prev    next >
Text File  |  1989-02-14  |  71KB  |  1,955 lines

  1. List of known bugs or problems with C-Kermit under VAX/VMS:
  2.  
  3. Version: 4D(067)
  4. As of: Thu Jan 12 20:27:33 1989
  5.  
  6. See CKUKER.BWR which lists problems with Unix Kermit.  Many of these
  7. problems may also apply to VMS C-Kermit.  This file lists only those that
  8. are unique to VMS C-Kermit.
  9.  
  10. Recent checkout of 4D(067) on a VAX/VMS 4.3 system gives the following results:
  11.  
  12. - The commands mostly seem to work -- help, log, set, show, etc etc.
  13.  
  14. - The basic file transfer and server commands seem to work OK with a couple
  15.   exceptions: "remote cwd" makes the VMS C-Kermit server respond with a wierd
  16.   message.  Text and binary files transfer OK with regular and long packets,
  17.   with CRC's, etc etc, except that when VMS sends a foreign binary file back
  18.   to you, it's padded out to the nearest block with nulls.
  19.  
  20. - Caution is needed with the "!" command.  If it requires a response, the 
  21.   program will hang silently.  E.g. if you say "! delete foo.x;*" instead of
  22.   "! delete/noconfirm foo.x;*".
  23.  
  24. - C-Kermit on VMS doesn't accept command line arguments (maybe there's a
  25.   way to tell DCL to pass them?).
  26.  
  27. - The program doesn't seem to work when parity is involved, even if you
  28.   "set term/parity=odd" or whatever.  The command parser goes catatonic,
  29.   and files don't seem to transfer either.
  30.  
  31. - The command parser is totally screwy if you enter the VMS system via CTERM
  32.   (DECnet terminal service from a DEC-20) -- characters echo twice, editing
  33.   characters don't work, etc.  All this works fine if you enter via a regular
  34.   terminal line.  Don't know what happens over LAT, or SET HOST between VMS
  35.   systems, etc.
  36.  
  37. - ^C^C during file transfer doesn't interrupt the program.  Is VMS swallowing
  38.   them?
  39.  
  40. General problems:
  41.  
  42. - The fact that VMS C-Kermit is built with CKU* files as well as CKC* and
  43.   CKV* files is confusing.  Well...  It's that way because VAX-11 C does
  44.   its best to provide a Unix programming environment -- to the extent it
  45.   succeeds, VMX C-Kermit can use certain Unix-specific modules.
  46.  
  47. - VMS C-Kermit, unlike Bliss Kermit, is NOT interruptible,
  48.   either with ^C or ^Y.  The latter can be interrupted by two (?) ^Ys.
  49.   This is a serious shortcoming.  (There is code whose intention is
  50.   make the program interruptible, but it apparently does not work.)
  51.  
  52. - VMS C-Kermit is less efficient than Bliss Kermit, and may require
  53.   the use of lower baud rates when sending TO it.
  54.  
  55. - If using LAT (Local Area Transport) terminal connections, you may
  56.   need to use a lower baud rate when transferring from your "terminal"
  57.   to the host, or a smaller send-packet length.  Some LAT software doesn't
  58.   expect "fast typing" from the terminal direction (applies mainly to
  59.   old F11-based LAT boxes; newer DECserver-100s and -200s reportedly work fine
  60.   with Kermit, if set up with the right parameters).
  61.  
  62. - VMS VAX-11 C V2 allows DEFINEs by a command line qualifer, and CKVKER.COM
  63.   makes use of this to include debugging and transaction logging code if
  64.   it believes that VAX-C V2 is being used.  VAX-C V1 had no such feature.
  65.   If you want the DEBUG and TLOG symbols defined for use with VAX-C V1,
  66.   modify the CKCDEB.H file.
  67.  
  68. - The local "directory" command defaults to * rather than *.*.
  69.  
  70. - Execution of local commands (C-Kermit>! <command>): 
  71.  
  72. The problem with "! XXX" in VMS is related to the BYTLM in user authorization
  73. file.  For VMS to create a subprocess, the BYTLM must exceed 4096 (which is our
  74. previous setting), and of course, PRCLM must be at least 1.  6144 seems to
  75. work for BYTLM.
  76.  
  77. Here's some material dealing with older releases, which may still apply:
  78.  
  79. ------------------------------
  80.  
  81. Date: Fri, 16 Jan 87 14:34:01 pst
  82. From: ames!styx!elxsi!gumby.ARPA!valid!carolf@cad.Berkeley.EDU
  83. To: CU20B.COLUMBIA.EDU!SY.FDC
  84.  
  85. I've begun to test c-kermit 4D(061) between the S-320 and the MicroVAX, running
  86. VAX version 2.1, and the VAX-11/780 running VMS 4.4.  I compiled c-kermit on
  87. VMS using the CKVKER.COM DCL procedure.  I've found the following problems:
  88.  
  89.  -----------------------------------------------------------------------------
  90.  S-320 -> MicroVAX and VAX-11/780
  91.  -----------------------------------------------------------------------------
  92.  
  93. * Bye doesn't work
  94.   When running kermit from VMS in server mode, type bye, then connect.
  95.   Kermit will connect to the VMS command interpreter rather than logging out
  96.   of the server.  At this point, type logout (which doesn't echo on the screen)
  97.  
  98. * Exit doesn't always work (MicroVAX only)
  99.   Sometimes no action will be taken in response to exit.  Quit always works
  100.   however.
  101.  
  102.  -----------------------------------------------------------------------------
  103.  MicroVAX and VAX-11/780 -> S-320
  104.  -----------------------------------------------------------------------------
  105.  
  106. * Directory doesn't work on VMS
  107.   Directory listed only some of the files in a directory containing several
  108.   files.  Problem is that "dir" defaults to "." rather than "*.*".
  109.   This can be fixed in ckuusr.c.
  110.  
  111. * On the VAX, kermit's output overwrites the prompt and command on the previous
  112.   line.
  113.  
  114. * Remote directory on the VAX could not list UNIX files whose format was not
  115.   correct VMS format.
  116.   c-kermit(VAX-11/780)> remote directory
  117.   c-kermit(VAX-11/780)> - ttini: ttiosb.status:  %SYSTEM-W-DATAOVERUN, data
  118.   overrun (for all filenames too long)
  119.  
  120. UUCP address:  ucbvax!hplabs!pesnta!valid!carolf
  121.  
  122.                                   Carol Fernihough
  123.  
  124. ------------------------------
  125.  
  126. Date: 17 Sep 87 12:23:00 MST
  127. From: <darieb@sandia-2.arpa>
  128. Subject: 4E C_Kermit on VAX/VMS
  129.  
  130. I've just downloaded the newest XK* versions to VAX VMS 4.5.  It compiled
  131. without a hitch, using the XKVKER.COM.  It even transferred a file OK.  
  132. However, there are a couple of problems:
  133.  
  134. -   The show command produces a lot of unprintable characters in the
  135.     header lines of the table ("send" and "receive"), after which
  136.     several of the lines contain gibberish.  After the SHOW, things go 
  137.     back to normal (except see below)
  138.  
  139. -   After many commands are executed, and the C_Kermit> prompt shows, 
  140.     typing another command responds with ?invalid - xxx.  Typing an 
  141.     erase-line character (CTRL-U on VMS) before doing anything else
  142.     will erase 3 characters of the prompt, indicating that three charac-
  143.     ters must have been received by VMS from the terminal(?)  I can easily
  144.     get around this problem by habitually typing <CTRL-U>command...but who
  145.     wants to?
  146.  
  147. Is it possible that I need to SET TERMINAL to something different before
  148. executing Kermit?  Or are there indeed spurious characters being sent by
  149. C_Kermit?  At any rate, this version works OK, but the BLISS version is
  150. the system standard here.
  151.  
  152. Declan A. Rieb, Division 2614        DARIEB@SANDIA-2.ARPA
  153. Sandia National Laboratories        (505) 844-6338
  154. Albuquerque, NM 87185-5800
  155.  
  156. ------------------------------
  157.  
  158. Date: Thu 17 Sep 87 15:48:24-EDT
  159. From: Frank da Cruz <SY.FDC@CU20B.COLUMBIA.EDU>
  160. Subject: Re: 4E C_Kermit on VAX/VMS
  161. To: darieb@SANDIA-2.ARPA
  162.  
  163. How are you connected to the VMS system?  Normal TTY line?  Or some kind of
  164. terminal server or SET HOST, etc?  I tried both ways (on a VMS 4.3 system) and
  165. found that the screen looked fine with a regular TTY line, and there were all
  166. kinds of garble, character doubling, prompt-erasing, etc, when I came in
  167. thru a network.  Can you give more details about your connection, the VMS
  168. version, and maybe do a SHOW TERM?  Thanks!  - Frank
  169.  
  170. ------------------------------
  171.  
  172. Date: 17 Sep 87 15:17:00 MST
  173. From: <darieb@sandia-2.arpa>
  174. Subject: Re: 4E C_Kermit on VAX/VMS
  175.  
  176. Boy, was that a quick reply!!!!
  177.  
  178. We're running VMS 4.5.  I'm running an IBM PC/XT at 9600 Baud using the
  179. VTERM 4010 Version 2.0 software from Coefficient Systems Corporation, which
  180. supplies a pretty good VT102 emulation.  Connection is through COM1: to a 
  181. Gandalf LDS120 line driver, into a Gandalf (I think) port contender device,
  182. thence to a VAX 8600.  No other DECNET.  The BLISS version of KERMIT works
  183. OK.  (My connection to the CDC VX/VE which runs this KERMIT OK was through
  184. identically the same topology, except for the final step...)
  185.  
  186. Using the PC, I was able to copy what happened onto disk.  I am forwarding it
  187. to you below.  The funny characters, which show in VMS EDT as <+->, showed on
  188. my PC screen as pillows.  Kermit's normal output seems to be interspersed 
  189. between these.  The gibberish starts after the packet length data.  After
  190. executing the SHOW, I immediately tried two STAT's.  The first worked, the
  191. second didn't.  It's the second which I can cure by prepending the line-
  192. cancel character <ctrl-u>.  None of this happens, using the same terminal/
  193. parameters, when using the BLISS Kermit, nor, I believe, the previous version
  194. of C_Kermit.
  195.  
  196. The following is what I saw and did using KERMIT:
  197. C-Kermit>show
  198.  
  199. C-Kermit, 4E(066) 4 Aug 87, Vax/VMS, Communications Parameters:
  200. 1 1L1i1n1e1:1 1T1T1:1,1 1s1p1e1e1d1:1 1-111,1 1m1o1d1e1:1 1r1e1m1o1t1e1,1 1m1o1d
  201. 1e1m1-1d1i1a1l1e1r1:1 1d1i1r1e1c1t1
  202.  1 1B1i1t1s1:1 181,1 1p1a1r1i1t1y1:1 none, duplex: full, flow: xon/xoff, handsha
  203. ke: none
  204. Terminal emulation: 7 bits
  205.  
  206. Protocol Parameters:   Send    Receive
  207.  Timeout:               10        7
  208.  Padding:                0        0        Block Check:      1
  209.  Pad Character:          0        0        Delay:            5
  210.  Packet Start:           1        1        Max Retries:     10
  211.  Packet End:            13       13
  212.  Packet Length:         90       90
  213. Krti l riii akLg  sa:n     astoLg o
  214.  
  215. ?Invalid -
  216. C-Kermit>stat
  217.  
  218. Most recent transaction --
  219.  files: 0
  220.  total file characters  : 0
  221.  communication line in  : 0
  222.  communication line out : 0
  223.  elapsed time           : 0 sec
  224.  
  225. C-Kermit>stat
  226.  
  227. ?Invalid - stat
  228. C-Kermit>exit
  229.  
  230. $ show terminal
  231. Terminal: _VTA665:    Device_Type: VT102         Owner: Declan Rieb
  232. Physical terminal: _TXB1:                     Username: DARIEB
  233.  
  234.    Input:   9600      LFfill:  0      Width:  80      Parity: None
  235.    Output:  9600      CRfill:  5      Page:   24
  236.  
  237. Terminal Characteristics:
  238.    Interactive        Echo               Type_ahead         No Escape
  239.    Hostsync           TTsync             Lowercase          Tab
  240.    Wrap               Scope              Remote             No Eightbit
  241.    Broadcast          No Readsync        No Form            Fulldup
  242.    Modem              No Local_echo      Autobaud           Hangup
  243.    No Brdcstmbx       DMA                Altypeahd          Set_speed
  244.    Line Editing       Overstrike editing No Fallback        Dialup
  245.    No Secure server   Disconnect         No Pasthru         No Syspassword
  246.    No SIXEL Graphics  No Soft Characters Printer port       Numeric Keypad
  247.    ANSI_CRT           No Regis           No Block_mode      Advanced_video
  248.    Edit_mode          DEC_CRT            No DEC_CRT2
  249.  
  250. Declan A. Rieb                DARIEB@SANDIA-2.ARPA
  251. Division 2614                (505) 844-6338
  252. Sandia National Laboratories
  253. Albuquerque NM 87185-5800
  254.  
  255. ------------------------------
  256.  
  257. Date: 17 SEP 1987  15:57 EDT
  258. From: Steve Roseman <LUSGR@LEHICDC1.BITNET>
  259. Subject: C-Kermit 4E(067) on VAX/VMS
  260.  
  261. Running C-Kermit 4E(067) under VMS V4.5 seems to work so far, with 3 problems.
  262.  
  263. 1.  The user needs a BYTLM quota of at least 5000 to execute a "! xxx" command,
  264.     "DIR", or "SPACE".  Otherwise the job just hangs up.
  265.  
  266. 2.  With a sufficient BYTLM, the above work, but if any are done, C-Kermit
  267.     leaves behind a subprocess when it exits.  Re-entering C-Kermit and
  268.     executing any of the above starts up (and then leaves behind again)
  269.     another subprocess.  Repeat until your job hangs up.
  270.  
  271. 3.  A "! LOGOUT" command kills the subprocess in which it executes;  another
  272.     "! xxx" command just hangs, since C-Kermit doesn't seem to know it's
  273.     gone.
  274.  
  275.     Fairly minor problems, but file transfers run well with 1000 char packets.
  276.  
  277.                                                       Steve Roseman
  278.                                                       Lehigh Univ.
  279.  
  280. ------------------------------
  281.  
  282. Date: 19 Oct 87 10:49:00 EDT
  283. From: "ETD1::LABOVITZ" <labovitz%etd1.decnet@afwal-aaa.arpa>
  284. Subject: VMS 4.6 Bug Report with C-Kermit 4E(067)
  285. Keywords: VAX/VMS Kermit, C-Kermit
  286.  
  287. I have just compiled the source modules for C-Kermit 4E(067) under VAX/VMS 4.6
  288. on our VAX 11/785, using the supplied XMVKER.COM file.  During the final
  289. link of the KERMIT executable, the following warning message is produced
  290. by the linker:
  291.     %LINK-W-MULDEF, symbol SYSTEM multiply defined
  292.         in module C$UNIX file SYS$COMMON:[SYSLIB]VAXCRTL.OLB;1
  293.  
  294. While I have not had a chance to confirm this with our DEC Software Analyst
  295. (he's on vacation until next week), this seems to be directly attributable
  296. to the new VMS 4.6 C Run Time Library.  
  297.  
  298. Other than producing a warning message, however, our new version of KERMIT
  299. seems to be running well thus far.  If any other problems arise, I will forward
  300. them to Info-Kermit, otherwise it will soon replace our current version
  301. of KERMIT-32.
  302.  
  303.                     LT Stuart Labovitz
  304.                 arpa:    LabovitzSL@Afwal-aaa.ARPA
  305.                 arpa:    Labovitz%Etd1.DECNET@Afwal-aaa.ARPA
  306.  
  307. ------------------------------
  308.  
  309. From: schullman%aqua.DEC@decwrl.dec.com (Dan Schullman
  310.  * {617-46,29}7-4576 * MRO1-2/E47)
  311. Date: 27 Oct 87 09:43
  312. Subject: VMS Kermit
  313.  
  314. Frank,
  315.  
  316.     How you been?  I recently had need for KERMIT (after not using
  317.     it for over a year), then I end up helping somebody else in my
  318.     group with it, and then I get some internet mail about it!  When
  319.     it rains it pours [frogs]!
  320.  
  321.     Anything going on with the C version of KERMIT?  I haven't checked,
  322.     but believe it does not support the "new" VMS V4 file names and
  323.     types which may be much longer and also contain hyphens and dollar-
  324.     signs and underscores.
  325.  
  326.     Also thinking it might make more sense to use a VMS logical for
  327.     the init file.  If you "speak" DCL, it would be something like:
  328.  
  329.         IF F$TRNLNM("KERMRC") .EQS. " " THEN GOTO IGNORE_INIT_FILE
  330.         I_SPEC = F$PARSE("KERMRC","SYS$DISK:[].INI",,,"SYNTAX_ONLY")
  331.         IF I_SPEC .EQS. "" THEN GOTO IGNORE_BAD_INIT_SPEC
  332.         I_FILE = F$SEARCH(I_SPEC)
  333.         IF I_FILE .NES. "" THEN GOTO FOUND_INIT_FILE
  334.         I_SPEC = F$PARSE("KERMRC","SYS$LOGIN:.INI",,,"SYNTAX_ONLY")
  335.         IF I_SPEC .EQS. "" THEN GOTO IGNORE_BAD_INIT_SPEC
  336.         I_FILE = F$SEARCH(I_SPEC)
  337.         IF I_FILE .NES. "" THEN GOTO FOUND_INIT_FILE
  338.         GOTO INIT_FILE_NOT_FOUND
  339.  
  340.     This would allow:
  341.  
  342.         KERMRC to be a VMS logical that pointed at an init file:
  343.             DEFINE  KERMRC  SYS$LOGIN:TTA3_AT_2400_BAUD.KINIT
  344.  
  345.         System (or group) defaults for init files (with user-defined
  346.         logical having precedence):
  347.             DEFINE/SYSTEM  KERMRC  ...
  348.             DEFINE/GROUP   KERMRC  ...
  349.         
  350.         Ability to ignore system/group/job/process predefined logicals:
  351.             DEFINE  KERMRC  " "    !a single space
  352.  
  353.         In the absence of KERMRC logical, look first for KERMRC.INI
  354.         in current directory and if that doesn't exist look for it
  355.         in SYS$LOGIN.
  356.  
  357.         If KERMRC is not a full file spec, supply defaults of
  358.             SYS$DISK:[]KERMRC.INI        (first try)
  359.             SYS$LOGIN:KERMRC.INI        (second try)
  360.         For example:
  361.             DEFINE  KERMRC  COLUMBIA
  362.         would try:
  363.             SYS$DISK:[]COLUMBIA.INI        (first attempt)
  364.             SYS$LOGIN:COLUMBIA.INI        (second attempt)
  365.         but
  366.             DEFINE  KERMRC  KERMIT$DIR:.2400
  367.         would only try (because directory was specified):
  368.             KERMIT$DIR:KERMRC.2400
  369.  
  370.     You sufficiently confused now?  Unfortunately it would NOT be
  371.     backwards compatible with the old name of KERMIT.INI, but I feel
  372.     it would be more more useful.  The current code also looks first
  373.     in SYS$LOGIN rather than the current directory.  The "new"
  374.     approach could allow directory-specific init (e.g., file-type).
  375.     You could take the DCL code above, add the necessary labels and
  376.     have them display the spec and resulting file, and try it.  For
  377.     example:
  378.  
  379.         $TRY_ANOTHER:
  380.         $    READ SYS$COMMAND VALUE /PROMPT="Value for KERMRC: "
  381.         $    DEFINE/NOLOG KERMRC "''VALUE'"
  382.         $    IF VALUE .EQS. "-" THEN DEASSIGN KERMRC
  383.         $!
  384.         $!    put code from above in here, prefixed with "$"
  385.         $!
  386.         $IGNORE_INIT_FILE:
  387.         $    WRITE SYS$OUTPUT "No init file will be used."
  388.         $    GOTO TRY_ANOTHER
  389.         $IGNORE_BAD_INIT_SPEC:
  390.         $    WRITE SYS$OUTPUT "Bad spec (",I_SPEC,") ignored."
  391.         $    GOTO TRY_ANOTHER
  392.         $FOUND_INIT_FILE:
  393.         $    WRITE SYS$OUTPUT "Spec: ",I_SPEC,"  File: ",I_FILE
  394.         $    GOTO TRY_ANOTHER
  395.         $etc...
  396.  
  397.     Comments?  Suggestions?  I don't know how soon I'd get these changes
  398.     made.  Between family, house, and work I'm pretty busy!
  399.  
  400.                         Be well,
  401.                           Dan S.
  402.  
  403. ------------------------------
  404.  
  405. Date: Tue, 10 Nov 87 14:44 CST
  406. From: <MCGUIRE%GRIN2.BITNET@CUVMA.COLUMBIA.EDU>
  407. Subject: RE: VMS 4.6 Bug Report with C-Kermit 4E(067)
  408. Keywords: C-Kermit, VMS Kermit
  409.  
  410. > Date: 19 Oct 87 10:49:00 EDT
  411. > From: "ETD1::LABOVITZ" <labovitz%etd1.decnet@afwal-aaa.arpa>
  412. > Subject: VMS 4.6 Bug Report with C-Kermit 4E(067)
  413. >
  414. > I have just compiled the source modules for C-Kermit 4E(067) under VAX/VMS
  415. > 4.6 on our VAX 11/785, using the supplied XMVKER.COM file.  During the
  416. > final link of the KERMIT executable, the following warning message is
  417. > produced by the linker:
  418. >
  419. >     %LINK-W-MULDEF, symbol SYSTEM multiply defined
  420. >         in module C$UNIX file SYS$COMMON:[SYSLIB]VAXCRTL.OLB;1
  421. >
  422. > While I have not had a chance to confirm this with our DEC Software Analyst
  423. > (he's on vacation until next week), this seems to be directly attributable
  424. > to the new VMS 4.6 C Run Time Library.
  425. >
  426. > [Ed. - Thanks for the report.  It's been forwarded to the new C-Kermit/VMS
  427. > developer and added to the XKVKER.BWR file.  Since compilation and linking
  428. > were tested with VAX-11 C 2.3 on VMS 4.6, and this problem didn't arise,
  429. > the culprit is indeed most likely the runtime system.]
  430.  
  431. Was C-Kermit/VMS really tested under VMS V4.6?  Before VMS V4.6, there was
  432. no `system' function in the VAX C runtime library.  Starting with VMS V4.6,
  433. Digital provides a `system' function.  The error message basically
  434. indicates that the linker was provided with two routines named `system'.
  435. It sounds like the developer of C-Kermit/VMS implemented `system' in the
  436. code, and that it now conflicts with the new V4.6 standard `system'.
  437.  
  438. It should be straightforward for VMS V4.6 users to remove the definition
  439. of `system' from the C-Kermit/VMS code and recompile/relink.  Perhaps the
  440. developer can find some nifty way to define `system' conditionally
  441. depending upon which VMS version is being used.
  442.  
  443. Ed
  444.  
  445. ------------------------------
  446.  
  447. Date: 2 Feb 88 21:01:00 EST
  448. From: "FRODO::CHERRY" <cherry%frodo.decnet@mghccc.harvard.edu>
  449. Subject: Log session fix for VMS and CKERMIT
  450.  
  451. Here is a fix for C-Kermit on VMS systems. The session log will not work
  452. as distributed. The fix is simple. In file ckvfio.c change the two
  453. occurences of "fp[n]->_file" to "fileno(fp[n])". This is obviously not
  454. the best solution as fileno is called everytime the zsoutx() and zchout()
  455. functions are called. Perhaps this can be changes in the next version. 
  456. I know this problem exists in C-Kermit versions from 4D(061) to 4E(070), 
  457. but presumably in older versions as well.
  458.  
  459. line #232 was:
  460. return(write(fp[n]->_file,s,x));
  461. change to:
  462. return(write(fileno(fp[n]),s,x));
  463.  
  464. line #241 was:
  465. return(write(fp[n]->_file,&c,1)); /* Use unbuffered for session log */
  466. change to:
  467. return(write(fileno(fp[n]),&c,1)); /* Use unbuffered for session log */
  468.  
  469. Mike Cherry      Dept. of Molecular Biology, Mass. General Hospital, Boston
  470. cherry@husc4.harvard.edu    or     cherry%frodo.decnet@mghccc.harvard.edu
  471.  
  472. ------------------------------
  473.  
  474. Date: Tue, 22 Mar 88 18:15:49 est
  475. From: Dick Schofield <rschofield@lucy.wellesley.edu>
  476. To: frank_da_cruz@lucy.wellesley.edu, rschofield@lucy.wellesley.edu
  477. Subject: VMS C-Kermit 4E(069)
  478.  
  479. I've not seen mentioned in any of the INFO-KERMIT digests of a problem
  480. with VMS C-Kermit 4E(069) session logging.  We're just not able to
  481. capture a log.
  482.  
  483. A sample session might look like:
  484.  
  485.     LOG SESSION SESSION.LOG
  486.     CONNECT
  487.     do our thing
  488.     CLOSE SESSION    (we've tried omitting this step as well)
  489.     EXIT
  490.  
  491. We get a file named SESSION.LOG, but it contains 0 bytes.
  492.  
  493. Second problem:
  494.  
  495. Neither BYE nor LOGOUT server commands accomplish anything at the
  496. server end.  Though I've seen this mentioned in the INFO-KERMIT
  497. digest, I'm not sure what the solution is.
  498.  
  499. Last problem (very, very minor, but thought you'd like to know):
  500.  
  501. If (and only if) a KERMIT.INI file exists, when you EXIT, your VMS
  502. prompt overlays the last C-Kermit> prompt because (I think) of a
  503. missing linefeed (following the existing carriage-return).
  504.  
  505. -----
  506.  
  507. We're extremely pleased with this latest version.  Using extended
  508. length packets (of 1000 chars), we quite regularly get an effective
  509. baud rate of 4900-5000 baud on a 4800 baud link -- through DEC
  510. terminal servers yet!
  511.  
  512. Dick Schofield
  513. Director of Academic Computing
  514. Wellesley College
  515. Wellesley, MA 02181
  516. (617) 235-0320 Ext. 3107
  517. RSCHOFIELD@LUCY.WELLESLEY.EDU (Internet)
  518.  
  519. ------------------------------
  520.  
  521. Date: Wed 20 Apr 88 15:42:14-PDT
  522. From: Ted Shapin <BEC.SHAPIN@ECLA.USC.EDU>
  523. Subject: Fixes for C-Kermit 4E(70) for VMS
  524. To: info-kermit@CU20B.COLUMBIA.EDU
  525. Phone: (714)961-3393; Mail:Beckman Instruments, Inc.
  526. Mail-addr: 2500 Harbor Blvd., X-11, Fullerton CA 92634
  527.  
  528. Here are two fixes for C-Kermit 4E(70) we made for our
  529. VAX VMS system.
  530. Fixes are from Will Wood, Beckman Instruments, Fullerton, CA.
  531. - - - - - - - -
  532. *
  533. * here is the 2 edits for ckvfio.c
  534. *
  535. ************
  536. File METHODS:[WKWOOD.KERMIT]CKVFIO.C;9
  537.     1   char *ckzv = "VMS file support, 1.0(012), 20 APR 88";
  538.     2   char *ckzsys = " Vax/VMS";
  539. ******
  540. File METHODS:[WKWOOD.KERMIT.ORIG]CKVFIO.C;2
  541.     1   char *ckzv = "VMS file support, 1.0(010), 24 Jan 88";
  542.     2   char *ckzsys = " Vax/VMS";
  543. ************
  544. ************
  545. File METHODS:[WKWOOD.KERMIT]CKVFIO.C;9
  546.    24    * 011 18-apr-88 WKW (BII) Do SYS$DELPRC instead of unix kill in zkself
  547.    25    * 012 20-apr-88 WKW (BII) make zgtdir() work..
  548.    26    */
  549. ******
  550. File METHODS:[WKWOOD.KERMIT.ORIG]CKVFIO.C;2
  551.    24    */
  552. ************
  553. ************
  554. File METHODS:[WKWOOD.KERMIT]CKVFIO.C;9
  555.    76   #include <jpidef.h>            /* 011 for SYS$GETJPI */
  556.    77   #include stdlib                /* 012 for getcwd */
  557.    78
  558. ******
  559. File METHODS:[WKWOOD.KERMIT.ORIG]CKVFIO.C;2
  560.    74
  561. ************
  562. ************
  563. File METHODS:[WKWOOD.KERMIT]CKVFIO.C;9
  564.    98   static int parent_pid,master_pid;    /* 011 master pid and parent_pid */
  565.    99   zkself() {
  566.   100   /*
  567.   101    011
  568.   102       We start a chain reaction whereby we'll loop through until we find the
  569.   103       top pid in the job, we'll then issue a $DELPRC call to cancel him off.
  570.   104   */
  571.   105           struct { short buflen, code; char *bufadr; short *retlen; } itmlst[2];
  572.   106                       /* 011 set up itmlst */
  573.   107       master_pid = 0;            /* 011 set master and parent diff. */
  574.   108       parent_pid = 1;
  575.   109       while(master_pid != parent_pid) { /* loop until done */
  576.   110             itmlst[0].buflen = 4;        /* 011 4 bytes storage */
  577.   111             itmlst[0].code   = JPI$_MASTER_PID; /* 011 we want the pid of our */
  578.   112             itmlst[0].bufadr = &parent_pid; /* 011 put the parent pid here */
  579.   113             itmlst[0].retlen = 0;
  580.   114             itmlst[1].buflen = 0;
  581.   115             itmlst[1].code   = 0;
  582.   116         SYS$GETJPIW(0,&master_pid,0,&itmlst,0,0,0);
  583.   117         if(master_pid != parent_pid) {
  584.   118           master_pid = parent_pid;    /* 011 assign new master */
  585.   119           parent_pid = 0;        /* 011 reset so we'll find the next */
  586.   120         }
  587.   121       }
  588.   122       return((SYS$DELPRC(&master_pid) & 7) == 1);    /* 011 delete the whole job */
  589.   123   }
  590. ******
  591. File METHODS:[WKWOOD.KERMIT.ORIG]CKVFIO.C;2
  592.    94   zkself() {
  593.    95       return (kill(0,9));
  594.    96   }
  595. ************
  596. ************
  597. File METHODS:[WKWOOD.KERMIT]CKVFIO.C;9
  598.   259         return(write(fileno(fp[n]),s,x));
  599.   260   }
  600. ******
  601. File METHODS:[WKWOOD.KERMIT.ORIG]CKVFIO.C;2
  602.   232       return(write(fp[n]->_file,s,x));
  603.   233   }
  604. ************
  605. ************
  606. File METHODS:[WKWOOD.KERMIT]CKVFIO.C;9
  607.   268       return(write(fileno(fp[n]),&c,1)); /* use unbuffered for session log */
  608.   269       else {
  609. ******
  610. File METHODS:[WKWOOD.KERMIT.ORIG]CKVFIO.C;2
  611.   241           return(write(fp[n]->_file,&c,1)); /* Use unbuffered for session log */
  612.   242       else {
  613. ************
  614. ************
  615. File METHODS:[WKWOOD.KERMIT]CKVFIO.C;9
  616.   429   /* 012 make this work */
  617.   430
  618. ******
  619. File METHODS:[WKWOOD.KERMIT.ORIG]CKVFIO.C;2
  620.   402
  621. ************
  622. ************
  623. File METHODS:[WKWOOD.KERMIT]CKVFIO.C;9
  624.   433         char cwdbuf[100];
  625.   434         char *buf;
  626.   435         buf = cwdbuf;
  627.   436       return(getcwd(buf,100));
  628.   437   }
  629. ******
  630. File METHODS:[WKWOOD.KERMIT.ORIG]CKVFIO.C;2
  631.   405   /*    char *getcwd();
  632.   406   /*    char cwdbuf[100];
  633.   407   /*    char *buf;
  634.   408   /*    buf = cwdbuf;
  635.   409   /*    return(getcwd(buf,100));
  636.   410   */
  637.   411       return("");  /* Can't seem to make LINK find getcwd()... */
  638.   412   }
  639. ************
  640.  
  641. Number of difference sections found: 8
  642. Number of difference records found: 40
  643.  
  644. DIFFERENCES /IGNORE=()/MERGED=1/OUTPUT=METHODS:[WKWOOD.KERMIT]CKVFIO.DIFF;1-
  645.     METHODS:[WKWOOD.KERMIT]CKVFIO.C;9-
  646.     METHODS:[WKWOOD.KERMIT.ORIG]CKVFIO.C;2
  647.  
  648. *
  649. * here is the edit for ckvtio
  650. *
  651. ************
  652. File METHODS:[WKWOOD.KERMIT]CKVTIO.C;7
  653.     1   char *ckxv = "VMS tty I/O, 1.0(014), 18 APR 88";
  654.     2
  655. ******
  656. File METHODS:[WKWOOD.KERMIT.ORIG]CKVTIO.C;1
  657.     1   char *ckxv = "VMS tty I/O, 1.0(013), 14 Sep 87";
  658.     2
  659. ************
  660. ************
  661. File METHODS:[WKWOOD.KERMIT]CKVTIO.C;7
  662.     6    * 014    18-APR-88 WKW (BII)
  663.     7    *            Fix def of ttmode structure to correctly resemble
  664.     8    *            data types.  CHAR was used and this caused a little
  665.     9    *            grief.  Additionally, I have noticed that if the
  666.    10    *            terminal calling C-KERMIT is not native (i.e.
  667.    11    *            unknown to VMS directly,  The TTVT and TTRES
  668.    12    *            qios will fail with a -F-BADPARAM.  If this becomes
  669.    13    *            a problem a check at both of these to see if the
  670.    14    *            .type == 0 then we should set it to something.
  671.    15    *
  672.    16    * 013 14 Sep 87 FdC    Add parity strip to ttinl(), add syscleanup().
  673. ******
  674. File METHODS:[WKWOOD.KERMIT.ORIG]CKVTIO.C;1
  675.     6    * 013 14 Sep 87 FdC    Add parity strip to ttinl(), add syscleanup().
  676. ************
  677. ************
  678. File METHODS:[WKWOOD.KERMIT]CKVTIO.C;7
  679.   110   #include <tt2def.h>            /* 014 declare it for extended funcs */
  680.   111   #include <ssdef.h>
  681. ******
  682. File METHODS:[WKWOOD.KERMIT.ORIG]CKVTIO.C;1
  683.   100   #include <ssdef.h>
  684. ************
  685. ************
  686. File METHODS:[WKWOOD.KERMIT]CKVTIO.C;7
  687.   137   /*
  688.   138    014 use byte references instead of char (works better for value conversion)
  689.   139   */
  690.   140   struct tt_mode {
  691.   141       unsigned int class : 8, type : 8;    /* 014 class and type are ubyte */
  692.   142       unsigned short width;        /* 014 */
  693.   143       unsigned int basic : 24;        /* 014 */
  694.   144       unsigned int length : 8;        /* 014 */
  695.   145       unsigned int extended;        /* 014 */
  696.   146   };
  697. ******
  698. File METHODS:[WKWOOD.KERMIT.ORIG]CKVTIO.C;1
  699.   126
  700.   127   struct tt_mode {
  701.   128       char class, type;
  702.   129       short width;
  703.   130       int basic : 24;
  704.   131       char length;
  705.   132       long extended;
  706.   133   };
  707. ************
  708. ************
  709. File METHODS:[WKWOOD.KERMIT]CKVTIO.C;7
  710.   228            &ttold, sizeof(ttold), 0, 0, 0, 0))) return(-1);
  711.   229
  712. ******
  713. File METHODS:[WKWOOD.KERMIT.ORIG]CKVTIO.C;1
  714.   215            &ttold, sizeof ttold, 0, 0, 0, 0))) return(-1);
  715.   216
  716. ************
  717. ************
  718. File METHODS:[WKWOOD.KERMIT]CKVTIO.C;7
  719.   277                &ttold, sizeof(ttold), 0, 0, 0, 0))) return(-1);
  720.   278       return(0);
  721. ******
  722. File METHODS:[WKWOOD.KERMIT.ORIG]CKVTIO.C;1
  723.   264                &ttold, sizeof ttold, 0, 0, 0, 0))) return(-1);
  724.   265       return(0);
  725. ************
  726. ************
  727. File METHODS:[WKWOOD.KERMIT]CKVTIO.C;7
  728.   309                    &ttraw, sizeof(ttraw), s, 0, 0, 0))) return(-1);
  729.   310       ttflui();                /* Flush any pending input */
  730. ******
  731. File METHODS:[WKWOOD.KERMIT.ORIG]CKVTIO.C;1
  732.   296                    &ttraw, sizeof ttraw, s, 0, 0, 0))) return(-1);
  733.   297       ttflui();                /* Flush any pending input */
  734. ************
  735. ************
  736. File METHODS:[WKWOOD.KERMIT]CKVTIO.C;7
  737.   335                 &ttraw, sizeof(ttraw), s, 0, 0, 0))) return(-1);
  738.   336   }
  739. ******
  740. File METHODS:[WKWOOD.KERMIT.ORIG]CKVTIO.C;1
  741.   322                 &ttraw, sizeof ttraw, s, 0, 0, 0))) return(-1);
  742.   323   }
  743. ************
  744.  
  745. Number of difference sections found: 8
  746. Number of difference records found: 25
  747.  
  748. DIFFERENCES /IGNORE=()/MERGED=1/OUTPUT=METHODS:[WKWOOD.KERMIT]CKVTIO.DIFF;1-
  749.     METHODS:[WKWOOD.KERMIT]CKVTIO.C;7-
  750.     METHODS:[WKWOOD.KERMIT.ORIG]CKVTIO.C;1
  751.  
  752. ------------------------------
  753.  
  754. Date: Sat, 21 May 88 14:39:59 EDT
  755. From: elsie!ado@ncifcrf.gov (Arthur David Olson)
  756. Subject: RE: VAX C-Kermit Over X.25 PADs
  757. Keywords: C-kermit
  758.  
  759. Re: Info-Kermit Digest V7 #12:
  760.  
  761. > We have a (*very* slow) VAX-11/780 running VMS 4.7; terminals connected to 
  762. > X25 PADs and make X29 calls into the VAX. We have all our lines set for 9600
  763. > baud. C-Kermit works OK with normal packet sizes, and it sends files *to* the
  764. > PC with 250 byte packets OK. However, trying to use any packet size about 200
  765. > bytes or so *from* the PC results in repeated retries; the log shows that the
  766. > VAX is giving "Data Overrun" errors on about 1 in 3 packets.
  767.  
  768. The same sort of thing happens with PCs connected via DZ11s; the VAX just
  769. can't drain the DZ11's silo fast enough, resulting in silo overflow.
  770.  
  771. So. . .here at elsie we don't even try; we've set MAXRP to 94.
  772.  
  773.    *** 1.1/ckcker.h    Sat May 21 14:37:26 1988
  774.    --- 1.4/ckcker.h    Sat May 21 14:37:28 1988
  775.    ***************
  776.    *** 26,31 ****
  777.    --- 26,35 ----
  778.      
  779.      #define MAXSP 2048            /* Send packet buffer size  */
  780.      #define MAXRP 1024            /* Receive packet buffer size  */
  781.    + #ifndef ASWAS
  782.    + #undef MAXRP
  783.    + #define MAXRP 94            /* ...or suffer buffer overruns */
  784.    + #endif /* !defined ASWAS */
  785.      #define MAXWS 1                /* Maximum window size */
  786.      
  787.      /* Kermit parameters and defaults */
  788. -- 
  789.     Canada's program is to spaceflight as the carrier pigeon is to mail.
  790.     ado@ncifcrf.gov            ADO is a trademark of Ampex.
  791.  
  792. ------------------------------
  793.  
  794. Date: Tue 12 Jul 88 10:32:38-PDT
  795. From: Ted Shapin <BEC.SHAPIN@ECLA.USC.EDU>
  796. Subject: Possible C-kermit bug
  797. Phone: (714)961-3393; Mail:Beckman Instruments, Inc.
  798. Mail-addr: 2500 Harbor Blvd., X-11, Fullerton CA 92634
  799.  
  800. In C-KERMIT 4E(070) for Vax/VMS I can start it on the VAX,
  801. do a CWD one time, but after that first time, if I try to do
  802. another CWD, I stay in the same directory.
  803.  
  804. Has anyone seen this on (a) the VAX, (b) other systems?
  805.  
  806. Ted.
  807.  
  808. ------------------------------
  809.  
  810. Date: Tue, 8 Mar 88 00:13:01 est
  811. From: Brendan Reilly <reilly@aqua.whoi.edu>
  812. Site: Woods Hole Oceanographic Institution, Woods Hole Mass.
  813. Subject: Problem with latest version of C-KERMIT on VMS
  814. Keywords: C-Kermit and VMS
  815.  
  816. After compiling KERMIT with the latest CC from Digital it appears that both
  817. KERMIT and VMS/CC have a procedure named system.  I've changed the KERMIT
  818. reference to vms_system, but I'm still having a problem with server mode.
  819. When talking to the VMS side in server mode from a PC running the latest
  820. KERMIT and I issue a REMOTE CWD [reilly.a] I'm asked for a password, to
  821. which I reply with a return and then see some garbage characters typed on
  822. the screen.  If I then do a REMOTE DIR it's a surprise to find that I'm
  823. still in the original directory - not [REILLY.A] Has anyone else seen this?
  824.  
  825. [Ed. - There's definitely some kind of bug in VMS C-Kermit in this area.
  826. When I try this, the VMS C-Kermit server goes into an infinite unstoppable
  827. loop printing messages issued by its "ttinl()" function: "SYS$QIOW:
  828. %SYSTEM-F-EXQUOTA, exceeded quota", and "%NONAME-W-NOMSG, Message number 0".
  829. Another one for the bug list.]
  830.  
  831. ------------------------------
  832.  
  833. Date: Wed, 08 Jun 88 10:04:12 EST
  834. From: PIQUE%UCONNVM.BITNET@MITVMA.MIT.EDU
  835. Subject: C-Kermit 4E(070) under Vax/VMS using parity
  836.  
  837. I compiled C-Kermit 4E(070) under Vax/VMS, using version 1.0(013) of the VMS
  838. tty I/O module, CKVTIO.C.  The fixes present to make it work properly when
  839. parity is being used didn't work properly because ttprty was never set in
  840. CKVTIO.C.  Here's a partial fix:
  841.  
  842. ************
  843. File DUB1:[COMMON.C-KERMIT]CKVTIO.C;2
  844.    53      ttpkt(speed,flow,parity)-- Put the tty in packet mode and set the spe
  845.    54      ttvt(speed,flow)        -- Put the tty in virtual terminal mode.
  846. ******
  847. File DUB1:[COMMON.C-KERMIT]CKVTIO.C;1
  848.    53      ttpkt(speed,flow)       -- Put the tty in packet mode and set the spe
  849.    54      ttvt(speed,flow)        -- Put the tty in virtual terminal mode.
  850. ************
  851. ************
  852. File DUB1:[COMMON.C-KERMIT]CKVTIO.C;2
  853.   279   ttpkt(speed,flow,parity) int speed, flow, parity; {
  854.   280       extern char ttname[];
  855. ******
  856. File DUB1:[COMMON.C-KERMIT]CKVTIO.C;1
  857.   279   ttpkt(speed,flow) int speed, flow; {
  858.   280       extern char ttname[];
  859. ************
  860. ************
  861. File DUB1:[COMMON.C-KERMIT]CKVTIO.C;2
  862.   283       ttprty = parity;                 /* Let other tt functions see this.
  863.   284       debug(F101,"ttpkt setting ttprty","",ttprty);
  864.   285       s = ttsspd(speed);            /* Check the speed */
  865. ******
  866. File DUB1:[COMMON.C-KERMIT]CKVTIO.C;1
  867.   283       s = ttsspd(speed);            /* Check the speed */
  868. ************
  869.  
  870. Number of difference sections found: 3
  871. Number of difference records found: 4
  872.  
  873. DIFFERENCES /IGNORE=()/MERGED=1/OUTPUT=DUB1:[COMMON.C-KERMIT]DIFF.LIS;1-
  874.     DUB1:[COMMON.C-KERMIT]CKVTIO.C;2-
  875.     DUB1:[COMMON.C-KERMIT]CKVTIO.C;1
  876.  
  877.  
  878. This doesn't fix things completely since the call to SYS$QIOW in ttinl()
  879. waiting for an end-of-line character waits for an end-of-line character
  880. with high bit 0, but if (say) end-of-line is 13 and parity is even it
  881. should really be waiting for a character with high bit set (X'8D').
  882. However you can work around this by choosing the end-of-line character
  883. so that it is sent with high bit reset (e.g., eol=15 for even parity).
  884.  
  885. Another problem is that data overrun errors occur periodically during
  886. file transfer and (at times) during terminal emulation.  Kermit
  887. will also sometimes lock up completely during terminal emulation.
  888. I do not know what is causing this.  We are running on a MicroVax II
  889. with BYTLM=20480.
  890.  
  891. David Moews                 PIQUE@UCONNVM.BITNET
  892.  
  893. ------------------------------
  894.  
  895. Date: Tue, 19 Jul 88 13:54 CDT
  896. From: <ARCHERB%UMKCVAX1.BITNET@CUVMB.CC.COLUMBIA.EDU> (BARRY ARCHER)
  897. Subject: Changes for VMS C-Kermit
  898.  
  899.         In working with the VMS version of C-Kermit, I became frustrated with
  900. the problems with hanging subprocesses after exiting the image, as well as the
  901. problems I was having running C-Kermit while connected to a DECserver ( LAT
  902. protocol ).  I finally figured out how to fix those problems and installed the
  903. new version.
  904.  
  905.         After a few weeks a user complained that they were unable to
  906. transfer a file, change directories and then transfer another file - this
  907. was with the VAX in server mode.  I found this was due to the use of a
  908. subprocess for some commands and the parent process for others, including
  909. the file transfers.  The environments were not staying consistant,
  910. particularily if one tried REMOTE HOST SET DEF as well as REMOTE CWD, since
  911. they each modified different process enviroments.
  912.  
  913.         I had already discovered that REMOTE HOST HELP caused the VAX
  914. processes to hang ( the VMS mailboxes just can't handle it ), so I had been
  915. parsing all remote host commands to trap any VMS help commands.  First I got
  916. the zchdir() function working properly & had it tell the subprocess to
  917. change to the same directory, thereby keeping them in synch.  Then I trapped
  918. REMOTE HOST SET DEFAULT and re-routed it to zchdir().
  919.  
  920.         The changes I've made are:
  921.  
  922.         1. CKUUSR.C - changed the [local] DIR command to execute as if it were
  923. a shell command, i.e.
  924.  
  925.     C-Kermit> dir == C-Kermit> ! dir
  926.  
  927. This helps take care of a buffering problem over LAT virtual terminal ports.
  928. The change is within a vax11c define.
  929.  
  930.         2. CKUCMD.C - added a vax11c define in the parser.  getchar() can
  931. return an XON or XOFF when using a LAT, so I added a check for that, and if
  932. found, another call to getchar() is made.  This helps a lot.  Until I found
  933. this, I coudn't figure out why I kept getting invalid command errors when it
  934. looked fine to me!
  935.  
  936.         3. CKVFIO.C - I tried to keep all major changes to the system dependant
  937. module.
  938.  
  939.           a) zkself() - I found I didn't need anything longer than just a
  940. call to SYS$DELPRC(0L,0L).  I saw an earlier diff file with a more
  941. complicated search and destroy check of subprocesses, but I found this was
  942. all I needed.  ( I do have some changes that allow only one subprocess to
  943. exist at a time. )  Also, the variables for child_pid and mailboxes are made
  944. visible to the whole module.
  945.  
  946.           b) zclose() - this is where subprocesses weren't getting closed,
  947. so I added a check, which if true triggers a call to zclosf() to kill the
  948. subprocess.
  949.  
  950.           c) zdelet() - now returns the result of the delete command.
  951.  
  952.           d) zchdir() - Defaults to current dir.  If there is a subprocess
  953. and the directory was successfully changed, the subprocess is forced to
  954. change to the same directory.  This keeps the two in environmental synch.
  955.  
  956.           e) zgtdir() - returns getcwd().  Made the buffer static, so we're
  957. not returning a pointer to garbage.
  958.  
  959.           f) zxcmd() - Now refuses to do HELP or EDIT, since these hang
  960. everything.  Check for SET DEFAULT - no point in changing it in the
  961. subprocess but not the parent.  So I simply call zchdir(), which
  962. functionally is the same & now changes both environments.  I also check for
  963. DELETE, since if the user has DELETE redefined as DELETE/CONFIRM in VMS we
  964. also hang.  Decided the simplest thing was to call delet() rather than
  965. construct a string and pass that on to the subprocess ( this has one
  966. possible bad effect - a version number is no longer required, defaulting to
  967. the most recent version.  Some VMS users may not like that ).
  968.  
  969.           g) zkillf() - small change to make it work properly.
  970.  
  971.           h) system() - no need for it since VAX C 2.3 has a system() function.
  972.  
  973.         I am going to try to mail the changed modules to you, as well as to
  974. info-kermit.  There should be the three: CKUUSR.C, CKUCMD.C and CKVFIO.C
  975.  
  976. I forgot I made one slight change to CKCFNS.C to make a cleaner tlog:
  977. ************
  978. File SYS_DISK:[ARCHERB.KERMIT.CKERM]CKCFNS.C;10
  979.  1141    /* do tlog AFTER ending vdir with a null */
  980.  1142    tlog(F110,"Directory requested: ",(vdir+1),0l);
  981.  1143    if (zchdir(vdir+1)) {
  982.  1144    cdd = zgtdir(); /* Get new working directory. */
  983.  1145    tlog(F110,"Changed directory to",cdd,0l);
  984.  1146    encstr(cdd);
  985.  1147    ack1(data);
  986.  1148    return(1);
  987. ******
  988. File SYS_DISK:[ARCHERB.KERMIT.CKERM.OLDC]CKCFNS.C;1
  989.  1142    if (zchdir(vdir+1)) {
  990.  1143    cdd = zgtdir(); /* Get new working directory. */
  991.  1144    encstr(cdd);
  992.  1145    ack1(data);
  993.  1146    tlog(F110,"Changed directory to",cdd,0l);
  994.  1147    return(1);
  995. ************
  996.  
  997.         We just set up a version of C-Kermit to use a LAT virtual port to
  998. connect to a modem on a DECserver, so I am starting to look at the CKVTIO.C
  999. and CKVCON.C modules.  The only thing serious I've found so far is that the
  1000. DIAL command doesn't work ( and might not be able to over the LAT ).
  1001.  
  1002.         Let me know if there is anything else you might want me to work on.
  1003.  
  1004.  
  1005.                         Barry Archer
  1006.                         archerb@umkcvax1.bitnet
  1007.  
  1008. ------------------------------
  1009.  
  1010. Date:     Tue, 19 Jul 88 14:11 CDT
  1011. From:     <ARCHERB%UMKCVAX1.BITNET@CUVMB.CC.COLUMBIA.EDU> (BARRY ARCHER)
  1012. Subject:  CKVFIO.C with changes
  1013.  
  1014. char *ckzv = "VMS file support, 1.0(010), 24 Jan 88";
  1015. char *ckzsys = " Vax/VMS";
  1016.  
  1017. /* C K V F I O  --  Kermit file system support for VAX/VMS */
  1018.  
  1019. /* Stew Rubenstein, Harvard University Chemical Labs */
  1020. /*  (c) 1985 President and Fellows of Harvard College  */
  1021. /*  Based on CKZUNX.C, 4.1(015) 28 Feb 85 */
  1022. /* Also, Martin Minow (MM), Digital Equipment Corporation, Maynard MA */
  1023. /* Also, Dan Schullman (DS), Digital Equipment Corporation, Maynard MA */
  1024. /* Adapted from ckufio.c, by... */
  1025. /* F. da Cruz (FdC), Columbia University Center for Computing Activities */
  1026.  
  1027. /* Edit history
  1028.  * 003 20-Mar-85 MM  fixed fprintf bug in zsout.c
  1029.  * 004 21-Mar-84 MM  create text files in variable-stream.
  1030.  * 005  8-May-85 MM  filled in zkself (not tested), fixed other minor bugs
  1031.  * 006  5-Jul-85 DS  handle version number in zltor, zrtol
  1032.  * 007 11-Jul-85 FdC fix zclose() to give return codes
  1033.  * 008 19-Mar-86 FdC Fix system() for "!", zopeni() for REMOTE commands.
  1034.  * 008 17-Sep-87 FdC Define PWDCMD.
  1035.  * 090 (???)
  1036.  * 010 24-Jan-88 FdC Add zgtdir() function, even tho it doesn't work...
  1037.  */
  1038.  
  1039. /* Definitions of some VMS system commands */
  1040.  
  1041. char *DIRCMD = "DIRECTORY ";            /* For directory listing */
  1042. char *DELCMD = "DELETE ";               /* For file deletion */
  1043. char *TYPCMD = "TYPE ";                 /* For typing a file */
  1044. char *SPACMD = "DIRECTORY/TOTAL";       /* Space/quota of current directory */
  1045. char *SPACM2 = "DIRECTORY/TOTAL ";      /* Space/quota of current directory */
  1046. char *WHOCMD = "SHOW USERS";            /* For seeing who's logged in */
  1047. char *PWDCMD = "SHOW DEFAULT";          /* For seeing current directory */
  1048.  
  1049. /*
  1050.   Functions (n is one of the predefined file numbers from ckermi.h):
  1051.  
  1052.    zopeni(n,name)   -- Opens an existing file for input.
  1053.    zopeno(n,name)   -- Opens a new file for output.
  1054.    zclose(n)        -- Closes a file.
  1055.    zchin(n)         -- Gets the next character from an input file.
  1056.    zsout(n,s)       -- Write a null-terminated string to output file, buffered.
  1057.    zsoutl(n,s)      -- Like zsout, but appends a line terminator.
  1058.    zsoutx(n,s,x)    -- Write x characters to output file, unbuffered.
  1059.    zchout(n,c)      -- Add a character to an output file, unbuffered.
  1060.    zchki(name)      -- Check if named file exists and is readable, return size.
  1061.    zchko(name)      -- Check if named file can be created.
  1062.    znewn(name,s)    -- Make a new unique file name based on the given name.
  1063.    zdelet(name)     -- Delete the named file.
  1064.    zxpand(string)   -- Expands the given wildcard string into a list of files.
  1065.    znext(string)    -- Returns the next file from the list in "string".
  1066.    zxcmd(cmd)       -- Execute the command in a lower fork.
  1067.    zclosf()         -- Close input file associated with zxcmd()'s lower fork.
  1068.    zrtol(n1,n2)     -- Convert remote filename into local form.
  1069.    zltor(n1,n2)     -- Convert local filename into remote form.
  1070.    zchdir(dirnam)   -- Change working directory.
  1071.    zhome()          -- Return pointer to home directory name string.
  1072.    zkself()         -- Log self out
  1073.  */
  1074.  
  1075. /* Includes */
  1076.  
  1077. #include "ckcker.h"
  1078. #include "ckcdeb.h"
  1079. #include <stdio.h>
  1080. #include <ctype.h>
  1081. #include <rms.h>
  1082. #include <descrip.h>
  1083. #include <dvidef.h>
  1084. #include <iodef.h>
  1085. #include <errno.h>
  1086. #include <signal.h>
  1087. #include stdlib
  1088.  
  1089. #define MAXWLD 500                      /* Maximum wildcard filenames */
  1090.  
  1091.  
  1092. /* Declarations */
  1093.  
  1094. FILE *fp[ZNFILS] = {                    /* File pointers */
  1095.     NULL, NULL, NULL, NULL, NULL, NULL, NULL };
  1096.  
  1097. static int fcount;                      /* Number of files in wild group */
  1098. char *getenv(), *strcpy();              /* For finding home directory */
  1099.  
  1100. static char *mtchs[MAXWLD],             /* Matches found for filename */
  1101.      **mtchptr;                         /* Pointer to current match */
  1102.  
  1103. static int input_mbxchn, output_mbxchn, child_pid = 0;
  1104.  
  1105. /***  Z K S E L F --  Log self out  ***/
  1106.  
  1107. /*** this works in VMS) ***/
  1108.  
  1109. zkself() {
  1110.     return (SYS$DELPRC(0L,0L));         /* delete self */
  1111. }
  1112.  
  1113. /*  Z O P E N I  --  Open an existing file for input. */
  1114.  
  1115. zopeni(n,name) int n; char *name; {
  1116.     debug(F111," zopeni",name,n);
  1117.     debug(F101,"  fp","",(int) fp[n]);
  1118.     if (n == ZSYSFN) {                  /* Input from a system function? */
  1119.         return(zxcmd(name));            /* Try to fork the command */
  1120.     }
  1121.     if (n == ZSTDIO) {                  /* Standard input? */
  1122.         if (isatty(0)) {
  1123.             fprintf(stderr,"?Terminal input not allowed\n");
  1124.             debug(F110,"zopeni: attempts input from unredirected stdin","",0);
  1125.             return(0);
  1126.         }
  1127.         fp[ZIFILE] = stdin;
  1128.         return(1);
  1129.     }
  1130.     if (chkfn(n) != 0) return(0);
  1131.     fp[n] = fopen(name,"r");            /* Real file. */
  1132.     debug(F111," zopeni", name, (int) fp[n]);
  1133.     if (fp[n] == NULL) perror(name);    /* +1, want a useful message    */
  1134.     return((fp[n] != NULL) ? 1 : 0);
  1135. }
  1136.  
  1137. /*  Z O P E N O  --  Open a new file for output.  */
  1138.  
  1139. zopeno(n,name) int n; char *name; {
  1140.  
  1141.     int fildes;
  1142.     extern int binary;
  1143.  
  1144.     debug(F111," zopeno",name,n);
  1145.     if (chkfn(n) != 0) return(0);
  1146.     if ((n == ZCTERM) || (n == ZSTDIO)) {   /* Terminal or standard output */
  1147.         fp[ZOFILE] = stdout;
  1148.         debug(F101," fp[]=stdout", "", (int) fp[n]);
  1149.         return(1);
  1150.     }
  1151.     /*
  1152.      * Create "binary" output files as fixed-block 512 byte records.
  1153.      * This should permit copying task images.  It is rumored that
  1154.      * Vax C will null-fill an incomplete final block.
  1155.      *
  1156.      * Create all debugging files (and normal output files) in
  1157.      * "vanilla" RMS -- variable length, implicit carriage control.
  1158.      * This way, old brain-damaged programs aren't suprised by
  1159.      * bizarre Unix-styled files.
  1160.      */
  1161.     if (n == ZOFILE && binary != 0)
  1162.         fildes = creat(name, 0, "mrs=512", "rfm=fix");
  1163.     else
  1164.         fildes = creat(name, 0, "rat=cr", "rfm=var");
  1165.     fp[n] = (fildes == -1) ? NULL : fdopen(fildes, "w");
  1166.     if (fp[n] == NULL) perror(name);            /* +1, print useful msg */
  1167. /*    if (n == ZDFILE && isatty(fileno(fp[n])))
  1168.         setbuf(fp[n],NULL);  */
  1169. /* Make debugging file unbuffered */
  1170.     debug(F101, " fp[n]", "", (int) fp[n]);
  1171.     return((fp[n] != NULL) ? 1 : 0);
  1172. }
  1173.  
  1174. /*  Z C L O S E  --  Close the given file.  */
  1175.  
  1176. /*  Returns 0 if arg out of range, 1 if successful, -1 if close failed.  */
  1177.  
  1178. zclose(n) int n; {
  1179.     int x;
  1180.     if (chkfn(n) < 1) return(0);
  1181.     if ((child_pid != 0) && ((fp[n] == 0) || (n == ZSYSFN))) {
  1182.         x = zclosf();
  1183.     } else {
  1184.         if ((fp[n] != stdout) && (fp[n] != stdin)) x = fclose(fp[n]);
  1185.         fp[n] = NULL;
  1186.     }
  1187.     return((x == EOF) ? -1 : 1);
  1188. }
  1189.  
  1190. /*  Z C H I N  --  Get a character from the input file.  */
  1191.  
  1192. static int subprocess_input = 0, sub_count;
  1193. static char *sub_ptr, sub_buf[100];
  1194.  
  1195. get_subprc_line() {
  1196.     struct { short status, size, trm, trmsize; } subiosb;
  1197.     if ((SYS$QIOW(0, output_mbxchn, IO$_READVBLK, &subiosb, 0, 0,
  1198.                 sub_buf, sizeof(sub_buf), 0, 0, 0, 0) & 7) != 1
  1199.         || (subiosb.status & 7) != 1) return(-1);
  1200.     if (subiosb.size == 29
  1201.      && strncmp(sub_buf, ">>> END OF KERMIT COMMAND <<<",
  1202.                 subiosb.size) == 0) {
  1203.         subprocess_input = 0;
  1204.         return(-1);
  1205.     }
  1206.     sub_buf[subiosb.size] = '\n';
  1207.     sub_buf[subiosb.size + 1] = '\0';
  1208.     sub_count = subiosb.size;
  1209.     sub_ptr = sub_buf;
  1210.     return(0);
  1211. }
  1212.  
  1213. zchin(n,c) int n; char *c; {
  1214.     int a;
  1215.     if (n == ZIFILE && subprocess_input) {
  1216.         if (--sub_count < 0)
  1217.             if (get_subprc_line()) return(-1);
  1218.         a = *sub_ptr++;
  1219.     } else {
  1220.         if (chkfn(n) < 1) return(-1);
  1221.         a = getc(fp[n]);
  1222.     }
  1223.     if (a == EOF) return(-1);
  1224.     *c = (a & 0377);
  1225.     return(0);
  1226. }
  1227.  
  1228. /*  Z S O U T  --  Write a string to the given file, buffered.  */
  1229.  
  1230. zsout(n,s) int n; char *s; {
  1231.     if (chkfn(n) < 1) return(-1);
  1232.     fputs(s, fp[n]);                    /* Don't use fprintf here MM */
  1233.     return(0);
  1234. }
  1235.  
  1236. /*  Z S O U T L  --  Write string to file, with line terminator, buffered  */
  1237.  
  1238. zsoutl(n,s) int n; char *s; {
  1239.     if (chkfn(n) < 1) return(-1);
  1240.     fputs(s, fp[n]);                    /* Don't use fprintf MM */
  1241.     putc('\n', fp[n]);
  1242.     return(0);
  1243. }
  1244.  
  1245. /*  Z S O U T X  --  Write x characters to file, unbuffered.  */
  1246.  
  1247. zsoutx(n,s,x) int n, x; char *s; {
  1248.     if (chkfn(n) < 1) return(-1);
  1249.     return(write(fileno(fp[n]),s,x));
  1250. }
  1251.  
  1252.  
  1253. /*  Z C H O U T  --  Add a character to the given file.  */
  1254.  
  1255. zchout(n,c) int n; char c; {
  1256.     if (chkfn(n) < 1) return(-1);
  1257.     if (n == ZSFILE)
  1258.         return(write(fileno(fp[n]),&c,1)); /* Use unbuffered for session log */
  1259.     else {
  1260.         if (putc(c,fp[n]) == EOF)       /* If true, maybe there was an error */
  1261.             return(ferror(fp[n]));      /* Check to make sure */
  1262.         else                            /* Otherwise... */
  1263.             return(0);                  /* There was no error. */
  1264.     }
  1265. }
  1266.  
  1267. /*  C H K F N  --  Internal function to verify file number is ok  */
  1268.  
  1269. /*
  1270.  Returns:
  1271.   -1: File number n is out of range
  1272.    0: n is in range, but file is not open
  1273.    1: n in range and file is open
  1274. */
  1275. chkfn(n) int n; {
  1276.     switch (n) {
  1277.         case ZCTERM:
  1278.         case ZSTDIO:
  1279.         case ZIFILE:
  1280.         case ZOFILE:
  1281.         case ZDFILE:
  1282.         case ZTFILE:
  1283.         case ZPFILE:
  1284.         case ZSFILE: break;
  1285.         default:
  1286.             debug(F101,"chkfn: file number out of range","",n);
  1287.             fprintf(stderr,"?File number out of range - %d\n",n);
  1288.             return(-1);
  1289.     }
  1290.     return( (fp[n] == NULL) ? 0 : 1 );
  1291. }
  1292.  
  1293. /*  Z C H K I  --  Check if input file exists and is readable  */
  1294.  
  1295. /*
  1296.   Returns:
  1297.    >= 0 if the file can be read (returns the size).
  1298.      -1 if file doesn't exist or can't be accessed,
  1299.      -2 if file exists but is not readable (e.g. a directory file).
  1300.      -3 if file exists but protected against read access.
  1301. */
  1302. /*
  1303.  For Berkeley Unix, a file must be of type "regular" to be readable.
  1304.  Directory files, special files, and symbolic links are not readable.
  1305. */
  1306. long
  1307. zchki(name) char *name; {
  1308.     int x; long pos;
  1309.  
  1310.     x = open(name, 0);
  1311.     if (x < 0) {
  1312.         debug(F111,"zchki stat fails",name,errno);
  1313.         return(-1);
  1314.     }
  1315.     pos = lseek(x, 0, 2);
  1316.     close(x);
  1317.     return(pos);
  1318. }
  1319.  
  1320. /*  Z C H K O  --  Check if output file can be created  */
  1321.  
  1322. /*
  1323.  Returns -1 if write permission for the file would be denied, 0 otherwise.
  1324. */
  1325. zchko(name) char *name; {
  1326.     return(0);                          /* Always creates new version */
  1327. }
  1328.  
  1329. /*  Z D E L E T  --  Delete the named file.  */
  1330.  
  1331. zdelet(name) char *name; {
  1332.     return(delete(name) == 0);
  1333. }
  1334.  
  1335.  
  1336. /*  Z R T O L  --  Convert remote filename into local form  */
  1337.  
  1338. /*  For VMS, we eliminate all special characters and truncate.  */
  1339. /*  Doesn't allow the longer filespecs that VMS V4 supports.    */
  1340. /*  Assumes version number delimited by semicolon, not period.  */
  1341. /*  Should really use RMS to parse filespec components.  -- DS  */
  1342.  
  1343. zrtol(name,name2) char *name, *name2; {
  1344.     int count;
  1345.     char *cp;
  1346.  
  1347.     count = 9;
  1348.     for ( cp = name2; *name != '\0'; name++ ) {
  1349.         switch (*name) {
  1350.             case '.':                   /* File type */
  1351.                 count = 3;              /* Max length for this field */
  1352.                 *cp++ = '.';
  1353.                 break;
  1354.             case ';':                   /* Version */
  1355.                 count = 5;
  1356.                 *cp++ = ';';
  1357.                 break;
  1358.             default:
  1359.                 if (count > 0 && isalnum(*name)) {
  1360.                     --count;
  1361.                     *cp++ = islower(*name) ? toupper(*name) : *name;
  1362.                 }
  1363.                 break;
  1364.         }
  1365.     }
  1366.     *cp = '\0';                         /* End of name */
  1367.     debug(F110,"zrtol: ",name2,0);
  1368. }
  1369.  
  1370. /*  Z L T O R  --  Convert filename from local format to common form.   */
  1371.  
  1372. zltor(name,name2) char *name, *name2; {
  1373.     char *cp, *pp;
  1374.  
  1375.     for (cp = pp = name; *cp != '\0'; cp++) {   /* strip path name */
  1376.         if (*cp == ']' || *cp == ':') {
  1377.             pp = cp;
  1378.             pp++;
  1379.         }
  1380.     }
  1381.     for ( ; --cp >= pp; ) {             /* From end to beginning */
  1382.         if (!isdigit(*cp)) {            /* if not numeric, then */
  1383.             if (*cp == '-') --cp;       /* if minus sign, skip over, or */
  1384.             if (*cp == ';') *cp = '\0'; /* if version delim, make end */
  1385.             break;
  1386.         }
  1387.     }
  1388.     cp = name2;                         /* If nothing before dot, */
  1389.     if (*pp == '.') *cp++ = 'X';        /* insert 'X' */
  1390.     strcpy(cp,pp);
  1391.  
  1392.     debug(F110,"zltor: ",name2,0);
  1393. }
  1394.  
  1395. /*  Z C H D I R  --  Change directory  */
  1396.  
  1397. zchdir(dirnam) char dirnam[]; {
  1398.  
  1399.     char   *zgtdir();
  1400.     char   dir_buff[200];
  1401.     int    status;
  1402.  
  1403.     if (dirnam[0] == '\0')
  1404.         strcpy(dirnam,"[]");            /* default to current dir */
  1405.     else
  1406.      {
  1407.         status = chdir(dirnam);         /* change first in parent proc */
  1408.         /* then change it in the child process -> keep in synch! */
  1409.         if ((child_pid != 0) && (status == 0))
  1410.            {    /* construct command for child proc */
  1411.                 strcpy(dir_buff,"$ set def ");
  1412.                 strcat(dir_buff,zgtdir());
  1413.                 SYS$QIOW(0, input_mbxchn, IO$_WRITEVBLK | IO$M_NOW, 0, 0, 0,
  1414.                         dir_buff, strlen(dir_buff), 0, 0, 0, 0);
  1415.            }
  1416.         return(status == 0);
  1417.      }
  1418. }
  1419.  
  1420. /*  Z H O M E  --  Return pointer to user's home directory  */
  1421.  
  1422. char *
  1423. zhome() {
  1424.     return(getenv("HOME"));
  1425. }
  1426.  
  1427. static char cwdbuf[100];  /* lets make this static, eh */
  1428.  
  1429. /*  Z G T D I R  --  Return pointer to user's current directory  */
  1430.  
  1431. char *
  1432. zgtdir() {
  1433.  
  1434. return(getcwd(cwdbuf,100));     /* now we just return curr dir specs */
  1435.  
  1436. }
  1437.  
  1438. /*  Z X C M D -- Run a system command so its output can be read like a file */
  1439.  
  1440. zxcmd(comand) char *comand; {
  1441.     char input_mbxnam[10], output_mbxnam[10];
  1442.     char cmdbuf[200];
  1443.     char test_str[256];
  1444.     char *sptr;
  1445.     int  i;
  1446.  
  1447.         /* convert to uppercase */
  1448.     for (i=0;i<=strlen(comand);i++)
  1449.         *(comand+i) = toupper(*(comand+i));
  1450.  
  1451. /* VMS HELP hangs the subprocess, so lets avoid it */
  1452.     strcpy(test_str,comand);
  1453.     if (strncmp(test_str,"HELP",4) == NULL)
  1454.         return(-1);                             /* can't do remote host help */
  1455. /* VMS EDT hangs the subprocess, so lets avoid it */
  1456.     strcpy(test_str,comand);
  1457.     if ((strncmp(test_str,"EDIT",4) == NULL) ||
  1458.         (strncmp(test_str,"EDT",3) == NULL))
  1459.            return(-1);                          /* can't do remote host edt */
  1460.  
  1461. /* we will have to do a SET DEFAULT as a CWD or we get confusion between
  1462.         parent and child process as to what directory we're in!
  1463. */
  1464.     strcpy(test_str,comand);
  1465.     debug(F110,"zxcmd: ",test_str,0);
  1466.     if (strncmp(test_str,"SET DEF",7) == NULL)
  1467.        {
  1468.         sptr = &test_str[7];
  1469.         while ((*sptr != ' ') && (*sptr != NULL))
  1470.                 sptr++;     /* find directory spec */
  1471.         if (*sptr++ != NULL)
  1472.            {    /* try to cwd */
  1473.                 debug(F110,"zxcmd: ",sptr,0);
  1474.                 return(zchdir(sptr));
  1475.            }
  1476.        }
  1477. /* Now we have to check for DELETE, since if user has DELETE/CONFIRM set
  1478.  then the child process will hang everything waiting for the confirmation
  1479.  that will never come.  So a little more robust to use delete function via
  1480.  the parent process.
  1481. */
  1482.     if (strncmp(test_str,"DEL",3) == NULL)
  1483.        {        /* this is a delete file command string */
  1484.                 sptr = &test_str[3];
  1485.                 while ((*sptr != ' ') && (*sptr != NULL))
  1486.                         sptr++;     /* find file spec */
  1487.                 if (*sptr++ != NULL)
  1488.                    {    /* try to delete */
  1489.                         debug(F110,"zxcmd (del): ",sptr,0);
  1490.                         return(zdelet(sptr));
  1491.                    }
  1492.         }
  1493.  
  1494. /* otherwise, go ahead with passing command to child to execute */
  1495.  
  1496.     if (child_pid == 0) {
  1497.         struct dsc$descriptor_s inpdsc, outdsc;
  1498.         struct { short buflen, code; char *bufadr; short *retlen; } itmlst[2];
  1499.  
  1500.         SYS$CREMBX(0, &input_mbxchn, 0, 0, 0, 0, 0);
  1501.         itmlst[0].buflen = sizeof input_mbxnam;
  1502.         itmlst[0].code   = DVI$_DEVNAM;
  1503.         itmlst[0].bufadr = input_mbxnam;
  1504.         itmlst[0].retlen = 0;
  1505.         itmlst[1].buflen = 0;
  1506.         itmlst[1].code   = 0;
  1507.         SYS$GETDVI(0, input_mbxchn, 0, itmlst, 0, 0, 0, 0);
  1508.         SYS$WAITFR(0);
  1509.  
  1510.         SYS$CREMBX(0, &output_mbxchn, 0, 0, 0, 0, 0);
  1511.         itmlst[0].buflen = sizeof output_mbxnam;
  1512.         itmlst[0].bufadr = output_mbxnam;
  1513.         SYS$GETDVI(0, output_mbxchn, 0, itmlst, 0, 0, 0, 0);
  1514.         SYS$WAITFR(0);
  1515.  
  1516.         inpdsc.dsc$w_length  = strlen(input_mbxnam);
  1517.         inpdsc.dsc$b_dtype   = DSC$K_DTYPE_T;
  1518.         inpdsc.dsc$b_class   = DSC$K_CLASS_S;
  1519.         inpdsc.dsc$a_pointer = input_mbxnam;
  1520.  
  1521.         outdsc.dsc$w_length  = strlen(output_mbxnam);
  1522.         outdsc.dsc$b_dtype   = DSC$K_DTYPE_T;
  1523.         outdsc.dsc$b_class   = DSC$K_CLASS_S;
  1524.         outdsc.dsc$a_pointer = output_mbxnam;
  1525.  
  1526.         LIB$SPAWN(0, &inpdsc, &outdsc, &1, 0, &child_pid);
  1527.         SYS$QIOW(0, input_mbxchn, IO$_WRITEVBLK | IO$M_NOW, 0, 0, 0,
  1528.             "$ SET NOON", 10, 0, 0, 0, 0);
  1529.  
  1530.     }
  1531.  
  1532.     strcpy(cmdbuf, "$ ");
  1533.     strcat(cmdbuf, comand);
  1534.     SYS$QIOW(0, input_mbxchn, IO$_WRITEVBLK | IO$M_NOW, 0, 0, 0,
  1535.             cmdbuf, strlen(cmdbuf), 0, 0, 0, 0);
  1536.     SYS$QIOW(0, input_mbxchn, IO$_WRITEVBLK | IO$M_NOW, 0, 0, 0,
  1537.             "$ WRITE SYS$OUTPUT \">>> END OF KERMIT COMMAND <<<\"",
  1538.             50, 0, 0, 0, 0);
  1539.     subprocess_input = 1;
  1540.     sub_count = 0;
  1541.     return(1);
  1542. }
  1543.  
  1544. /*  Z C L O S F  - close the suprocess output file.  */
  1545.  
  1546. zclosf() {
  1547.    zkillf();
  1548. }
  1549.  
  1550. /*  Z K I L L F  - kill the subprocess used for host commands  */
  1551. /*  The return value is 1 if the subprocess was killed successfully. */
  1552. /*                      -1 if there was no subprocess to kill, */
  1553. /*                      or error code if can't delete process. */
  1554.  
  1555. zkillf() {
  1556.     int sys_stat;
  1557.  
  1558.     if (child_pid == 0)
  1559.         return(-1);
  1560.  
  1561. /*      must use SYS$DELPRC() since we used SYS$CREPRC() to create subproc
  1562. */
  1563.     if ((sys_stat = SYS$DELPRC(&child_pid,0L)) == SS$_NORMAL)
  1564.         child_pid = 0;
  1565.     return(sys_stat);
  1566.  
  1567. }
  1568.  
  1569. /*  Z X P A N D  --  Expand a wildcard string into an array of strings  */
  1570. /*
  1571.   Returns the number of files that match fn1, with data structures set up
  1572.   so that first file (if any) will be returned by the next znext() call.
  1573. */
  1574. zxpand(fn) char *fn; {
  1575.     fcount = fgen(fn,mtchs,MAXWLD);     /* Look up the file. */
  1576.     if (fcount > 0) {
  1577.         mtchptr = mtchs;                /* Save pointer for next. */
  1578.     }
  1579.     debug(F111,"zxpand",mtchs[0],fcount);
  1580.     return(fcount);
  1581. }
  1582.  
  1583.  
  1584. /*  Z N E X T  --  Get name of next file from list created by zxpand(). */
  1585. /*
  1586.  Returns >0 if there's another file, with its name copied into the arg string,
  1587.  or 0 if no more files in list.
  1588. */
  1589. znext(fn) char *fn; {
  1590.     if (fcount-- > 0) strcpy(fn,*mtchptr++);
  1591.     else *fn = '\0';
  1592.     debug(F111,"znext",fn,fcount+1);
  1593.     return(fcount+1);
  1594. }
  1595.  
  1596.  
  1597. /*  Z N E W N  --  Make a new name for the given file  */
  1598.  
  1599. znewn(fn,s) char *fn, **s; {
  1600.     static char buf[100];
  1601.     char *bp, *xp;
  1602.     int len = 0, n = 0, d = 0, t;
  1603.  
  1604.     strcpy(buf, fn);                    /* Version numbers are handled by OS */
  1605.     *s = buf;
  1606. }
  1607.  
  1608. /*  Wildcard expansion for VMS is easy;  we just use a run-time library call.
  1609. */
  1610. fgen(pat,resarry,len)
  1611. char *pat,*resarry[];
  1612. int len;
  1613. {
  1614.     struct dsc$descriptor_s file_spec, result, deflt;
  1615.     long context;
  1616.     int count, slen, status, plen;
  1617.     char *pp, *rp, result_string[256], *strchr();
  1618.  
  1619.     file_spec.dsc$w_length  = strlen(pat);
  1620.     file_spec.dsc$b_dtype   = DSC$K_DTYPE_T;
  1621.     file_spec.dsc$b_class   = DSC$K_CLASS_S;
  1622.     file_spec.dsc$a_pointer = pat;
  1623.  
  1624.     result.dsc$w_length  = sizeof result_string;
  1625.     result.dsc$b_dtype   = DSC$K_DTYPE_T;
  1626.     result.dsc$b_class   = DSC$K_CLASS_S;
  1627.     result.dsc$a_pointer = result_string;
  1628.  
  1629.     deflt.dsc$w_length  = 3;
  1630.     deflt.dsc$b_dtype   = DSC$K_DTYPE_T;
  1631.     deflt.dsc$b_class   = DSC$K_CLASS_S;
  1632.     deflt.dsc$a_pointer = "*.*";
  1633.  
  1634.     count = 0;
  1635.     context = 0;
  1636.     pp = strchr(pat, ']');
  1637.     if (pp == 0) pp = strchr(pat, ':');
  1638.     if (pp == 0) plen = 0;
  1639.     else plen = pp - pat + 1;
  1640.     while (count < len
  1641.            && (status = LIB$FIND_FILE(&file_spec, &result, &context, &deflt))
  1642.                 == RMS$_NORMAL) {
  1643.         rp = strchr(result_string, ']') + 1;
  1644.         slen = strchr(rp, ' ') - rp;
  1645.         resarry[count] = malloc(slen + plen + 1);
  1646.         if (plen != 0)
  1647.             strncpy(resarry[count], pat, plen);
  1648.         strncpy(resarry[count] + plen, rp, slen);
  1649.         resarry[count][slen + plen] = '\0';
  1650.         ++count;
  1651.     }
  1652. #ifdef DVI$_ALT_HOST_TYPE
  1653.     lib$find_file_end(&context);        /* Only on V4 and later */
  1654. #endif
  1655.     if (status == RMS$_FNF) return(0);
  1656.     if (status == RMS$_NMF) return(count);
  1657.     return(-1);
  1658. }
  1659.  
  1660. /*      don't need this under VAX/VMS C v2.3    */
  1661. /*
  1662. system(s)  char *s;  {
  1663.     struct dsc$descriptor_s cmd;
  1664.  
  1665.     if ( *s ) {
  1666.         zxcmd(s);
  1667.         while (!get_subprc_line())
  1668.             fputs(sub_buf, stdout);
  1669.         putchar('\n');
  1670.     } else {
  1671.         LIB$SPAWN();
  1672.     }
  1673. }
  1674. */
  1675.  
  1676. ------------------------------
  1677.  
  1678. Date: Tue, 19 Jul 88 14:07 CDT
  1679. From: <ARCHERB%UMKCVAX1.BITNET@CUVMB.CC.COLUMBIA.EDU> (BARRY ARCHER)
  1680. Subject: Changes to ckuusr.c
  1681. Keywords:
  1682.  
  1683.         This is the change that makes DIR work with LAT connections ( and also
  1684. automatically defaults to current dir...
  1685.  
  1686. case XXDIR:                             /* directory */
  1687. #ifdef vax11c
  1688.     if ((x = cmtxt("Directory/file specification","",&s)) < 0) return(x);
  1689.     /* now do this the same as a shell command - helps with LAT  */
  1690.     conres();           /* make console normal */
  1691.     lp = line;
  1692.     sprintf(lp,"%s %s",DIRCMD,s);
  1693.     debug(F110,"Directory string: ", line, 0);
  1694.     system(line);
  1695.     concb(escape);
  1696.     return(0);
  1697. #else
  1698. #ifdef AMIGA
  1699.     if ((x = cmtxt("Directory/file specification","",&s)) < 0) return(x);
  1700. #else
  1701. #ifdef datageneral
  1702.     if ((x = cmtxt("Directory/file specification","+",&s)) < 0) return(x);
  1703. #else
  1704.     if ((x = cmtxt("Directory/file specification",".",&s)) < 0) return(x);
  1705. #endif
  1706. #endif
  1707.     lp = line;
  1708.     sprintf(lp,"%s %s",DIRCMD,s);
  1709.     system(line);
  1710.     return(0);
  1711. #endif
  1712.  
  1713.                                         BarryA
  1714.  
  1715. ------------------------------
  1716.  
  1717. Date: Tue, 19 Jul 88 14:09 CDT
  1718. From: <ARCHERB%UMKCVAX1.BITNET@CUVMB.CC.COLUMBIA.EDU> (BARRY ARCHER)
  1719. Subject: Changes to ckucmd.c
  1720. Keywords:
  1721.  
  1722. The change is to gtword(), throw away any spurious XONs or XOFFs.  This is
  1723. also for smooth LAT use...
  1724.  
  1725. gtword() {
  1726.  
  1727.     int c;                              /* Current char */
  1728.     static int inword = 0;              /* Flag for start of word found */
  1729.     int quote = 0;                      /* Flag for quote character */
  1730.     int echof = 0;                      /* Flag for whether to echo */
  1731.     int ignore = 0;
  1732.  
  1733. #ifdef datageneral
  1734.     extern int termtype;                /* DG terminal type flag */
  1735.     extern int con_reads_mt;            /* Console read asynch is active */
  1736.     if (con_reads_mt) connoi_mt();      /* Task would interfere w/cons read */
  1737. #endif
  1738.  
  1739.     pp = np;                            /* Start of current field */
  1740.     debug(F101,"gtword: cmdbuf","",(int) cmdbuf);
  1741.     debug(F101," bp","",(int) bp);
  1742.     debug(F101," pp","",(int) pp);
  1743.     debug(F110," cmdbuf",cmdbuf,0);
  1744.  
  1745.     while (bp < cmdbuf+CMDBL) {         /* Loop */
  1746.  
  1747.         ignore = echof = 0;             /* Flag for whether to echo */
  1748.  
  1749.         if ((c = *bp) == NUL) {         /* Get next character */
  1750.             if (dpx) echof = 1;         /* from reparse buffer */
  1751. #ifdef datageneral
  1752.             {
  1753.                char ch;
  1754.                c = dgncinb(0,&ch,1);    /* -1 is EOF, -2 TO,
  1755.                                          * -c is AOS/VS error */
  1756.                if (c == -2) {           /* timeout was enabled? */
  1757.                     resto(channel(0));  /* reset timeouts */
  1758.                     c = dgncinb(0,&ch,1); /* retry this now! */
  1759.                }
  1760.                if (c < 0) return(-4);    /* EOF or some error */
  1761.                else c = (int) ch & 0177; /* Get char without parity */
  1762.                echof = 1;
  1763.             }
  1764. #else
  1765.             c = getchar();              /* or from tty. */
  1766. #ifdef vax11c
  1767.                 /* necessary for LAT terminals, avoid spurious XON,XOFF */
  1768.             while ((c == 17) || (c == 19))
  1769.                 c = getchar();
  1770. #endif
  1771.             if (c == EOF) {
  1772. /***            perror("ckucmd getchar");  (just return silently) ***/
  1773.                 return(-4);
  1774.             }
  1775. #endif
  1776.         } else ignore = 1;
  1777.  
  1778.         if (quote == 0) {
  1779.  
  1780.             if (!ignore && (c == '\\')) { /* Quote character */
  1781.                quote = 1;
  1782.                continue;
  1783.             }
  1784.             if (c == FF) {              /* Formfeed. */
  1785.                 c = NL;                 /* Replace with newline */
  1786. #ifdef apollo
  1787.                 putchar(FF);
  1788. #else
  1789. #ifdef AMIGA
  1790.                 putchar(FF);
  1791. #else
  1792. #ifdef datageneral
  1793.                 putchar(FF);
  1794. #else
  1795.                 system("clear");        /* and clear the screen. */
  1796. #endif
  1797. #endif
  1798. #endif
  1799.             }
  1800.  
  1801.             if (c == HT) c = SP;        /* Substitute space for tab. */
  1802.  
  1803. /* cont'd... */
  1804.  
  1805.                         BarryA
  1806.  
  1807. ------------------------------
  1808.  
  1809. Date: Fri, 12 Aug 88 07:44 EST
  1810. From: "CHEMB::SKITA"@a.chem.upenn.edu
  1811. Subject: CKERMIT
  1812.  
  1813. The following is a report of a severe bug observed in version C-Kermit, 4E(070)
  1814. 29 Jan 88, Vax/VMS. 
  1815.  
  1816. Kermit-C has been compiled and linked on a  VAX 8200 (VMS 4.7). A note
  1817. concerning the compilation and linking: My current C Run Time Library is
  1818. VAXCRTL.OLB (V2 lib). However, if I link (as does ckvker.com) with this library
  1819. and use the /DEFINE=("DEBUG","TLOG") qualifier during compilation, Kermit-C
  1820. crashes during the my test while attempting to write to debug.log. If I compile
  1821. without the /DEFINE qualifier, and link with VAXCRTL.OLB, Kermit executes
  1822. without crashing, however (of course) a debug.log file is not written. I have
  1823. not investigated the "crash", however I have a "access violation" in module
  1824. CKUUS3; I will give you a detailed report at a later time.  For the purposes
  1825. of my test I did not compile with the /DEFINE qualifier.
  1826.  
  1827. For the purposes of this test, the HOST and REMOTE machines are the same, as is
  1828. the version of Kermit. Kermit is set-up as follows: 
  1829.  
  1830. C-Kermit, 4E(070) 29 Jan 88, Vax/VMS, 
  1831. Communications Parameters:
  1832.  
  1833. Line: ker$term, speed: 1200, mode:local, modem-dialer: direct 
  1834. Bits: 8, parity:none, duplex: full, flow: xon/xoff, handshake: none
  1835.  
  1836. Terminal emulation: 7 bits
  1837.  
  1838. Protocol Parameters:   Send    Receive
  1839.  Timeout:               10        7                    
  1840.  Padding:                0        0
  1841.  Block Check:      1
  1842.  Pad Character:          0        0
  1843.  Delay:            5
  1844.  Packet Start:           1        1
  1845.  Max Retries:     10
  1846.  Packet End:            13       13
  1847.  Packet Length:         90       90
  1848.  Length Limit:        2048     1024
  1849.  
  1850. File parameters:
  1851. File Names: converted        File Type:    text    Packet Log:       packet.log
  1852. File Warning: off            Session Log: session.log
  1853. File Display: on                                       
  1854.  
  1855. File Byte Size: 8, Incomplete File Disposition: discard, Init file: kermit.ini
  1856.  
  1857. I am attempting to send the following three lines of ASCII code after which
  1858. I timeout. This is very reproducible. As you know, I have encountered this
  1859. same problem with Kermit-VMS.
  1860.  
  1861. ********************************START OF FILE********************************
  1862.         BLBS    R0,10$
  1863.         RET                                     ; Return if error
  1864. 10$:    MOVC5   #80,INFAB,#0,#FABLEN,TEMPFAB
  1865. *********************************END OF FILE*********************************
  1866.  
  1867. The following is the packet.log file from the HOST Kermit.
  1868.  
  1869.  
  1870. ********************************START OF FILE********************************
  1871. s-0 Sz* @-#Y1~"  z>
  1872. r-0 Yz* @-#Y1~"  zD
  1873. s-+!FBUG.FILE 
  1874. r-*!YTMP.MARE"  z
  1875. s-y"D~( BLBS~$ R0,10$#M#J~( RET~E ; R
  1876. eturn if error#M#J10$:~$ MOVC5~# ##80,INFAB,##0,##FABLN
  1877. s-(resend)
  1878. r-y"D~( BLBS~$ R0,10$#M#J~( RET~E ; Re
  1879. Command too long
  1880. > OC5~# ##80,INFAB,##0,##FABLN
  1881. s-(resend)
  1882. s-(resend)
  1883. r-y"D~( BLBS~$ R0,10$#M#J~( RET~E ; Re
  1884. Command too long
  1885. > VC5~# ##80,INFAB,##0,##FABLN
  1886. s-(resend)
  1887. s-(resend)
  1888. r-y"D~( BLBS~$ R0,10$#M#J~( RET~E ; Re
  1889. Command too long
  1890. > OVC5~# ##80,INAB,##0,##FABLN
  1891. s-(resend)
  1892. s-(resend)
  1893. r-y"D~( BLBS~$ R0,10$#M#J~( RET~E ; Re
  1894. Command too long
  1895. > OVC5# ##80,INFAB,##0,##FABLN
  1896. s-(resend)
  1897. s-(resend)
  1898. r-y"D~( BLBS~$ R0,10$#M#J~( RET~E ; Re
  1899. Command too long
  1900. > OVC~# ##80,INFAB,##0,##FABLN
  1901. s-(resend)
  1902. s-(resend)
  1903. r-y"D~( BLBS~$ R0,10$#M#J~( RET~E ; Re
  1904. Command too long
  1905. > OVC5~# #80,INFAB,##0,##FABLN
  1906. *********************************END OF FILE*********************************
  1907.  
  1908. The following is the packet.log from the REMOTE Kermit.
  1909.  
  1910. ********************************START OF FILE********************************
  1911. s-# N
  1912. s-(resend)
  1913. r-0 Sz* @-#Y1~"  z>
  1914. s-0 Yz* @-#Y1~"  zD
  1915. r-+!FBUG.FILE   z
  1916. s-*!YTMP.MARE
  1917. s-(resend)
  1918. s-(resend)
  1919. s-(resend)
  1920. s-(resend)
  1921. s-(resend)
  1922. s-(resend)
  1923. s-(resend)
  1924. s-(resend)
  1925. *********************************END OF FILE*********************************
  1926.  
  1927. Thank you.
  1928. Victor Skita  <skita@uconnvm.bitnet>
  1929.               <skita%b.chem@upenn.edu>
  1930.  
  1931. ------------------------------
  1932.  
  1933. Date: 2 Nov 1988 0946-EST
  1934. From: hsw@tycho.arpa  (Howard Weiss)
  1935. Subject: Problem with C-Kermit (server mode) on VMS.
  1936. Keywords: C-Kermit 4E(070)
  1937.  
  1938. I've got c-kermit version 4E(070) running on VAX/VMS 4.7 and it seems to work
  1939. fine (especially after increasing BYTELM to get the DIR and SPACE commands to
  1940. work - thanks to the .bwr file) except when the VMS side is running in server
  1941. mode.  I can transfer files to and from VMS from my SUN, but then there is a
  1942. problem when issuing the BYE command from the SUN to the VMS server.  BYE
  1943. causes the server to logout and go back to DCL, but the terminal
  1944. characteristics are NOT restored (i.e., the terminal is left in noecho,
  1945. passall, nottsync, eightbit, etc). I use the FINISH command which leaves
  1946. causes VMS to leave server mode but continue running kermit, the terminal
  1947. characteristics are OK.
  1948.  
  1949. Are there any words of wisdom?
  1950.  
  1951. Howard Weiss
  1952.  
  1953. ------------------------------
  1954.  
  1955.