File CKVKER.UPD Updates to C-Kermit for VMS version 5A(167) 14 Nov 1991 DRAFT DRAFT 1. Work around problem in spack() which causes data structure corruption when sliding windows are in use. spack() backs up to far (before the buffer) in some cases. Probably not noticed before because on Unixes the link order puts this in the end of the debug buffer. On VMS it overwrites bigsbsiz. This needs looking at by a protocol guru. (ckcfn3) 2. Generate a correct exit status when leaving the program. (ckuus5) 3. Issue the directory command when the user does a DIR. (ckuusr) 4. Report space available (SHOW QUOTA) when the user gives a SPACE command, instead of space used (as per interface spec). (ckvfio) 5. Generate a correct attribute packet when sending from VMS. Much rework here. All attributes are present except file format and record size, which need doing later. Also, inbound attributes are still ignored at this time. More work is needed in this area. (ckvfio) 6. Process TYPE commands properly. Previously there was no preceding CR/LF and CR's were not interspersed in the output at appropriate places. (ckuus4) 7. Fix CWD command. This relies on "knowing" the format of a VMS directory spec (specifically, that the end in ':', ']', or '>'. This also has the side-effect of allowing GET dirspec commands to do an implicit *.* wild- card in the specified directory. (ckvfio) 8. Fix the REMOTE command processor. Basically there were two problems: the zxcmd() procedure needed to be updated to know about the new first arg- ument (ack!) and zsattr() needed to be told how to fudge attributes for the case when the item being sent was not a disk file. (ckvfio) 9. Correctly terminate subprocess context when an interrupt packet is seen while we are processing a remote command. Also some buffering fixes re- lated to same. (ckvfio) 10. Correct problem with filename completion. Previously, the fully qualified filename would be output after the partial the user entered. We now back up over the partial. Also, fixed the '?' option to display filenames one per line. Note that there is still a problem with filename completion. Consider the example SEND CK? followed by SEND CKV?. The second SEND will still use the CK? wildcard in error. FDC has been notified, and this may be fixed in edit 151. (ckucmd) 11. Convert ZIFILE operations to full RMS. This fixes the CR/LF delimiter problem in binary files. CR/LF pairs are now appended as needed, based on the file characteristics. (ckvfio) 12. Undefine NLCHAR, since the VMS file types are complicated enough to need a full treatment in CKVFIO, rather than the simple Unix-style approach NLCHAR gives us. (ckcdeb) 13. Fix problem with remote command output introduced by #12. (ckuus4, ckvfio) 14. Add support for Fortran carriage control files. Such files are converted to overprinted CR/LF as they are being transmitted. (ckvfio) 15. Clean up the code in ckvfio. Add a version identifier. (ckvfio) 16. Build a correct '/' attribute sub-block. Like the owner field, this is not yet used by the mainline C-Kermit code. (ckvfio) 17. Start working on using native RMS for received files. Work completed for binary (fixed 512) files, more needed for text files. (ckvfio) 18. Store all log files as sequential variable, CR-delimited. (ckvfio) 19. Correct the sending of fixed 512 files to honor the first free byte field. Thus, files will no longer change length when passing through the VAX. This required a change to block I/O for these file types. Also allow undefined file types to benefit from the same processing. (ckvfio) 20. Finish first cut of full RMS support for received files. There seems to be a problem if VMS C-Kermit is in binary mode and receiving a file sent by MS-Kermit which is not in binary mode. Further investigation is needed. (ckvfio) 21. Fix zstime() in ckvtio by fdc's request. (ckvtio) 22. Fix "unsupported speed" messages when entering server mode on the default port. (ckvtio) 23. Make maximum record size of logging files 80 bytes, so they can be easily searched/edited/mailed, etc. (ckvfio) 24. Add support for SET FILE TYPE IMAGE. Note that it doesn't work, since the remote Kermit overrides this. Must consult w/ fdc on this. (ckvfio) 25. Add iswild() code from fdc for edit 157. (ckvfio) 26. Conditionalize REMOTE HELP response for VMS to emit returns as well as newlines. (ckcmai) 27. Correct attribute processing sequence (do before opening output file). fdc will propagate this to master sources. (ckcfn3) 28. Correct another backwards savmod = binary / binary = 0 case. fdc will propagate this to master sources. (ckcfns) 29. Correct the behavior of zopeno() so that a superseded file will work correctly (for example, when a version limit is set). (ckvfio) 30. Make a local copy of the binary flag when the output file is opened. The binary flag tends to change state before we are done needing it. (ckvfio) 31. Make IMAGE mode work. This is the continuation of item 24, above. Note that image mode is only useful in very unusual circumstances - normally it will give you an unusable file. This mode works by sending you all of the bytes in the file verbatim, including ones normally used by VMS for record attributes and delimiters. Also, note that this mode only applies to files sent from VMS C-Kermit and is ignored when files are received by C-Kermit. (ckvfio) 32. Remove a spurious return from the zsoutl() routine. This was generating spurious 's when log files were viewed using an editor. (ckvfio). 33. Correct a problem introduced by the parity-sensing code. The parchk() routine was examining the next-to-last byte of the packet [n-2] rather than the last byte of the packet [n-1]. Thus, if the file being received had a byte with the high bit set that happened to be the last byte in a packet, _and_ block check 1 was in effect, the parity routine would be- come confused and cause the high bits to be stripped from the packet. Not pleasant. (ckcfn2) 34. Correct the performance hit when an ASCII transfer into CK exceeded 32Kb. New ASCII zoutdump() code by Ben Cohen, . (ckvfio) 35. Correct the problem where 2 nulls would be inserted into received binary files every 32Kb when DYNAMIC is defined. The zbuffer's must be a multiple of 512 bytes. DYNAMIC defined them as 32766, the fix changes then to 32768. (ckcker) 36. Add support for SET FILE RECORD-LENGTH N. This applies only to received files (correct size is detected automatically when sending) and only for files of TYPE BINARY. Any recordsize may be selected; however it is wise to a) use one smaller than the file size, and b) one that RMS can handle without crashing (i.e. <= 32768, regardless of what the VMS manual says). (ckuus2, ckvfio, ckcdeb) 37. Do lots of testing with asynchronous I/O, deferred writes, read-ahead, pre-allocation of the file, etc. No item or combination of items improved operation by more than .5%, which is in the noise anyway. One useful side effect: all modules except ckuusr are now compiled with optimization. (ckvker.com) 38. Fix a problem reported by Joe Doupnik where single-char- acter lines at the end of a file would cause access violations in the memmove() call in the zoutdump() routine. (ckvfio) 39. Add more detailed debug logging when creating an output file. The file mode being used (TEXT, BINARY, IMAGE or LABELED) is logged. If an unknown mode is presented, the mode number is logged as well. This should help locate future problems with unexpected file modes. (ckvfio) 40. Completely replace the zstime() function. When a remote Kermit supplies a valid date/time in an attribute packet, the created file will have the specified time as the VMS file creation time. Also, SET FILE COLLISION UP- DATE now functions, although it is perhaps less useful on VMS, as VMS has file version numbers. (ckvfio) 41. Add support for the zchkspa() function. Files which are too large will now be rejected. Lack of rejection does NOT imply a file can be received; other considerations such as disk quota and other users filling the disk prevent certainty of successful reception. (ckvfio) 42. Move the debug() call in zxpand() inside the if statement to prevent access violations, per fdc. (ckvfio) 43. Extensively re-work ckvfio internals to support DECnet access to files. The existing stat() and access() calls in zchki() were replaced with a single native RMS call, various tests (such as $idtoasc) now handle DECnet results from non-VMS operating systems where the feature isn't supported, an expli- cit SET FILE TYPE IMAGE forces opens in BIO mode rather than BRO, since a non-VMS DECnet implementation may not allow mode switches in mid-stream. Note that the filespec (all info to the right of the '::') may need to be quoted, since VMS RMS attempts to interpret fields which may be illegal on a VMS system (such as a non-octal digit in a PPN). Example: SPC11Z::[49,7]CKVFIO.C must be quoted as: SPC11Z::"[49,7]CKVFIO.C" Note: The upper-level C-Kermit parser currently doesn't handle the space in the access control information. Some cases may be worked around by quoting the space as \32, but this doesn't work in file specs received from a re- mote Kermit when C-Kermit is in server mode. Must get fdc to look at this. 44. Correct a long-standing bug with the READ command. (ckvfio) 45. Add support for forthcoming SET FILE TYPE BINARY UNDEFINED feature. This is to support an application which insists on UNDEFINED files. In general, this mode should NOT be used. (ckvfio) 46. Correct a bug where the VERIFY setting was being propagated to the subproc- ess used for handling REMOTE commands, causing spurious output of ">>> END OF KERMIT COMMAND <<<" and other such things. (ckvfio) 47. Add filesize padding when checking for free disk space for a text mode file. Code from fdc. (ckvfio) 48. Use code from Gary Mussar to re-work zoutdump() for ASCII files to improve performance when receiving. Due to the complexity of this area, the pre- vious method is still available by #defining OLD_WAY when compiling. If no problems are reported, the old code will be removed ca. edit 170. (ckvfio) 49. Add CKERMIT_STATUS symbol, set on exit, so VMS users can determine the state of requested operations. CKERMIT still only exits with SS$_NORMAL or SS$_ABORT status. Reworked header file as well. (ckuusx, ckcdeb.h) 50. Rough start on TYPE LABELED. We can now send a LABELED file out, with the following constraints: 1) Nothing can yet convert it back, 2) The "magic" characteristics longword isn't loaded yet (need to do a C interface to xabitm, not defined by VAX C), 3) Application ACE's are not yet read and stored. Current label types are KVERS - Kermit version, VMSNAME - VMS file- name, VMSFILE - VMS file characteristics. (ckvfio) ****** NOTE WELL ****** These characteristics are quite volatile and will be subject to radical changes for the forseeable future. The behavior of a VMS C-KERMIT receiving a LABELED file from another VMS C-KERMIT of another version is UNDEFINED and UNPREDICTABLE until I announce stability of the feature. THIS MAY PREVENT YOU FROM DECODING OR USING FILES. NOTE WELL. 51. Additional changes for labeled file processing. These were bugfixes to #50, the same restrictions still apply. (ckvfio) 52. Wrote an outboard decoder for labeled files. This will be part of the stan- dard distribution, since it offers options which won't (at least initially) be present in C-Kermit itself. (ckvcvt) 53. Fix a small problem in compiling ckvfio. The definition for the journaling field in the FAB doesn't exist in versions of VAX C before V3.1, so we will define it relative to the record format field, which is always available. (ckvfio) 54. Have the system print the actual reason when an RMS error occurs when us- ing the outboard file decoder. Also cleaned up the help text. (ckvcvt) 55. Add ACL handling for labeled files. Also cleaned up the journaling problem once and for all. (ckvfio, ckvcvt, ckvusr) 56. Correctly report the file size as (highest_block-1)*512+first_free_byte instead of allocated_blocks*512. (ckvfio) 57. Prevent captive or restricted users from invoking lib$spawn. This disables some built-ins (dir, etc.) as well as spawn/push. (ckvfio) 58. Fixed the LOG SESSION logfile. Previously it would contain random small chunks of text with extraneous line breaks. This change (of course) chan- ges the RMS structure of the session log file. (ckvfio, ckvcon) 59. Implement SET FILE TYPE LABELED for file receives. Also cleand up a few typos in the main code that dealt with labeled files. (ckvfio, ckuus3, ckuus5). 60. Correct a potential problem when flushing buffers after a disk error when receiving a file. (ckvfio) 61. Fix SET INPUT TIMEOUT (it didn't). Extraneous rtimer() call. (ckvtio.c) 62. Fix parity handling not using the right buffer offset. (ckvtio) 63. Fix MAIL and PRINT dispositions not working in server mode, general cleanup of code in that area. (ckvfio, ckcfns). More changes are expected.