ckc197.txt
资源名称:cku197.tar.Z [点击查看]
上传用户:dufan58
上传日期:2007-01-05
资源大小:3407k
文件大小:866k
源码类别:
通讯/手机编程
开发平台:
Windows_Unix
- days since 17 November 1858 -- which, coincidentally, is also Day Zero in VMS.
- I added system independent functions to convert from a free-format date to MJD
- (fmjd()) and vice versa (fmjd2date()). So now we have date arithmetic,
- e.g.:
- .%x := fmjd() ; Today's MJD
- .%x ::= %x - 7 ; MJD one week ago
- send /after:fmjd2date(%x) *.* ; Send all files created in the last week
- or more compactly:
- send /after:fmjd2date(fmjd() - 7) *.*
- ckuusr.h, ckuus4.c, 3 Jul 98.
- Added fday(date) (day of week) and fnday(date) (numeric day of week).
- ckuusr.h, ckuus4.c, 4 Jul 98.
- Added help text and docs for new date functions, ckuus2.c, ckermit2.txt,
- 4 Jul 98.
- Added evalx(), which is a silent version of evala() -- does the same thing,
- but does not print any error messages. ckuus5.c, 5 Jul 98.
- Fixed rdigits() not to succeed when given the null string or an empty string.
- ckucmd.c, 5 Jul 98.
- fdate() and fsize() did not fail or print error messages if given bad
- arguments. Fixed in ckuus4.c, 5 Jul 98.
- Added ftime(), fntime(), and fn2time(). ckuusr.h, ckuus[24].c,
- ckermit2.txt, 5 Jul 98.
- Added v(tftime) - elapsed time in seconds of most recent file transfer.
- ckuusr.h, ckuus4.c, 5 Jul 98.
- From Kevin Handy: Although it is legal to take the address of a constant in
- VAXC, it is not legal in GCC (and not a good idea either!). This was done in
- the VMS version of gftimer(). Fixed by assigning the constant to a variable
- and taking the address of the variable. He can now build C-K 6.1 B.05
- successfully with GCC 2.8.1 on VMS 5.5-2 without network support. ckvtio.c,
- 5 Jul 98.
- IKS changes from Jeff, many modules, 6 Jul 98.
- Removed the restriction from tod2sec() that hours must be 24 or less. There
- is no reason why lots of hours can't be specified -- after all, we can still
- convert them to seconds. ckuus6.c, 6 Jul 98.
- Changed cm/ckcvtdate() to allow hours to be > 24 if given a special argument.
- ckucmd.c, 6 Jul 98.
- Merged tod2sec() and fntime() -- they have the same purpose, but the latter
- is much more tolerant (see ckermit2.txt). ckuus4.c, 6 Jul 98.
- Removed 75 lines of crufty code from doalarm() and replaced them by calls to
- the new date/time-handling functions, to fix problems with alarms that span
- midnight. ckuus3.c, 6 Jul 98.
- Corrections to yesterday's changes -- missing args to ckcvtdate(), etc.
- ckuus3.c, ckuus6.c, 7 Jul 98.
- Added HADDRLIST definition for major Unixes to ckcnet.h, and removed them from
- the makefile. 7 Jul 98.
- Added CLEAR ALARM -- more intuitive than SET ALARM 0 (which still works).
- ckuusr.[ch], ckuus3.c, 7 Jul 98.
- Added CLEAR TEXT-PATTERNS and CLEAR BINARY-PATTERNS; everything that has an
- ADD or REMOVE command should also have a CLEAR command. ckuusr[ch], 7 Jul 98.
- Updated HELP CLEAR -- it was way out of date. ckuus2.c, 7 Jul 98.
- Added a section, 7.15, on alarms to ckermit2.txt. 7 Jul 98.
- Changes from Jeff to support server-side Telnet negotiations and remote/local
- echo. ckuusr.h, ckuus[23457].c, ckcfn2.c, ckucon.c, ckucns.c, ckcnet.c,
- 11 Jul 98.
- Added hooks for SET NETWORK TYPE PTY, but they don't do anything yet. Symbol
- NETPTY governs inclusion of PTY code, defined for now only for SunOS.
- ckcnet.h, ckuus[r3].c, ckutio.c, 11 Jul 98.
- Added REMOTE EXIT, 12 Jul 98.:
- . Server side: ckcpro.w, ckcfns.c, ckcmai.c.
- . Client side: ckuusr.h, ckuus[r7].c.
- . { ENABLE, DISABLE } EXIT: ckuusr.[ch].
- . SHOW SERVER. ckuus[56].c.
- . HELP REMOTE EXIT. ckuus2.c.
- . Documentation. ckermit2.txt.
- Defined Option and Mode bits for Extended GET. ckcker.h, 12 Jul 98.
- Added client side of Extended GET, single-packet, single-filespec version
- only, supporting only /DELETE /RECOVER /RECURSIVE options and /BINARY /TEXT
- /LABELED modes:
- . Defined Option and Mode bits for Extended GET. ckcker.h,
- . Set opkt flag in GET cases where needed & get options. doxget(), ckuus6.c.
- . Added new start state "o" for Extended GET. ckuus6.c, ckcpro.w.
- . Added opkt parameter to srinit(): ckcker.h, ckcpro.w, ckcfn2.c.
- . Reset O-Packet options after transaction complete. ftreset(), ckuusx.c,
- . Added code to srinit() to send O-packet. ckcfn2.c.
- Added server side of Extended GET. New state for incoming O packet, new
- second arg to sgetinit() indicating O packet, sgetinit() parses the O packet,
- extracts the flags, mode, and filename. Allows for multiple incoming O
- packets, even though the client doesn't send them yet. Does not yet allow for
- multiple filespecs. Does not yet support selectors of any kind (date, size,
- exception list). Cleaned up various other bits in sgetinit(). ckcpro.w,
- 12 Jul 98.
- Tested all combinations of GET switches on regular files as well as commands;
- it all seems to work nicely, including GET /DELETE /RECOVER /RECURSIVE when
- recursion and recovery actually are involved. If a new client sends an O
- packet to an old server, the server complains about unknown packet type. If
- an OLD client sends GET, REGET, RETRIEVE, etc, to a new server it works as
- expected.
- No particular documentation or help messages were needed since it's all under
- the surface -- it makes some GET switch combinations work that didn't work
- before.
- Will add selectors and multiple filenames (mget) later. Ditto for quoting
- and generic wildcards (but since wildcards already work nobody will notice
- that this part isn't done).
- Changes from Jeff to ckcfn2.c and ckcnet.c, 13 Jul 98.
- Fixed a bug in O-Packet encoding (it neglected to terminate the string).
- ckcfn2.c, 13 Jul 98.
- Added comments to O-packet decoder. ckcpro.w, 13 Jul 98.
- Changed O-Packet encoder to build a linked list of fields, and O-Packet sender
- to fill one or more packets with one or more fields on a first-fit basis.
- Various errors are now possible (malloc failure, filename too long, missing
- filename, etc), so an appropriate message is set for the E-Packet. ckcfn2.c,
- 14 Jul 98.
- Changed protocol engine to include a new state for sending and getting ACKs
- to O-Packets, and another new state for sending a sequence of O-Packets.
- ckcpro.w, 14 Jul 98.
- Tested OK with GET /RECURSIVE /RECOVER /DELETE /BIN short-filename (so it
- assembles the O-Packet fields from the linked list OK). Tested with a very
- long filename and verified that it triggers a second O-Packet. Tested
- with a null filename and verified it sends the proper error message (which
- should never occur in real life).
- Then came a test where the filename exactly reached the end of the packet,
- leaving no space for the 2-byte EOP tag ("@ "). This failed for a subtle
- reason in the getpkt() routine, namely that it did not distinguish between
- real data and memory-string data. Real data (such as file data) could leave
- behind leftovers that would be picked up next time. But getpkt() is called
- only once on string data -- the encoded argument string is supposed to fit
- into one packet. But getpkt() was (a) making leftovers, and (b) returning
- success, rather than failing in this case, thus truncating the data. This bug
- must have other consequences too, but none that have ever been reported.
- Once this was fixed it was possible to test the other cases. So now the
- protocol part is working -- the client will send as many O-Packets as it takes
- to handle all the O-Packet fields, and the server will read and process
- incoming O-Packets until the final one is received, and then will switch into
- send state, and the client will switch into receive state.
- There is a still one remaining area to handle -- packet loss:
- . What if the final O-Packet is lost? No problem, the server NAKs it.
- . What if the server's S-packet is lost? Here we have a problem if
- the client times out and resends its final O-Packet *and* this O-Packet
- has a nonzero sequence number: the server's transport layer
- rejects the packet. I'll handle this tomorrow...
- Still to do (easy now):
- . Handle multiple filenames
- . Handle selectors
- . Redo MGET to use O with multiple filenames (?)
- Merged LOGIN and LOGOUT commands from Jeff. Made lots of portability changes,
- plus some corrections (cklogin/out routines already existed; various malloc'd
- buffers were not being freed on error return from routines, etc).
- ckcdeb.h, ckuusr.[ch], ckuus7.c, 15 Jul 98.
- With the changes above, C-Kermit would not run properly when chroot'd because
- it could not find "/dev/tty", which it normally opens when entering protocol
- mode. This could be worked around with "-l 0" on the command line, except
- then Kermit thought it was in local mode. Fixed by making ttopen(), when
- given a device name of "0", set remote mode rather local. ckutio.c,
- 16 Jul 98.
- Added "-A" command-line option. Starts K95 as an Internet server on device
- "0". ckuusy.c, 16 Jul 98.
- Problem with both the above, at least on SunOS: After return from protocol
- mode, CRs are no longer supplied by the terminal driver after LFs (CRMOD
- function is lost). Explicitly setting it in concb() doesn't help. Turns out
- the problem was that UNIX concb() would just return if Kermit was started with
- device "0". Commented out that code and it works OK, but I wonder why it was
- there to begin with (i.e. I wonder what I just broke). ckutio.c, 16 Jul 98.
- Changed main program to call ckxlogin(NULL,NULL,NULL) if C-Kermit invoked with
- -A option, so the first thing the user sees is a login prompt. This happens
- before the initialization file, script, or any command-line action option is
- executed, but after Kerberos initialization, and it works OK, ckcmai.c,
- 16 Jul 98. (Presumably ckxlogin() will return 1 if user has already
- authenticated via Kerberos...)
- But when running C-Kermit in this manner, for some reason it gets a SIGHUP
- when receiving a file. Experimentation shows this happens whenever we use
- "-l 0" and the receive packet length (or the product of packet length and
- window size) is greater than 897, which looks suspiciously close to the TCP
- MSS. So all the changes made to accommodate file descriptor 0, though perhaps
- useful in other contexts, don't help here. The real trick is to go back to
- opening /dev/tty, but doing it before the chroot(), while we can still see it.
- Fixed in ckcmai.c, ckuus4.c, ckuusy.c. 16 Jul 98.
- Cleanups from Jeff for login code. ckuus7.c, 18 Jul 98.
- Tried building a version with:
- "LIBS= -L/usr/local/lib -lpwent -lcurses -ltermcap"
- to see if it would use the local authentication methods, found lots of bugs
- in the code that logs in a real user. Fixed them, now it works. ckuus7.c,
- 18 Jul 98.
- Moved user ID and password-checking code to new system-dependent routines,
- zvuser() and zvpass(). ckufio.c, 18 Jul 98.
- Changed ckxlogin() to behave consistently in call cases, always prompting for
- both a user ID and password, and not giving a failure message until after the
- user has given both, and always giving the same message in case of failure:
- "Access denied". ckuus7.c, 18 Jul 98.
- Verified that when logged in via ckxlogin() that "set line /dev/blah" fails
- properly when lockfile directory is protected against the logged-in user,
- even though the real user is root.
- Built a copy with CK_LOGIN, local libs, and NOLOCAL, since this is the
- configuration that will probably be used in the real world -- allowing an
- Internet Kermit server to dial out or make Telnet connections would make about
- as much sense as allowing an FTP server to do this. (But with Kermit, it
- would actually work -- but it would also open up enormous security holes...)
- Got this working OK after adjusting some #ifdefs, and the resulting executable
- is about 200K smaller. NOTE: We can't enclose all of ckcnet.c in #ifndef
- NOLOCAL because now we support server-side Telnet negotiation. However, I was
- able to #ifdef out a rather large portion of it. This involved making sure
- that TNCODE was not disabled if NETCONNN or TCPSOCKET were not defined, or
- if NOLOCAL was defined. So another 25K cut away. Many modules, 18 Jul 98.
- Rather massive rearrangement of ckcnet.c to allow TELNET routines and
- variables to exist even when NETCONN & TCPSOCKET are not defined and/or
- NOLOCAL is defined. 18 Jul 98.
- Enabled SET/SHOW TELNET when TNCODE defined, even if NETCONN & TCPSOCKET
- not defined or NOLOCAL defined. ckuus3.c, 18 Jul 98.
- All of the above will obviously need a lot more work, testing, and thought
- (not necessarily in that order). For example, how does Kermit, when in remote
- mode, know if it should be doing server-side Telnet negotiation? If it's
- already under a telnetd, then the only time it will see an IAC is if a quoted
- IAC has been unquoted and passed down, but how do we tell the difference?
- There's no way, unless we are told, e.g. by a command-line argument.
- For example, constructions like:
- if (netconn && (ttnproto == NP_TELNET) && (n == IAC))
- when used to decide whether to call tn_doop(), tn_siks(), etc, are completely
- wrong. They should be more like:
- if (n == IAC &&
- ((local && network && (ttnproto == NP_TELNET)) ||
- (!local && sstelnet)))
- where sstelnet is nonzero when we should be doing server-side Telnet
- negotiation. Such changes need be made only in code that can be executed in
- remote mode, e.g. in ttinl(). doinput(), etc. For now, we set the sstelnet
- flag when the -A command-line option is given (but we might want to make
- separate cases in the future for Telnet and non-Telnet servers that must be
- logged in to -- e.g. Kermit replacing login for incoming serial connections).
- Anyway, I think I caught most of these cases. Many modules, 18 Jul 98.
- Made a new makefile entry for testing all this: sunos41gccx. It adds NOLOCAL,
- TNCODE, and IKS_OPTION. 18 Jul 98.
- A debug log from Ron Heiby showed that we are accepting 0x81 as Start of
- Packet (SOP) even though we know parity is none. This is an artifact of the
- automatic parity detection code -- since we don't know in advance if the first
- packet has parity, we check for SOP using a mask of 0x7f. But after we know
- there is no parity, we should change the mask to 0xff. Fixed in ttinl().
- Also, improved the way ttinl() decides whether a parity check is needed by
- (re)setting the flag in ttpkt(), which is always called at the beginning of
- packet operations. I also rearranged the code a bit to test for interruption,
- SOP, and length in a more sensible (and efficient) order. ckutio.c, 19 Jul 98.
- Made "set prefixing none" invisible. ckuus3.c, 19 Jul 98.
- From Jeff, 19 Jul 98:
- . Moved cmdini() call to higher up in main() just in case anything that
- happens in prescan() needs the command parser or buffers. ckcmai.c.
- . Moved some code from prescan() to main(). ckuus4.c, ckcmai.c.
- . Change end_login() to zvlogout(). ckufio.c, ckuus7.c.
- Added protytpes for zv{user,pass,logout}() to ckcdeb.h, 19 Jul 98.
- Updated some comments in input(). ckcfn2.c, 19 Jul 98.
- Removed NONE from HELP SET PREFIXING message (Jeff), ckuus2.c, 21 Jul 98.
- Added SET SERVER CD-MESSAGE { ON, OFF }. When ON, and the user successfully
- CDs to a directory that contains a READ.ME file (name configurable), its
- contents are sent to the client's screen, similar to what wu-ftpd does. If
- such a file does not exist, or is not readable, the directory name is sent
- back in the ACK, as before. The default CD Message filename is defined in
- ckcker.h as DFCDMSG. This can be overridden by defining DDFCDMSG on the CC
- command line to be the quoted filename, e.g.:
- make xxx "KFLAGS=-DDFCDMSG=\"newname\""
- (the number of 's depends on the shell, how deeply nested the makefile entry
- is, etc). The default for UNIX and OS-9 is "./.readme"; for others it's
- "READ.ME". The default for SET SERVER CD-MESSAGE is OFF, except when user
- logs in anonymously, in which case it's ON. ckcmai.c, ckcker.h, ckuusr.h,
- ckuus[23].c, ckcfns.c, ckcpro.w, 21 Jul 98.
- Added SET SERVER CD-MESSAGE FILE <name> to allow the message-file name to be
- specified at runtime. ckuus3.c, 21 Jul 98.
- Added REMOTE SET SERVER CD-MESSAGE { ON, OFF }, client side and server side,
- Code 420, ckuus3.c, ckcfns.c, 21 Jul 98.
- Added CD Message material to SHOW SERVER. ckuus5.c, 21 Jul 98.
- Considered adding ENABLE/DISABLE CD-MESSAGE, but I don't see a need for it.
- If you can CD to a directory, you can GET or REMOTE TYPE any file in it that
- you have read access to, so there is no reason to disable the CD message
- feature; the user can turn it on or off as desired, and whoever sets up the
- server can set the initial state.
- Don't set the sstelnet flag if in local mode. ckuus4.c, 21 Jul 98.
- Made -A imply -z (force foreground), for when we are running under inetd.
- ckcmai.c, 22 Jul 98.
- Changed default CD-message file for non-UNIX to README.TXT. ckcker.h,
- 22 Jul 98.
- Problem with filename patterns, first noted by Peter Eichhorn:
- 1. Person sending files is running C-Kermit 6.1 on UNIX with SET FILE
- PATTERNS ON (which is the default) and SET FILE TYPE BINARY.
- 2. The Kermit program on the receiving end does not support Attribute packets.
- 3. The sender switches between text and binary mode per file, but since the
- receiver does not support A-packets, the sender has no way to tell the
- receiver about the mode switching.
- 4. Text files are sent with CRLFs.
- Consequences:
- 1. If the receiver is UNIX, this ruins the text files (at least for certain
- applications). This is an incompatible change from past behavior, and
- it is bad.
- 2. If the receiver is on a DOS-like file system, the text files arrive in
- the proper format. This, too, is a change from previous behavior in
- which the text files would have been sent in UNIX format.
- Possible solutions:
- 1. Leave matters as they are. Not good, since this breaks something that
- used to work.
- 2. As soon as the transfer starts, C-Kermit knows whether the other Kermit
- supports A-packets. If it does not, disable per-file mode switching.
- This eliminates Bad Consequence 1 above, restoring the earlier (and
- expected) behavior. It also eliminates Good Consequence 2 above, but
- that's OK since it is not a change from previous behavior.
- 3. Solution 2 is satisfactory but less than optimal, since one would expect
- that in SET FILE PATTERNS ON, "ON" means ON. It also rules out Good
- Consequence 2 even in cases where we might want it. A better solution
- might be to add SET FILE PATTERNS AUTO and make it the default. Then
- ON would mean ON, OFF would mean OFF, and AUTO would mean "ON but only
- if the other Kermit accepts Attribute packets".
- Option 3 restores the original behavior when the receiver does not support
- A-packets, but allows for mode switching when A-packets can be used, and it
- also allows for Good Consequence 2 when A-packets can't be used if you SET
- FILE PATTERNS ON. So...
- . Added AUTO to SET FILE PATTERNS keywords, value 2. ckuus7.c.
- . Changed default to AUTO. ckcmai.c.
- . Changed SHOW FILE and SHOW PATTERNS to display "auto". ckuus5.c.
- . Updated HELP SET FILE message. ckuus2.c.
- . Changed spar() to set patterns = 0 if AUTO && A-packets not negotiated.
- The prevailing setting is restored automatically at the end of protocol.
- ckcfns.c, ckuusr.c. 22 Jul 98.
- Corrected some filename patterns that were missing "*". ckcmai.c, 22 Jul 98.
- Server-side telnet changes from Jeff, including recognition of Telnet
- negotiations when at prompt. 23 Jul 98.
- Some minor server-side Telnet corrections:
- . When packet mode interrupted by ^C^C^C, echo "^C..." to stdout not stderr.
- . Flush typeahead before username and password prompts.
- Changed UNIX packet reader to print ^X... when interrupted, where ^X is the
- actual transfer cancellation character, rather than always printing "^C...".
- ttinl(), ckutio.c, 23 Jul 98.
- If TCPSOCKET is defined but TNCODE is not, define TNCODE for the benefit of
- any modules that might need it for server-side Telnet protocol, but that don't
- need to include all of ckcnet.h. ckcdeb.h, 23 Jul 98.
- The previous change still wasn't good enough for ckucmd.c, so I made it
- include ckcnet.h. 23 Jul 98.
- Added SET COMMAND AUTODOWNLOAD { ON, OFF }, independent of SET TERMINAL
- AUTODOWNLOAD { ON, OFF }. When ON, which is the default, the command parser
- recognizes Kermit packets. An S packet makes it go into receive mode, an I
- packet makes it go into server mode. ckuusr.h, ckuus[235].c, 23 Jul 98.
- Implemented SET COMMAND AUTODOWNLOAD in gtword(), ckucmd.c, and
- kstart(), ckcfn2.c, 23 Jul 98. For now, works only for Kermit protocol.
- Add Zmodem later.
- Changed server end of REMOTE LOGIN as follows:
- 1. If a login attempt fails, send back an Error packet rather than an ACK
- with an error message, so the client can tell that it failed.
- 2. If started with -A, authenticate the user via ckxlogin() rather than
- the SET SERVER LOGIN strings.
- 3. If the client tries to log in when already logged in, send an E packet,
- but leave them logged in.
- The next step is to allow a REMOTE LOGIN packet to be received and processed
- at the Username: prompt. This almost works -- kstart() recognizes the packet
- OK, but since the command parser has not entered its keyword parsing loop yet,
- the mechanism that is used under normal circumstances (stuff "server" or
- "receive" into the command buffer) is inappropriate here -- it just looks like
- a username. I'll fix this tomorrow.
- Add server idle-timeout into to SHOW SERVER, from Jeff. ckuus5.c, 24 Jul 98.
- printf(), putchar(), perror() replacements from Jeff for UNIX, to translate
- "n" to CRLF when C-Kermit is an Internet server, in which case there is no
- terminal driver to do this. When run as an Internet server, C-Kermit now
- prints normal-looking output rather than giving the stairstep effect.
- ckutio.c, ckcdeb.h, 24 Jul 98.
- Changed '-A' to include '-Q' (fast protocol settings) and (from Jeff) to
- set "nopush". Previously, nopush was set only for guest logins; now it is
- set for regular ones too, not for security reasons, but because output from
- inferior processes has bare LFs, since there is no terminal driver to convert
- them to CRLF. ckcmai.c, ckuusy.c, 24 Jul 98.
- Changed ckwart to not use the printf(), putchar(), perror() replacements,
- since it does not have access to them. ckwart.c, 24 Jul 98.
- Added numerous casts to shut up picky Sun ANSI cc. ckcfn[2s].c, ckcpro.w,
- ckuus[r7].c, 24 Jul 98.
- Yesterday's code broke regular logins at the Username: prompt by failing to
- set the "logged in" variable checked by the server whenever a command is given
- that requires the user to be logged in. Fixed in ckcmai.c, 24 Jul 98.
- Adjusted the method for the command parser to let the upper level code know
- that a Kermit packet had been received, so now it doesn't depend on the
- top-level keyword table. Instead, it just sets the start-state appropriately.
- This method could be used by the CONNECT command too, since it's a lot simpler
- and does not rely on APC or the script language being configured in, but it
- would also require changing every CONNECT module plus the mainline code that
- calls the CONNECT module. ckucmd.c, 24 Jul 98.
- Adjusted the main program to call ckxlogin() in a loop in a way that allows
- direct login at the prompt, or via Kermit REMOTE LOGIN packet. But this fails
- because of the autoupload string "kermit -x" has already been read at the
- Username prompt and taken as the user name. But then if the password reader
- also checks for autoupload, we undo this and it works quite nicely. Made sure
- that "kermit -A" exits after three successive unsuccessful attempts to log in,
- no matter whether this is at the prompt or by REMOTE LOGIN. But this does not
- close the connection to the client, since it is the superior program (such as
- inetd) that has it open, so that program has to be relied upon to close the
- connection when the server program exits. ckcmai.c, ckuus7.c, 24 Jul 98.
- Added a pause after each unsuccessful login attempt. ckcmai.c, 24 Jul 98.
- Even assuming the connection is closed by the remote after 3 bad login
- attempts, if the client is sitting at its prompt sending REMOTE LOGIN
- requests, there is no indication to the user that the connection has been
- closed. Changed the client so if REMOTE LOGIN or any other REMOTE command is
- given when in local mode but ttchk() returns < 0, it prints "?No connection"
- and fails. ckcpro.w, 24 Jul 98. (I probably should do this for SEND and
- RECEIVE too...)
- Changed DIRECTORY command, general case, to call domydir() (built-in
- directory-listing generator) if NOPUSH is defined or if nopush is set.
- ckuus6.c, 24 Jul 98.
- Added an easier way to access command-line arguments. In:
- kermit -a -b -c ... = word1 word2 word3 ...
- "/path/kermit" is assigned to top-level %0, word1 is assigned to top-level
- %1, word2 to %2, and so on. If a Kermit script is started on the command
- line, %0 is set to the pathname of the script rather than the pathname of
- Kermit. cmdini(), ckuus5.c, 25 Jul 98.
- Made "show args" work for top level. doshow(), ckuus5.c, 25 Jul 98.
- Made v(argc) work for top-level. nvlook(), ckuus4.c, 25 Jul 98.
- Now it's a lot easier to write Kermit scripts for UNIX that have "shbang"
- lines, and pass arguments to them on the command line -- it works just like
- a shell script, except for the "=", which is needed to separate arguments
- for Kermit itself from arguments for the script.
- Beefed up UNIX zfnqfp(). Previously it was susceptible to "/./", "/../",
- "..", "//", and similar tricks. Now I hope it's bulletproof. For example,
- "fpathname(/usr/olaf/tmp/./foo/../../x.y)" now returns "/usr/olaf/x.y"
- rather than "/usr/olaf/tmp/./foo/../../x.y". The latter wasn't exactly wrong,
- but now we can be more confident if we want to change DISABLE CD in the server
- to restrict the user to a rooted directory *tree* rather than just a single
- directory. ckufio.c, 25 Jul 98.
- Fleshed out the syslog() and wtmp features of IKS. I separated the two, and
- enabled only wtmp, since I have no idea what syslog() does or how to test
- whether we're using it right. So now Kermit makes a wtmp entry when I log
- into the Kermit server, and another one when I log out. But even after I log
- out, "last" says I'm still logged in.
- But while testing this, the client Kermit started crashing (this is what
- prevented the logout entry from getting into wtmp). The debug log shows a
- ttinl() timer going off while I'm in the command parser, which indicates that
- it thinks it got a packet from the keyboard (which it did not) (the crash
- occurs because no handler is armed for the SIGALRM). Furthermore, the log
- shows that the streaming flag gets turned off for some reason (which is why
- the timer is going off in the first place, since ttinl() is untimed when
- streaming). I disabled the wtmp code in case that caused it, but no
- difference, so I turned it back on.
- OK, one thing at a time. wtmp... As near as I can tell from "man last",
- logout and login records are matched by username and "terminal name", which
- should form a unique pair. When somebody logs in to ftpd, it records the
- terminal name as "ftp" followed by the ASCIIized pid of the ftpd incarnation,
- like "ftp12345". The "last" program evidently has code in it to strip off the
- numeric part after "ftp", so this never shows up in a listing. If I do the
- same thing in Kermit, it seems to work -- "last" shows the session as logged
- out, but does not strip off the pid so the listing looks ugly ("kermit92",
- instead of just "kermit"). So I made it "kermit_xxxx", where xxxx is the pid
- in hex. I hope this doesn't overflow any buffers anywhere, since this is a
- rather long "terminal name". ckufio.c, 25 Jul 98.
- The hostname did not show up in "last" listing since the Kermit server is
- communicating over stdio and has no idea what the client host is. But when
- inserver != 0 stdio is really a socket, so we can call getpeername() on it.
- And this works, but of course, only if C-Kermit is built with -DTCPSOCKET
- (i.e. without NOLOCAL). I added a ckgetpeer() routine to ckcnet.c to return
- the hostname or address of the peer, and call it from the inserver startup
- section in ckcmai.c; seems to work fine. 25 Jul 98.
- As for the crashing... It seems to be an aftereffect of recognizing a packet
- while in the command parser. It happens later on, but it never happens if
- I don't exercise that code. It can happen on either end too, not good.
- (I knew adding this feature was too easy!)
- Rearranged things to allow -x to appear on command line with -A, and if it
- does, to skip the Username: prompt and go straight into server mode. Testing
- in this mode shows solid operation, no crashes. So this seems to confirm that
- the crashing problem is caused by the command-mode autoupload feature.
- ckcmai.c, ckuus[4y].c, 26 Jul 98.
- When -A given on command line, enter server mode automatically if me_iks_start
- has been set in the Telnet negotiations. But this never happens because the
- server does not send START KERMIT until after it enters server mode, which is
- probably a good thing. ckcmai.c, 26 Jul 98.
- When BYE was sent to the server, it called zkself() immediately, bypassing
- zvlogout(), so the logout record was not being written to wtmp. Made BYE
- call ckxlogout() instead if zkself() if inserver. ckcpro.w, 26 Jul 98.
- Moved "Enter Client/Server Mode..." message from ckucon.c to doconect() in
- ckuus4.c, so it doesn't need to be replicated in all CONNECT modules, and
- added REMOTE LOGIN and REMOTE HELP lines. 26 Jul 98.
- Fixed command-mode autodownload code to be active only when C-Kermit is in
- remote mode, since it can't possibly work when in local mode. ckucmd.c,
- 26 Jul 98.
- Allowed server to execute BYE (if it is not disabled) even if user is not
- logged in (but not FIN since we don't want not-logged-in users getting to
- the prompt). ckcpro.w, 26 Jul 98.
- Reorganized ckxlogin() to have a common exit to make sure prompt is restored,
- malloc'd items are freed, etc. ckuus7.c, 26 Jul 98.
- Recent additions to ttinl() to handle Telnet negotiations, etc, failed to
- turn off the alarm() at each return point. I added them, and this fixes the
- crashing. ckutio.c, 26 Jul 98.
- Protocol engine was not sending back an error packet in response to
- REMOTE HOST commands when nopush in effect. Fixed in ckcpro.w, 26 Jul 98.
- Allowed REMOTE HELP when not logged in, and made the message say REMOTE
- LOGIN required in that case. ckcpro.w, 26 Jul 98.
- Added a help message for the Username prompt, and a herald above it.
- ckcmai.c, ckuus7.c, 26 Jul 98.
- Added code to zvpass(), at the point where the user is logged in, to set
- environment variables HOME, USER, and LOGNAME, and to copy the username into
- uidbuf[] and make homdir point to the login user's home directory, or if it's
- a guest login, to "/". Now $() returns the right things for these, and so do
- v(user) and v(home). This also fixes the problem of executing the real
- user's .kermrc, rather than the effective user's. ckufio.c, 26 Jul 98.
- PWD in the UNIX version at the server's prompt ran the external pwd command.
- Replaced this by a call to zgtdir(). ckcmain.c, 26 Jul 98.
- Verified that:
- . If you send BYE to the Username: prompt, it logs out the server.
- . If "kermit -Ax" is used to start server mode (so user must log in with
- REMOTE LOGIN), and the client does not negotiate IKS and therefore can
- CONNECT, that ^C^C^C prior to login does not give the user the prompt --
- instead it makes C-Kermit exit, which is exactly what should happen.
- . If you start it as "kermit -AxS", then ^C^C^C also exits (I had to put
- in special code for this).
- . You can not SEND a file to the Username: prompt, or do REMOTE CD, or
- anything else that is not allowed prior to login.
- Replaced the following:
- len = (binary && !parity && !memstr && !funcstr) ?
- bgetpkt(spsiz) : getpkt(spsiz,1);
- with:
- if (binary && !parity && !memstr && !funcstr)
- len = bgetpkt(spsiz);
- else
- len = getpkt(spsiz,1);
- in ckcfns.c, since the former caused the OS-9 compiler to generate bad code.
- Confirmed by Gregorie Martin, who also supplied a new OS-9 makefile and a
- new ck9asm.a module, allowing 32-bit builds, which are now necessary since
- data space is more than 64K in some modules. 27 Jul 98.
- Disabled logfile creation by anonymous users. ckuus4.c, 27 Jul 98.
- From Jeff: Implement NVT and Telnet-Binary handling of CR, CRLF, CR-NUL in the
- command parser for server-side command input. This fixes the bug with SHOW
- MACROS needing two CRs to confirm. gtword(), ckucmd.c, 27 Jul 98.
- From Jeff: Recognize Ctrl-D as EOF in the command parser. This allows users
- to cancel a login at the Username: or Password: prompt. ckuus7.c, 27 Jul 98.
- Disabled Ctrl-D as EOF except when (inserver && !x_logged), and made Ctrl-C
- act like Ctrl-D. ckucmd.c, 27 Jul 98.
- From Jeff: Clear all owner permission bits when creating files as guest,
- like wuftpd. Also, fix an octal mask that missing its leading 0. ckufio.c,
- 27 Jul 98. Notes: When storing files in (say) kermit/incoming, they are
- created with ----rw-r--. This prevents anonymous ftp users from reading
- them or overwriting them. But wuftp uses ----r----- (how does it know?).
- From Jeff: Disable FTP, PING, and WHO commands if nopush set. ckuusr.c,
- 27 Jul 98.
- From Jeff: Minor corrections to Telnet negotiations. Implement server-side
- NAWS. ckcnet.c, 27 Jul 98.
- NAWS stuff didn't quite work -- even though the negotiations are OK, every
- time thereafter the server goes to check its screen size, it gets its own
- rather than the client's. That's because ttgwsiz() calls a local ioctl().
- To solve this, I changed Jeff's new code in ckcnet.c to set environment
- variables for LINES and COLUMNS from incoming NAWS subnegotiations, and then
- made ttgwsize() call xttgwsize() (which checks these values) if inserver is
- set (there might be a faster way to do this, but this mechanism was already
- there for other reasons -- come back and improve later if peformance is a
- problem). ckcnet.c, ckutio.c, 27 Jul 98.
- Various interactive-mode features were not working in the Internet Kermit
- server: KERMIT READY TO... messages, askmore(), etc. Since fd 0 is a
- redirected socket, isatty() was failing, and backgrd was being set. Fixed in
- conbgt(), ckutio.c. Similarly, changed is_a_tty() (the isatty() front end) to
- return(1) if inserver. ckcmai.c, 27 Jul 98.
- I commented out the code that set SIGHUP to SIG_IGN (see 16 Jul 98 notes).
- We don't need it any more. ckutio.c, 27 Jul 98.
- Three failed REMOTE LOGINs in a row did not make the server drop the
- connection as it should. Fixed in ckcpro.w, 27 Jul 98.
- Removed "Entering Client/Server..." message from ckucon.c. 27 Jul 98.
- Bugs:
- . Client and server get into a loop negotiating SGA (the loop is broken
- automatically after 4, but should not happen in the first place) (not
- really a bug -- needs to be this way for DG Telnet server).
- . If you try to SEND a file to the Username: prompt, you get an error "?Login
- required", as expected, but for some reason the server is still in receive
- mode, sending NAKs, rather than back at the Username: prompt.
- . Something is messed up with packet recognition at the Username: prompt
- again. The first one is not recognized, but subsequent ones are.
- To do:
- . Create special pre-login init.
- . Do what wuftp does about incoming. Consider both anonymous and logged-in
- users. This is probably something for the pre-login init.
- . If user is guest, don't allow OPEN WRITE?
- . No need to send "kermit -x" if IKS (but no harm either).
- . Fix built-in DIR command to show permissions in UNIX, VMS, etc.
- . Make ckxlogin() do if (me_iks) tn_siks(IKS_START) ??? No, this would
- prevent use of the Username: prompt by those who prefer it.
- . Change "kermit_xxxx" to "iks_xxxx" because of uname.h length limits.
- . DISABLE BYE should have no effect when IKS
- . Add runtime "nolocal" variable, turn it on & enforce it for guest logins.
- . Set local environment variables from NEW_ENV?
- Added Atlas/Newcom 33600ifxC modem type -- there's evidently a big demand
- for this since they are selling for $9.95. ckuusr.h, ckudia.c, 28 Jul 98.
- Added TX_9LATIN symbol for ISO 8859-15, Latin Alphabet 9. ckcxla.h, 29 Jul 98.
- Added FC_9LATIN and FC_CP858 file character-set symbols. ckuxla.h, 29 Jul 98.
- Changed references to "Latin-15" to "Latin-9". ckouni.[ch], 29 Jul 98.
- After hours of research found that the proposed (but not final) registration
- number for ISO 8859-15 Latin Alphabet 9 is 203, so now we have a Kermit code
- for it. Reference: DOCUMENT REGISTER JTC1/SC2, Character sets and information
- coding, N 3099 - N 3000, Item E3086, 1998-05-01. Filled in functions and
- tables for Latin-9 and CP858. Seems to work OK, but needs refinement and
- more testing. Meanwhile, hurray, we're "Euro compliant". ckuxla.c, 29 Jul 98.
- Integrated recent changes from Jeff, 1 Aug 98:
- . Conditionalize printf() replacement in UNIX, since it conflicts with
- Linux curses library. ckcdeb.h.
- . Change TELOPT_IKS definition from 45 to 47, since 45 has already been
- assigned by IANA for something else.
- . Add some missing #ifdef CK_AUTODL. ckuus3.c...
- . Refine conditions under which tn_iks(IKS_STOP) is called at the
- top of the parse loop. ckuus5.c.
- . And when returning from CONNECT mode. ckuus4.c.
- . Refine conditions for which "Enter Client/Server Mode" msg. ckuus4.c.
- . Make sure we have a Kerberos principal name in AUTH cmd. ckuus7.c.
- . Show principal name in AUTH Password: prompt. ckuus7.c.
- . Save username to uidbuf[] in ckxlogin(). ckuus7.c.
- . Various corrections to ckufio.c.
- . Save peer's IP address even if SET TCP REVERSE not ON. ckcnet.c.
- . Add tn_push() and tn_wait() to solve the following problem: traditional
- Telnet clients are always reading from the socket. But when C-Kermit is
- at the prompt, it is not reading from the socket. When the user says
- "set host blah", C-Kermit sends some Telnet negotiations, but never reads
- the responses until the user goes into CONNECT mode or does an INPUT
- command (or, now, starts Kermit protocol). The new routines allow
- negotiations to go back and forth until all commands that require an answer
- have completed, or a certain amount of time has gone by, whichever comes
- first, AND also saves any plain text that arrived during this period for
- subsequent processing by the first command that tries to read regular data
- from the socket. This should allow immediate Kerberos or SRP authentication
- upon initial connection, without swallowing the host's messages or prompts,
- and it also takes care of hosts (like VMS) that issue the login prompt
- in the middle of Telnet negotiations. ckcnet.c.
- . Various changes to authentication negotiation. ckcnet.c.
- Changed IKS banner to show its own hostname. ckcmai.c, 1 Aug 98.
- Added a new entry for ICL DRS6000 (SPARC) with DRS/NX 4.2MP 7MPlus.
- makefile, 6 Aug 98.
- Integrated Jeff's changes, 10 Aug 98:
- . Add symbols & cmds for Telnet encryption on/off commands: ckuusr.h, ckuus3.c
- . Allow for non-stdio IKS operation: ckuusy.c.
- . Allow for command parsing on encrypted connections: ckucmd.c.
- . Issue warnings or errors for SEND/BYE/FINISH w/TKO but no server: ckuusr.c.
- . Ditto for GET: ckuus6.c.
- . Ditto for REMOTE: ckuus7.c.
- . Make REMOTE LOGIN prompt for missing info. ckuus7.c
- . Rearranged assorted TKO/IKS items: ckuus4.c.
- . Recognize REQ, etc, as REQUESTED (vs REQUIRED): ckuus3.c.
- . Updated SHOW FEATURES for Authentication/Encryption/etc: ckuus5.c.
- . Added encryption to console i/o: ckutio.c.
- . Adjustments to login process & for encryption: ckcmai.c.
- . Lots of IKS/TKO adjusments: ckcnet.c.
- Fixed up REMOTE LOGIN parsing/prompting code to never exit without restoring
- prompt and freeing malloc'd storage, etc. ckuus7.c, 10 Aug 98.
- Changes from Gregorie Martin to work around OS-9 C compiler bugs, and added a
- missing clause to snddir() so it would work for OS-9. ckcfns.c, 11 Aug 98.
- Also from Gregorie Martin, separate text and binary filename pattern lists
- for OS-9. ckcmai.c, 11 Aug 98.
- Added "set modem data-compression", which was missing from the keyword table;
- ("compression" was there, but "data-compression" is the phrase used in all the
- other commands; left "compression" there but invisible). ckuus3.c, 11 Aug 98.
- A couple minor corrections & changes from Jeff: ckcmai.c, ckcnet.c, 12 Aug 98.
- A couple minor changes from Jeff: ckcmai.c, ckcnet.c, 13 Aug 98.
- Added a nolocal variable. When nonzero, setlin() returns an error rather than
- opening a connection. nolocal is set to 1 automatically by -A. This is a
- patch in the true sense, and might need some refinement. ckcmai.c, ckuus7.c,
- 13 Aug 98.
- Added invisible (and irreversible) NOLOCAL command: ckuusr.[ch], 13 Aug 98.
- Added another invisible and irreversible command: DISABLE ENABLE. This allows
- the sysadmin to disable selected services, and prevent the user from
- re-enabling them even when they can get to the prompt (as in the client-side
- server arrangement of IKS). ckuusr.h, ckuus[r56].c, 13 Aug 98.
- Fixed server end of REMOTE LOGOUT, which didn't work at all. Various other
- combinations didn't work either, from among login required / not required;
- logged in already / not logged in; logging in / logging out. All combinations
- work sensibly now. Note: Logging out does not break the connection, so a
- subsequent login is allowed on the same connection. This might change.
- ckcpro.w, 13 Aug 98.
- Added code to prevent guests from using SET FILE COLLISION APPEND or RENAME.
- However, they can still use OVERWRITE and UPDATE -- this might change.
- ckuus7.c, 13 Aug 98.
- Changed wtmp record for IKS to say "iks_xxxx" rather than "kermit_xxxx" to
- stay within 8 chars, which is the limit in SunOS and probably many other
- platforms too. ckufio.c, 13 Aug 98.
- Added code to zprint() and zmail() to fail immediately if called by guest.
- ckutio.c, 13 Aug 98.
- Ditto at a higher level: after user logs in anonymously, do an implicit
- DISABLE PRINT and DISABLE MAIL. ckcmai.c, ckcpro.c, 13 Aug 98.
- Don't allow ENABLE MAIL or ENABLE PRINT if user is anonymous. ckuus6.c,
- 13 Aug 98.
- And as a failsafe, in case they somehow re-enabled them, have the protocol
- module disable them again whenever it is entered. ckcpro.c, 13 Aug 98.
- Fixed getyesno() (which is called whenever we want to print a question and
- parse a yes/no answer, e.g. "OK to close?") to not put the answer in the
- recall buffer. ckuus3.c, 13 Aug 98.
- Added XXRxxx symbols for top-level R-commands equivalent to each REMOTE
- command: RCD, RPWD, RDIR, RWHO, etc. But not RLOGIN because that already
- means something else. ckuusr.h, 13 Aug 98.
- Made REMOTE { L, LO, LOG } be synonyms for REMOTE LOGIN. ckuusr.c, 13 Aug 98.
- Moved REMOTE LOGIN parsing code to its own routine, plogin(). ckuus7.c,
- 13 Aug 98.
- The LOGIN command that we added a few weeks ago can not possibly be of any
- use, so I changed it to call plogin(). So LOGIN is now a synonym for REMOTE
- LOGIN. And I added a LOGOUT command that is a synonym for REMOTE LOGOUT.
- ckuusr.c, 13 Aug 98.
- Added a few R commands: RASG/RASSIGN, RCD/RCWD, RCOPY, RDELETE. These simply
- chain to the corresponding REMOTE commands. They work fine. ckuusr.c,
- 13 Aug 98.
- Added the rest: RDIR, REXIT, RHELP, RHOST, RKERMIT, RPWD, RRENAME, RREMDIR,
- RSET, RSPACE, RTYPE, and RWHO. ckuusr.c, 13 Aug 98.
- Merged first stage of Jeff's changes to reorganize Telnet protocol support.
- All Telnet symbol & struct definitions moved to new ckctel.h. All IKS_*
- and *_IKS symbols changed to KERMIT_* and *_KERMIT. Many modules, 14 Aug 98.
- Added ckctel.h dependencies to UNIX makefile. 14 Aug 98.
- Changed C-Kermit version number from 6.1 to 7.0 and test level from Beta.06
- back to Alpha.01. makefile, ckcmai.c, 14 Aug 98.
- Fixed command parser to not respond to recall keys when on_recall == 0,
- as it is (e.g.) in getyesno(). ckucmd.c, 14 Aug 98.
- Chasing down "Receive window full" problems... First, I found a scenario that
- would always create it: start server, go back to client, and tell client to
- "remote login blah" (when login not required), "remote logout", "remote cd
- invalid-directory", "remote cd valid-directory", "remote dir". Debug logs
- showed some mighty strange paths thru the code... First discovery: the SERVE
- macro definition contains more than one statement, but did not enclose the
- statements in braces. Therefore, subsequent constructions like "if (blah)
- xxx; else SERVE;" did not work as intended. Added braces around definitions
- of SERVE and RESUME. ckcpro.w, 14 Aug 98.
- But this did not make the problem go away. Next discovery: sometimes the
- sequence above would result in an error "It's a directory", which is found
- only in the REMOTE DELETE code. How did we get there??? Well, sending the
- "Receive window full" error packet set the packet type to E, so the next call
- to input() returned 'E'. But the protocol machine was still in "generic"
- state, and "<generic>E" is REMOTE DELETE. So I had the errpkt() routine
- reset the protocol state to 0. So no more "falling" into the REMOTE DELETE
- code. ckcfn2.c, 14 Aug 98.
- Next... Server sends a "Receive window full" error packet, but it is not
- displayed by the client. Why? Because C-Kermit always ignores E packets that
- arrive in response to an I packet, to allow for the possibility that the server
- does not understand I packets. We can't do anything about this, but it has
- probably been hiding the "Receive window full" problem enough that we did not
- realize how often it was really happening.
- So why is it happening? Logs show that we are not always calling tinit()
- (transaction initialization) after sending a short-form reply to a server
- command, or an ACK to an I packet. I-packet first... After the code to ACK
- the I packet, I replaced the call to pktinit(), which simply reset winlo and
- pktnum to 0, with tinit(), which resets everything. Ten minutes of testing
- now shows that (a) this does no harm (and in any case it is proper since the
- I/Y exchange is, by definition, a complete protocol transaction), and (b)
- seems to isolate the problem to whatever transaction follows a successful
- REMOTE CD. Finally... the problem with REMOTE CD turned out to be the code I
- added on July 21st to send back the contents of a .readme file, if any -- it
- neglected to handle the case where there was not a .readme. Fixed in
- ckcpro.w, 14 Aug 98.
- I also fixed a potential problem on the server end of REMOTE PWD, in which
- it would fail to send a response if the directory name was too long.
- ckcpro.w, 14 Aug 98.
- From Jeff:
- Date: Sat, 15 Aug 98 0:33:04 EDT
- From: Jeffrey Altman <jaltman@watsun.cc.columbia.edu>
- To: fdc@watsun.cc.columbia.edu
- Subject: new files
- just about every file has been touched. The new telnet code is
- operational but the initialization stuff has barely been addressed.
- Basicly what I have done is implemented all of the major changes to
- tn_doop() and its related support functions to use the new model.
- I have replaced all variables such as Me_binary, U_binary, ... with
- calls to the new TELOPT macros. I did not make these changes to
- VMS specific files such as console and terminal i/o.
- me_binary becomes TELOPT_ME(TELOPT_BINARY)
- u_binary becomes TELOPT_U(TELOPT_BINARY)
- etc. These macros may be used on both the left and right sides of an
- assignment. What I have not doone is address any of the issues we
- spoke about regarding initialization of the ME and U modes. There is
- a new function tn_set_modes() which is called in ckcmai.c that is used
- to set the initial defaults. tn_ini() needs to be modified to read
- user defaults for client and server modes. These fileds of the
- structures are not yet defined.
- For compilation purposes the tn_binary, tn_echo, tn_auth,
- ... variables are still declared in ckcnet.c. These are needed so the
- command parser will compile but the variables are not used at all
- anymore in ckcnet.c. So don't try to use them to control telnet
- option activation. They won't work. I will address these issues
- either tomorrow night or Sunday.
- Something I noticed is that server mode does not exit anymore when
- started by a terminal autodownload "kermit -Iig ..." This appears to
- be a side effect of the changes you made this afternoon. However, I
- have not spent any time to try and track it down.
- The changes to ckcnet.c reduced the code by over 400 lines and 100K in
- exe size.
- (end quote)
- IBM added the Euro symbol to a vacant position in CP857; updated the
- corresponding tables in ckouni.c. 15 Aug 98.
- Incorporated the network code changes from Jeff's message above. Most
- modules, 17 Aug 98.
- Made DISABLE apply not only to REMOTE commands sent to the server, but also,
- when C-Kermit is an Internet Server, to the corresponding commands given at
- the prompt. For example, if C-Kermit has been told to DISABLE RENAME, then
- it won't execute REMOTE RENAME commands in server mode, nor RENAME commands
- from its prompt. ckuusr.c, 17 Aug 98.
- Made DISABLE CD when inserver also SET { SEND, RECEIVE } PATHNAMES OFF.
- ckuus6.c, 17 Aug 98.
- Made wtmp entry always use at least 4 digits for the hex pid. ckufio.c,
- 17 Aug 98.
- Discovered that "set proto kermit {} {} {}" did not undo the "autosever"
- command string. This uncovered a rat's nest resulting from the fact that this
- string is not part of the regular protocol info struct, so I redefined the
- struct to include it and removed the special case from all modules that knew
- about it. ckcker.h, ckcmai.c, ckcpro.w, ckuus3.c, 18 Aug 98.
- The check in cmdlin() for command-line options not valid with -A was
- preventing "kermit" commands, when given at the prompt (e.g. the "kermit -r"
- autoupload string from a client), from working. Fixed in ckuusy.c, 18 Aug 98.
- Don't send auto-blah strings ("kermit -r", "kermit -x", etc) if we know the
- other Kermit is a server. ckcpro.w, 18 Aug 98.
- Set flow to NONE (except in VMS) for IKS. ckcmai.c, 18 Aug 98.
- Jeff's changes & fixes: ckcnet.h, ckcpro.w, ckcmai.c, ckutio.c, ckcnet.c,
- 19 Aug 98.
- Make ttol() and conol()/conoll() copy their arg before encrypting (ttol()
- already did) in case they are called with a literal string. Buffers are
- malloc'd only if/when needed; copy is done only when encrypting. ckutio.c,
- 19 Aug 98.
- Added partial ttpush() support to ckutio.c within #ifdef TTLEBUF..#endif.
- More pieces added by Jeff. ckutio.c, ckcnet.c, 19 Aug 98.
- Fixed spurious "?Packet log wasn't open" message when CLOSE command given
- with no operand. ckuusr.c, 19 Aug 98.
- Changed CLOSE command not to ask "OK to close?". Obviously the user knows a
- connection was open or she wouldn't be trying to close it. ckuusr.h,
- ckuus[r7].c, 19 Aug 98.
- REMOTE commands that only result in sending text to the client's screen can
- have no useful effect when issued from a remote-mode client when the result is
- not redirected. These commands include DIR, TYPE, WHO, etc, but not SET,
- ASSIGN, QUERY, etc. C-Kermit now refuses to execute REMOTE commands that
- can have no useful effect. ckuus7.c, 19 Aug 98.
- Due to confusion between console and communications buffers, made the
- following conxxx() functions route to the corresponding ttxxx() functions when
- (inserver && !local): conoc(), conxo(), conol(), conola(), conoll(), conchk(),
- coninc(), congks(). ckutio.c, 20 Aug 98.
- Adapted REMOTE HELP text to IKS. ckcfns.c, 20 Aug 98.
- When REMOTE LOGIN prompts for user ID & password, don't put them in the
- command recall buffer. ckuus7.c, 20 Aug 98.
- Got rid of LOGIN command, and made LOGOUT act locally rather than being a
- synonym for REMOTE LOGOUT. So: REMOTE LOGIN must be used to log in from a
- client to a server; REMOTE LOGOUT is used to log a client out from a server;
- and LOGOUT is used to log out the server from its prompt. ckuusr.c, 20 Aug 98.
- Added HELP LOGOUT and updated HELP REMOTE. ckuus2.c, 20 Aug 98.
- Removed #include "ckucmd.h" from ckcmai.c and ckutio.c. Added the struct
- keytab definition to ckcdeb.h, so all modules can use it without reference to
- ckucmd.h. 20 Aug 98.
- Got rid of getchar() calls from ckucmd.c, since they were not going thru the
- myread buffering, and therefore were wrecking decryption. ckucmd.c, 20 Aug 98.
- Fixes from Jeff: ckctel.h, ckucmd.c, ckutio.c, ckcmai.c, ckcnet.c, 21 Aug 98.
- Fixed a typo in tn_ini() that prevented client from sending initial Telnet
- negotiations on port 1649. ckcnet.c, 21 Aug 98.
- Added an "iksd" personality, which simply sets inserver to 1 automatically
- when the binary is called "iksd". ckcker.h, ckcmai.c, ckuus4.c, 21 Aug 98.
- Added extended-format command-line args for iksd:
- --anonymous:{on,off}
- --syslog:{on,off}
- --permissions:<octal-value> (like wuftpd -- permissions, not umask)
- --wtmp:{on,off}
- These are parsed in prescan(). Currently, *all* extended-format options are
- parsed in prescan. Later we'll need a way to separate those that are done
- in prescan from those that are done after the init file. Note: {on,off}
- also has synonyms {yes,no} and {true,false}. ckuusy.c, ckuus4.c, 21 Aug 98.
- From Jeff: fix a char declaration to be unsigned char to prevent sign
- extension, which was wrecking encryption: ckutio.c. Prevent encryption from
- being negotiated if Telnet authentication failed: ckcnet.c. Make all
- file i/o routines go through con/tt routines when the file is really the
- terminal, since the con/tt routines now take care of en/decryption, and
- bypassing them destroys the encryption stream: ckufio.c. 22 Aug 98.
- Updated the SunOS IKS makefile entry and renamed it to sunos41giks.
- This entry does not define CK_CURSES or link with the curses library.
- makefile, 22 Aug 98.
- Disable file-transfer display for IKS in such a way that tgetent() is never
- called by IKS, even if it is compiled in and even if the fullscreen file
- transfer display would normally be used. ckuusx.c, 22 Aug 98.
- Modified Jeff's changes to ckufio.c. The idea was to catch the case where
- the client was printing stuff on its "screen" coming back from the server in
- response to a REMOTE command. But in this case, the screen his hidden from
- the user anyway, so there is no point going through all the overhead of
- encrypting, then printing it -- now these routines simply discard the output
- but act as if they had printed it (in terms of return codes, global variables,
- etc). Left Jeff's code in the source file, commented out. ckufio.c, 22 Aug 98.
- Defined a new keyword flag, CM_PRE, to be used with long-form command-line
- options. If set, the option is to handled by prescan(), i.e. prior to init
- file processing; otherwise it is handled after the init file along with other
- command-line options. ckucmd.h, ckuus[4y].c, 22 Aug 98.
- Rules for long-form command-line options are:
- 1. All long-form options must begin with "--" (two hyphens) or "-+". If the
- option begins with "--" it is executed before or after the init file,
- according to its internal keyword flags. If it begins with "-+", it is
- executed before the init file, regardless of the flag bits. There is no
- way to force an argument to be executed after the init file if it has the
- CM_PRE bit set. (The "+" business will not necessarily be advertised...)
- 2. No spaces are allowed in the keyword.
- 3. If an operand contains spaces, it (or the entire option) must be quoted
- according to the rules of the shell from which Kermit is invoked.
- 4. Case doesn't matter in the option keyword (unlike with regular
- single-letter options).
- 5. If an operand is required, it must be included. If no operand is
- required, no operand must be included.
- 6. The operand follows the keyword, separated by a colon (:) or equal
- sign (=). There are no spaces between the separator and the keyword
- or operand.
- 7. Long-form option names may be abbreviated according to the same rules as
- interactive keywords.
- 8. On/Off operands can be On, Off, Yes, No, True, or False.
- 9. Long-form options are available only when the interactive command parser
- is built-in (i.e. not NOICP).
- Added code to actually use the new command-line options:
- --permissions are applied as given to anonymously uploaded files.
- --anonymous:off disables anonymous logins.
- --wtmp:off disables wtmp.
- syslogging still isn't being done, so no effect there. ckufio.c, 22 Aug 98.
- Discovered that permission-setting code works only if ATTRIBUTES ON, so
- anybody could defeat it by uploading files with SET ATTRIBUTES OFF.
- Rearranged the code to plug this loophole. ckufio.c, 22 Aug 98.
- After all this, it seems that all sorts of trouble ensues from prescan()
- being called twice; for example, "kermit commandfilename" no longer works.
- I have no idea why prescan() is called twice, so I commented out the second
- call, now all seems well. ckcmai.c, 22 Aug 98.
- Fleshed out the command-line options some more. Now they are:
- --anonymous on/off anonymous login allowed
- -+cdfile filename CD message filename
- -+cdmessage on/off CD messages on/off
- -+cdmsg on/off synonym for cdmessage
- --logsyslog on/off syslog logging on/off
- --logwtmp on/off wtmp logging on/off
- --permissions octalnum permissions for files uploaded anonymously
- --perms octalnum synonym for permissions
- --wtmpfile filename pathname of wtmp logfile
- Those shown with "-+" can be given by ordinary users. The CD message
- items correspond to SET SERVER CD-MESSAGE { ON, OFF, FILE <name> }.
- These all work except for syslog. ckuusy.c, 22 Aug 98.
- Minor corrections from Jeff to yesterday's changes: ckuusy.c, ckutio.c,
- 23 Aug 98.
- Added the appropriate #ifndef NOICP..#endif's to long-form command-line
- option code. ckuusy.c, 23 Aug 98.
- Finished the half-done IKS-related #ifdef section in ckcdeb.h, 23 Aug 98.
- Ensured that /pub/ftp/.kermrc is TAKEn as init file when user logs in to
- IKS anonymously. ckuus5.c, 23 Aug 98.
- Added --initfile:<path> to allow sysadmin to change the default init file
- for anonymous users. ckuusy.c, ckuus5.c, 23 Aug 98.
- Added MKDIR and RMDIR to list of functions automatically disabled for
- anonymous users (which previously included only MAIL and PRINT), since leaving
- them enabled clashed with wuftpd behavior (e.g. ftpd could not create a
- directory in kermit/incoming, but iksd could). It is still possible for the
- sysadmin to enable directory creation (and removal too). ckcmai.c, 23 Aug 98.
- Another loophole: OPEN WRITE / WRITE / CLOSE WRITE bypassed the
- --permission:xxx value. In fact, there are lots of file creation methods that
- did this: logs (even though we have disabled the LOG command), TRANSLATE, and
- REMOTE BLAH > file. And who knows what else. So I moved the chmod() code
- from zstime(), which is called only when receiving files with Kermit protocol,
- to zopeno(), which is called whenever *any* file is to be created. ckufio.c,
- 23 Aug 98.
- Don't let guests SET FILE COLLISION OVERWRITE or UPDATE (they already could
- not use RENAME or UPDATE). This prevents guests from overwriting or changing
- or destroying existing files. ckuus7.c, 23 Aug 98.
- Minor corrections to yesterday's work from Jeff, plus beginning of SSL
- support. ckuusy.c, ckcnet.c, etc, 24 Aug 98.
- If NOICP defined, then -A implies -x. ckuusy.c, 24 Aug 98.
- When client sends REMOTE LOGOUT and gets the ACK, it now closes the connection
- (same as it already did with BYE). ckuus7.c, 24 Aug 98.
- Added openlog() call for IKSD, specifying tag of "iksd" and LOG_PID, and going
- to the regular daemon log. Now syslogging works for regular logins, but the
- anonymous ones doen't seem to be making it into the log. To be continued.
- ckufio.c, 24 Aug 98.
- Verified that sending huge strings to the IKS (e.g. to the Username: or
- Password: prompt) does not break it. 26 Aug 98.
- Merged Jeff's recent changes, mostly for SSL / TLS. Many modules, 28 Aug 98.
- Made v(line) return ckgetpeer() value in IKS. ckuus4.c, 28 Aug 98.
- Fixed v(nday) not to depend on English day names. ckuus4.c, 28 Aug 98.
- Added --userfile:filename to command line for IKS: filename of forbidden
- user file. Fixed checkuser() routine, which was not working before.
- ckuusy.c, ckufio.c, 28 Aug 98.
- Added "ok" to list of valid extended option on/off value synonyms.
- ckuusy.c, 28 Aug 98.
- More SSL / TLS changes from Jeff, many modules, 29 Aug 98.
- Changes to extended command-line options:
- --logwtmp changed to --wtmplog (on/off)
- --logsyslog:on/off removed.
- --syslog:<number> added, where <number> = level of logging.
- So far this is parse-only, no action. ckcdeb.h, ckuusy.c, ckufio.c, 29 Aug 98.
- Added logging for commands (level 4). At first I logged all commands but that
- was WAY too much. Now only interactive commands (not TAKE files or macros).
- Also, cleaned up login/logout entries. ckufio.c, ckucmd.c, ckuusx.c,
- 29 Aug 98.
- Discovered that "implied partial dial", which occurs when you use the DIAL
- command but terminate the phone number with a semicolon, CONNECTs
- automatically when done at top level. Which is very confusing when you're
- dialing a numeric pager. Fixed in ckudia.c, 30 Aug 98.
- Automatically DISABLE ENABLE for anonymous users. ckcmai.c, 30 Aug 98.
- Added missing "extern" to telopt_states[] declaration in ckctel.h, 30 Aug 98.
- Spent many hours trying to figure out why syslogging does not work in iksd
- when user is logged in anonymously. It turns out that in SunOS, chroot(),
- once called, totally breaks syslog() -- i.e. syslog() will never write another
- entry after chroot() is called. It makes no difference whether openlog() is
- called before or after chroot(), or not at all. So is this a SunOS
- peculiarity? To test, went to build on Solaris (for the first time in months)
- and of course had all sorts of trouble compiling. Once it compiled, anonymous
- logins did not work because there is no /pub/ftp directory. So I temporarily
- dummied up a different root for testing, and then all worked OK. So it seems
- to be a SunOS peculariarity? There seems to be nothing I can do about it.
- Sent off a query to the sys folks. 30 Aug 98.
- Found that struct utmp member ut_host is not portable, so started building
- a pile of #ifdefs for when to include it. This will be an ongoing project.
- ckufio.c, 30 Aug 98.
- Added --root:xxx so an alternative root for anonymous users can be supplied
- at runtime. ckuus[5y].c, ckufio.c, 30 Aug 98.
- Started adding syslog() code for file creation / deletion / modification.
- File creation and appending in zopeno(). File deleting in zdelet().
- File renaming in zrename(). File copying in zcopy(). ckufio.c, 2 Sep 98.
- Fixed mutually reinforcing bugs in ttpeek() (ckutio.c) and the code in
- ckucns.c that calls it, that stopped CONNECT mode dead; ttpeek() wasn't
- taking the new local-echo buffer into account, so CONNECT would think there
- was nothing to read, when in fact some stuff was sitting in the new buffer,
- and so would block on a network read when in fact the network was waiting for
- a reply. Fixed 3 Sep 98.
- Fixes from Jeff for a Telnet negotiation problem in ckcnet.c and for an "=="
- that should have been an "=" in ckcfns.c (affecting the EOF/Ctrl-Z code).
- Also, revision of the C1 control symbols in ckcasc.h to avoid conflicts with
- new Microsoft symbols. 4 Sep 98.
- Enclosed reference to <asm/termios.h> for Linux-on-Alpha in #ifndef __GLIBC__
- to avoid yet another conflict. ckutio.c, 4 Sep 98.
- Microsoft added upper- and lowercase Z caron to CP1252. I added these to the
- CP1252/Unicode translations, and also corrected a typo in the translation of
- the 'oe' character from Unicode to CP1252. ckuouni.c, 4 Sep 98.
- Changes from Jeff. Protect SET FILE DISPLAY FULL tgetent() from trapping if
- trmbuf not allocated: ckuus[7x].c; server-side terminal type negotiation:
- ckcnet.c, 5 Sep 98.
- Fixed a bug that limited the LOCAL command to only 10 variables, even though
- the advertised maximum was 64. dolocal(), ckuus5.c, 5 Sep 98.
- Added a check for sequence number out of range to ttinl(). See comments in
- source code for a detailed explanation. ckutio.c, 5 Sep 98.
- VMS cdate[] array declaration, used for setting file date, needed to be 24,
- not 23. ckvfio.c, 5 Sep 98.
- For DEC C (VMS or Digital UNIX), when _POSIX_C_SOURCE is not defined, #define
- it with a value, such as 1, rather than without one, since its value is used
- in comparisons in DEC C header files like unistd.h. ckcdeb.h, 5 Sep 98.
- Various mysterious problems with SEND /AS-NAME: were traced to the keywords
- in sndtab[] being out of alphabetical order. Fixed in ckuusr.c, 5 Sep 98.
- However, some additional problems remained, in which certain switches were not
- parsed successfully if COMMAND QUOTING was OFF and they were entered without
- completion (Tab or Esc). This was due to failure to set the field length in
- one of the paths through cmkey2(). Fixed in ckucmd.c, 5 Sep 98.
- Changes from Jeff to start supporting an overhauled way of setting/showing
- Telnet options. Many modules, 8 Sep 98.
- Added "OE compliance" -- Latin-9 conversion for DEC MCS and NeXT, which both
- contain OE characters. ckuxla.c, 8 Sep 98. (I could do the same for DG, but
- I doubt anyone would notice.) (Ditto for Macintosh.)
- Changed protocol machine to take connection loss in response to a BYE command
- (while waiting for the ACK) as success rather than failure. ckcpro.w, 8 Sep 98.
- Preliminary code for dynamic Telnet-wait timer from Jeff. ckcnet.c, 9 Sep 98.
- Removed "if (srvbuf)" from setlin() routine, since srvbuf is an array, not a
- pointer, and this crashes the ICL compiler. ckuus7.c, 9 Sep 98.
- Added GETKEYCODE <var> <prompt> for K95. Lets user get the keycode of any
- key event (F-key, Alt-combination, etc) into a variable. Also changed GETC
- to put console in raw mode to read the one character, so any character at all
- can be typed, even Ctrl-C, after which we go back to CBREAK mode. Needs
- testing. ckuusr.[ch], ckuus6.c, 9 Sep 98.
- Changed the way the MODEM ESCAPE-CHARACTER is specified and used:
- < 0 means the escape mechanism is disabled.
- = 0 means to use (restore) the default value from the modem database.
- > 0 and < 128 is a literal value to be used instead of the default one.
- > 127 means the escape mechanism is disabled.
- This affects "modem hangup". When the escape mechanism is disabled, but SET
- MODEM HANGUP-METHOD is MODEM-COMMAND, it sends the hangup command immediately,
- without the <pause>+++<pause> business first. This is useful (for example)
- when sending lots of numeric pages, a process in which we never go online, and
- so never need to escape back. Eliminating the unnecessary pauses and escape
- sequence allows a lot more pages to be sent per unit time. Needs testing.
- ckudia.c, 9 Sep 98.
- In order to test modem, dial, and serial port items, tried building on HP-UX
- 10.20 for the first time in months. Compiled OK (!) but failed to find
- sete[ug]id() at link time. Made it use setre[ug]id() instead. Obviously this
- area will need a lot more attention since we don't want to mess up when
- logging in IKS users... Needs testing. ckufio.c, 9 Sep 98.
- Changes from Jeff to show a spinner during telnet negotiation wait, to reorder
- the terminal-type negotiation list, and to check for failure of tn_ini(), e.g.
- when connection rejected by TCP Wrappers. ckuusr.[ch], ckuus7.c, ckcnet.c,
- 10 Sep 98.
- Some #ifdefs to allow compilation on ICL DRS/NX, plus adjustments to the ICL
- makefile entries. ckcmai.c, makefile, 10 Sep 98.
- Somehow a DECC Alpha VMS build is picking up both the bzero/bcopy macro
- definitions AND the prototypes for bzero() and bcopy(). Added #ifdefs to
- prevent this. ckcnet.h, 10 Sep 98.
- Added *.pdf to default binary-patterns list. ckcmai.c, 11 Sep 98.
- Changed the main Linux build to #define CK_NCURSES, which in turn #include's
- <ncurses.h> rather than <curses.h>, and links with libncurses rather than
- libcurses, since newer Linux systems seem to lack symlinks from curses to
- ncurses, and added a "linuxc" entry that still references curses. However,
- neither curses.h nor ncurses.h can be found on the Red Hat 5.1 system I have
- access to. makefile, ckcdeb.h, ckuusx.c, 12 Sep 98.
- Building on Linux 1.2 (some old Red Hat version, not sure of the number),
- complained of a syntax error in <syslog.h>:
- /usr/include/sys/syslog.h:189: unrecognized format specifier for `'
- Building again with -DNOSYSLOG moves the problem to ncurses.h. The problem
- is that both of these header files refer to "printf" in macro definitions, but
- (in UNIX) we have defined printf to be a macro that expands to "ckxprintf".
- Thus, before including any headers that refer to printf, we have to #undef
- printf, and then redefine it afterwards. YUK!!! ckucmd.c, ckuusx.c,
- ckufio.c, 12 Sep 98. NOTE: In the future, we should add a new header file,
- which is to be included in each module AFTER ALL OTHER header files, to undo
- whatever the earlier headers might have done, and to define macros that
- substitute homegrown routines for library routines or system calls, so we
- don't have to remember to insert little undef...redef clauses around #includes
- all over the place.
- Back to Linux 2.0.34... The logwtmp() declaration blew up the compiler,
- needed ANSIfication. ckufio.c, 12 Sep 98.
- With the fixes above, and using a new "linuxnc" (no-curses) makefile entry,
- we still fail in the link step because the crypt() routine can't be
- found. Digging through the libraries shows it has moved from libc to
- libcrypt. Swell, so we need yet another makefile entry, linuxlcnc ("link
- with libcrypt, no curses"). So now it builds on Red Hat 5.1, kernel 2.0.34,
- but without curses support. makefile, 12 Sep 98.
- Noticed that the code contained various #ifdef LINUX constructions, but
- LINUX was never defined anywhere. Added a clause to ckcdeb.h to define
- LINUX if it was not defined but __linux__ was defined, and also added
- -DLINUX to all Linux entries. makefile, ckcdeb.h, 12 Sep 98.
- Defined -DDYNAMIC by default for all UNIX builds, and removed it from all
- makefile entries that included it. ckcdeb.h, makefile, 12 Sep 98.
- Found that Linux keeps its wtmp file in a different place than other UNIXes.
- Adjusted via #ifdefs. ckufio.c, 12 Sep 98.
- Found that UNIX ttinl() still had one or two return points where it failed to
- turn off its alarm(), due to recent changes, and of course whenever that
- happened, the alarm would eventually go off, crashing the program. Fixed in
- ckutio.c, 12 Sep 98.
- Put Telnet-wait "spinner" display code in #ifdef CKSPINNER, and left it
- undef'd, put back the regular dots. The spinner is not good for speech
- devices, scripts, etc, and is unlike anything else in C-Kermit's user
- interface, and also wouldn't look right when viewed through any terminal or
- emulator using an NRC. ckcnet.c, 12 Sep 98.
- Defined KANJI by default if NOCSETS not defined and NOKANJI not defined; same
- as for all other character-set families (Latin-1, Latin-2, Greek, Hebrew,
- Cyrillic): ckcxla.h. Removed all explicit #defines for KANJI from ckcdeb.h
- and makefile. 13 Sep 98.
- Made some adjustments to the ex-spinner code so it doesn't spurt out a burst
- of dots, but only prints one every second (i.e. when there is a timeout), and
- labeled this section "Negotiations:" and put "(OK)" at end, like in the DNS
- section. Also, made this section disablable via SET QUIET ON, like the other
- sections. ckcnet.c, 13 Sep 98
- In an effort to handle the /dev/modem problem in Linux, and the
- lockfile-versus-symlink problem in general, added code to ttlock() to see if
- device name is a symlink. If so, islink is set to nonzero and linkto[] (yet
- another static buffer) contains the name pointed to by the symlink. Using
- stat() and then S_ISLNK() does not work on some platforms, so instead we
- always just call readlink(), which fails if it is not a link, but returns the
- file's real name if it is. If device name is a link we create a second
- lockfile, which is a link to the first one, but based on the device's real
- name. The second lockfile is removed in ttunlk(). This code works everywhere
- but in systems that use ttlock() (currently only AIX) and HP-UX, which has its
- own dual-locking system. All the symlink/readlink related code is #ifdef
- CKSYMLINK, so it can be disabled on platforms that don't have readlink(), or
- where it doesn't work. ckutio.c, 13 Sep 98.
- After yet another prolonged discussion of lockfile names for SCO... The
- concensus of the experts is that the device name should be lowercased for
- creating the lockfile, and this is how it was already. However, Dmitri
- Zuryanovich reports from Russia that this is not consistent with mgetty.
- Example: "set line /dev/tty1A" creates LCK..tty1a, and while cu and friends
- follow the same convention, mgetty creates and checks for LCK..tty1A. So,
- piggybacking onto the previous item, if the given device name is not a
- symlink, I pretend that the original name is a symlink. Then, after
- lowercasing the name, if the result is different from the original, I keep the
- original name as the basis for the second lockfile, otherwise I create only
- one lockfile as before. If a second lockfile is created, it is deleted
- automatically at the same time the first one is. The possible pitfall here,
- of course, is that there might actually be a distinct device with
- corresponding lowercase name. But since that was the name we always used for
- the lockfile anyway, this change can't possibly do any additional harm.
- ttlock(), ckutio.c, 13 Sep 98.
- Changed "show comm" to report any secondary lockfile. ckuus4.c, 13 Sep 98.
- Discovered that when SET MODEM HANGUP-METHOD is MODEM-COMMAND, that if a
- HANGUP command is given before a DIAL command was given, it doesn't use the
- modem hangup command. Fixed in mdmhup(), ckudia.c, 13 Sep 98.
- Discovered that MODEM HANGUP-METHOD is not displayed by SHOW MODEM. Fixed in
- ckuus3.c, 13 Sep 98.
- Verified that SET MODEM SPEED-MATCHING works correctly. The confusion comes
- when users SET MODEM TYPE HAYES (2400 or 1200) to dial a more modern type of
- modem -- Kermit automatically SETs MODEM SPEED-MATCHING ON, as it must for any
- kind of modem that does not do speed buffering. Let's keep this in mind when
- explaining how to write alpha pager scripts.
- Increased character spacing for Rolm DCM dialing from 5 msec to 50, since
- some failures had been observed. Seems to work fine for both Rolm DCM and
- 600-Series AT-dialing. ckudia.c, 13 Sep 98.
- Found that starting a phone number with "=", which is supposed to indicate
- a literal string to be dialed, was no longer stripping off the "=" before
- dialing the string. Fixed in dodial(), ckuus6.c, 13 Sep 98.
- From Jeff: Enabled CKSPINNER for K95 and adjusted spinner-vs-dots code.
- ckcdeb.h, ckcnet.c, 14 Sep 98.
- The SET LINE / SET HOST command was printing an annoying blank line. Fixed in
- gtword() by disabling echo not only if reading from chars already in command
- buf, but also if reading a pushc'd character. ckucmd.c, 14 Sep 98.
- Fixed a reference to a null pointer in mdmhup(), from Jeff. ckudia.c,
- 14 Sep 98.
- Fixed dohexdump() prototypes to avoid ANSI complaints. ckcdeb.h, 14 Sep 98.
- Added assorted casts in tn_doop() to shut up ANSI complaints. ckcnet.c,
- 14 Sep 98.
- Verified that IKSD writes just fine to syslog() on Solaris 5.1, even after
- chroot(). So the problem with syslog() entries disappearing into the void
- after chroot() is not universal, and perhaps might be peculiar to SunOS.
- We'll see...
- Added --syslog:5 (debugging) support. Automatically opens debug log and
- writes debug records to syslog. ckuus[xy].c, 15 Sep 98.
- Added code to turn off syslogging around login/password dialog, so user ID
- and Password are not entered in logs for levels 4 and 5 (commands and debug).
- this change does not affect the secure entry of Authentication info at syslog
- level 1. ckuus7.c, 15 Sep 98.
- Added a system-independent syslogging routine to UNIX C-Kermit:
- cksyslog(int,char *,char *,char *). This needs to be added to any other
- ck?fio.c module for builds in which CKSYSLOG is defined. It allows the system
- independent modules to call the syslogging function without using system
- dependent code, and (at least in the UNIX case) isolates the #ifdef printf
- craziness to one place. ckcdeb.h, ckuusx.c, ckucmd.c, ckufio.c, 15 Sep 98.
- Added incoming server commands to level 4 syslogging. ckcpro.w, 15 Sep 98.
- Changed default prompt to say IKSD rather than C-Kermit or K-95 (etc) when
- running as IKSD. Also changed default UNIX prompt to show current directory
- in parens rather than brackets since brackets don't show up right if an NRC
- is in use. ckuus5.c, 15 Sep 98.
- Made the syslog messages a bit more consistent:
- login: user host
- login: anonymous host password
- logout: user host
- command: text <-- Should these also include user
- server: text <-- and host? (They do include the
- file[n] name: text <-- PID, but PIDs can wrap...)
- ckufio.c, 15 Sep 98.
- Logging commands currently has the failing that the result (success or
- failure) is not shown. Tried moving the logging point from cmcfm() to the
- top of the parse loop, and logging the contents of cmdbuf[] (which should
- contain the previous command) and the success variable (which applies to the
- previous command), but by that time too many things have might have happened
- to the command buffer. So for now we'll leave it as is.
- Found a double-ended bug in the READ command, potentially affecting all
- versions, but only showing up in the VMS version: the zsinl() function
- properly returned -1 on EOF, but the READ command code (too) cleverly ignored
- the return code if there was also something in the buffer (to allow reading a
- final line that lacked a terminator). But if the buffer was not cleared
- prior to trying to read, the final line would be read successfully forever.
- Fixed at both ends. ckufio.c, ckvfio.c, ckuus5.c, 16 Sep 98.
- Added a new level of syslogging: 5 = commands from macros or files. Debug
- level moved up to 6. ckcdeb.h, ckuusy.c, 16 Sep 98.
- Added an optional and separate iksd log. Opened in zvpass() prior to
- chroot(), so works for anonymous logins even on SunOS. Writes its record in
- zclose(). Format is exactly the same as wu-ftpd, except instead of "ftp" it
- says "iks" in the 11th field. A couple items still need to be fixed, and
- format of the log needs to be documented. Also, I need to test if iksd can
- share the actual ftpd.log with wu-ftp. ckuusy.c, ckufio.c, 16 Sep 98.
- Sequence-number out-of-range check added to ttinl() on 5 Sep 98 was looking
- at the wrong field, spotted by Jeff. Fixed in ckutio.c, 17 Sep 98.
- Added original file-system root to beginning of fullname[] in iksdlog when
- user is anonymous and therefore chroot'd, so complete filespec is logged.
- Also fixed elapsed-time field, which previously always registered 0. Also
- fixed the i/o field, which had reverse sense. ckufio.c, 17 Sep 98.
- Verified that iksd can log to the same file as ftpd. However, I noticed that
- ftpd does not log transfers by real users, and also that it does not show
- the full filespec. I commented out the code that adds the chroot path to the
- filespec since ftpd doesn't show the full real path, and the object is to stay
- compatible. ckufio.c, 17 Sep 98.
- Changes from Jeff mainly for new SET TELOPT command. ckuus3.c, ckuusr.h,
- etc., 18 Sep 98.
- Supplied missing */ from comment in ckuusr.h. 18 Sep 98.
- Fixed various other preprocessor syntax errors. ckcfns.c, ckuus6.c, 18 Sep 98.
- Discovered that {get,end}usershell() is not portable. So #ifdef City has
- another population explosion... ckcdeb.h, ckufio.c, 18 Sep 98.
- Disabled DELETE command for guests. ckuus[r67].c, ckufio.c, 18 Sep 98.
- RENAME is the only file collision option that is safe for guests to use. All
- the others destroy or rename or alter existing files. Added code to enforce
- this. FILE COLLISION RENAME is set at anonymous login time and the SET FILE
- COLLISION command is disabled for guests. Also the server rejects any REMOTE
- SET FILE COLLISION commands. ckcfns.c, ckuus7.c, 18 Sep 98.
- Fixed DISABLE DELETE to also set FILE COLLISION to RENAME and to disable the
- SET FILE COLLISION command. ckuus[67].c, 18 Sep 98.
- Fixed COPY command to check if destination file already exists and if so
- to fail if DELETE is DISABLEd or if user is anonymous. ckuus6.c, 18 Sep 98.
- Made snddir() and snddel() return 0 upon failure to do their jobs (as now),
- or -1 if the given filespec did not match any existing files (new). ckcnfs.c,
- 18 Sep 98.
- Made protocol module send Error packet if REMOTE DELETE or REMOTE DIRECTORY
- was executed on a filespec that could not be found, thus causing the client
- command to fail rather than succeed, to match the reasonable expectations of
- users. ckcpro.w, 18 Sep 98.
- Made COPY command enforce one-file restriction; no wildcards. It already
- did this in K95. ckuus6.c, 18 Sep 98.
- Don't allow changing of protocol to anything but Kermit in IKSD. ckuus3.c,
- ckcfn2.c, 18 Sep 98.
- Added provision for NOIKSD at compile time, which defines all the appropriate
- NOblah symbols to disable IKSD-specific code. If NOIKSD is not defined, IKSD
- is defined automatically (but currently not used for anything). ckcdeb.h,
- 18 Sep 98.
- Changes to SET TELOPT parsing from Jeff, ckuus3.c, 21 Sep 98.
- Added TYPE /PAGE (and /NOPAGE). /PAGE forces askmore() prompting. /NOPAGE
- disables it. Default (if no switch given) is according to the current COMMAND
- MORE-PROMPTING setting. Prevailing setting is undisturbed by switches, and
- is restored automatically if the TYPE command is interrupted with SIGINT.
- ckuusr.h, ckuus[r56x].c, 21 Sep 98.
- Added --bannerfile:filename, which tells the herald() routine to print the
- contents of the given file, rather than what it normally prints. Uses more-
- prompting (i.e. works like TYPE /PAGE). For use with IKSD, but can also be
- used in regular C-Kermit. ckuus[56x].c, 21 Sep 98.
- Fixed herald() to put console in cbreak mode before calling askmore().
- ckuus5.c, 22 Sep 98.
- Added --help, which lists the available extended command-line options.
- ckuusy.c, 22 Sep 98.
- Added HELP EXTENDED-OPTIONS, which is like HELP OPTIONS, but for the extended
- ones (and also is like --help, but with more-prompting). Also added a pointer
- from HELP OPTIONS to HELP EXTENDED. Also added a very brief HELP IKSD.
- ckuusr.[ch], ckuus2.c, 22 Sep 98.
- Added SHOW EXTENDED-OPTIONS, but left it invisible since it's pretty much only
- for IKSD sysadmins to check their command lines before going into production.
- If an IKSD client user stumbles on it, it won't show them any IKSD-specific
- options, only the innocuous ones. ckuusr.h, ckuus[r5].c, 22 Sep 98.
- Prevented access to command-line argument vector via &@[] array to IKSD
- users. There is no reason they would need to see the command line, and every
- reason why they shouldn't. cmdini(), ckuus5.c, 22 Sep 98.
- Added brief synopsis of each command to REMOTE HELP text. ckcfns.c, 23 Sep 98.
- Added a #define for zfnqfp() to strncpy() when ZFNQFP is not defined, so we
- don't have to guard every reference to zfnqfp() with #ifdefs. ckcdeb.h plus
- many modules, 23 Sep 98.
- Changed all --blah:<filename> options to expand the filename before storing
- it, except --cdfile, which is normally relative. ckuusy.c, 23 Sep 98.
- Added --helpfile:<filename> to allow a custom file to be substituted for the
- top-level HELP text. Can be any length, using more-prompting by default.
- Also works for regular non-IKSD Kermit sessions. ckuusr.h, ckuus[y25].c.,
- 23 Sep 98.
- Added --cdmsg:n, n > 1, to mean CD message should also be displayed when CD
- (but not BACK) command given at prompt. Set it to 2 automatically when -A
- given on command line. Uses "type /page". Works in non-IKSD Kermit sessions.
- ckuus[5y].c, 23 Sep 98.
- Fixed makelist() to allow recyclying of list. ckuusr.c, 23 Sep 98.
- Changed --cdfile:<name> to also accept a list of filenames in the standard
- C-Kermit format for lists: --cdfile:{{file1}{file2}...{filen}}, up to 8.
- And changed SHOW { SERVER, EXTENDED-OPTIONS } to show CD message-file list.
- ckcmai.c, ckcfns.c, ckcpro.w, ckuus[35y].c, 23 Sep 98.
- Changed default CD message file from a single filename to a list. ckcker.h,
- ckcmai.c, 23 Sep 98.
- Added SET CD MESSAGE { ON, OFF, FILE <list> }, like SET SERVER CD-MESSAGE, but
- applies to command mode rather than server mode. Also added SET CD PATH to
- allow the CD PATH to be set from within C-Kermit. Note that SET SERVER
- CD-MESSAGE FILE and SET CD MESSAGE FILE do exactly the same thing, and one
- does (and undoes) the other. However, SET CD MESSAGE { ON, OFF } and SET
- SERVER CD-MESSAGE { ON, OFF } are separate. ckuus3.c, ckuusr.h, 23 Sep 98.
- Added SHOW CD. Shows current directory, previous dir, cd path, cd message,
- server cd-message, and cd message file. ckuusr.h, ckuus[r5].c, 23 Sep 98.
- Added HELP SET CD and updated HELP SET SERVER, HELP CD, and HELP TYPE.
- ckuus2.c, 23 Sep 98.
- Added a "-7" command-line option. This is approximately equivalent to -A,
- except without the login phase, chroot(), etc, so it is for use by ordinary
- users who are already logged in, rather than as a daemon. It just sets
- sstelnet = 1, thus enabling server-side Telnet negotiation, substitute printf,
- etc. Works OK if run redirected under another Kermit that accepts the
- incoming connection, but needs additional work to allow:
- kermit -7 -J * 3000
- to allow a single copy of Kermit to be started in such a way that it accepts
- an incoming Telnet connection and then presents a command prompt to the Telnet
- client. ckuus[47].c, ckcmai.c, ckutio.c, 23 Sep 98.
- Updated HELP SET CD PATH text to account for platform differences. ckuus2.c,
- 24 Sep 98.
- Changes from Jeff, mainly for automatically setting default protocol for
- different sockets in SET HOST / TELNET. ckcnet.[ch], ckuus7.c, 24 Sep 98.
- Changes from Jeff, 1 Oct 98:
- . Add SET SESSION-LOG for K95: ckcker.h, ckuusr.c. makefile, ckuusx.c
- Default is binary for K95, text for UNIX, etc.
- . Added DEBUG session-log type: ckuus3.c.
- . Some reorganization of SSL selection code: ckuus3.c.
- . Add SSL support: ckucns.c, ckutio.c.
- . Add NTVT emulation: ckuusr.h, ckuus7.c.
- . Add NTVT unknown authorization method: ckctel.h.
- . Various updates to authentication code: ckcnet.c.
- . Clarifying comments added about CP1258 -- it's for Viet Nam: ckouni.c.
- Reformatted ckouni.c to not have long lines, 1 Oct 98.
- Changes from Jeff, 19 Oct 98:
- . SET TERM PRINT
- . Additional of NTVT and SSL authentication types
- . Assorted minor corrections
- Some minor corrections from Jeff: ckuus[5x].c, 20 Oct 98.
- Added RESET command; closes all open files and logs. Probably could do some
- other things too... ckuusr.h, ckuus[rx].c, ckcker.h, ckcpro.w, 20 Oct 98.
- Moved logchar() from cku{con,cns}.c to ckuusx.c, and added logstr() (but
- it's not called from anywhere). These might need #ifdefs for K95.
- Prototypes in ckcker.h. 20 Oct 98.
- It has always bugged me that Kermit could not automatically switch to an
- appropriate character set when receiving a file whose transfer character-set
- is announced. With IKSD, this is no longer just a convenience, but a
- necessity. So...
- . Added initcsets() to initialize charset associations. These are done in
- a way appropriate to each system with #ifdefs. initcsets() is called at
- program startup (after sysinit()). ckcker.h, ckcmai.c, ckuxla.c, 20 Oct 98.
- . Added ASSOCIATE XFER/FILE-CHARACTER-SETS command. ckuusr.[ch], 20 Oct 98.
- . Added SET { SEND, RECEIVE } CHARACTER-SET-SELECTION { AUTO, MANUAL }.
- ckuusr.h, ckuus7.c, 20 Oct 98.
- . Added S/R CHAR setting to SHOW CHARACTER-SETS. ckuus4.c, 20 Oct 98.
- . Added SHOW ASSOCIATIONS separately, since there was no good way to put it
- in SHOW CHARACTER-SETS with more-prompting, since SHO CHAR is split between
- modules. (We need a better method of handling more-prompting!) ckuusr.h,
- ckuus[45].c, 20 Oct 98.
- . Changed Attribute-packet handler to automatically switch file character-set
- according to incoming transfer charset announcer if RECEIVE CHAR AUTO. The
- original setting is saved and restored around file transfer and/or keyboard
- interruption. ckcfn3.c, ckuusx.c, 20 Oct 98.
- . SET FILE CHARACTER-SET blah now automatically sets the transfer charset
- if SEND CHAR is AUTO. It set it before too, but using 70+ lines of ugly
- code, now replaced by 2 lines of pretty code. ckuus7.c, 20 Oct 98.
- . SET XFER CHARACTER-SET blah now automatically sets the file charset from
- the associations table if SEND CHAR is AUTO. ckuus3.c, 20 Oct 98.
- . Added help text for the new commands. ckuus2.c, 20 Oct 98.
- . Fixed a bug that kept the transfer character-set from showing up in
- transaction log entries for received files. ckcfn3.c, 20 Oct 98.
- . Fixed the descriptive names that are common to fcsinfo[] and tcsinfo[]
- to be in the same format, and also renamed code pages from "IBM Code Page"
- to "PC Code Page". ckuxla.c, 20 Oct 98.
- So now a user, when receiving a file in text mode that comes with a charset
- announcer will automatically get a reasonable translation. And when users who
- are about to send a file give either a SET FILE or SET TRANSFER CHARACTER-SET
- command, the other is set accordingly. The defaults should be entirely
- appropriate (and of course can be changed with the ASSOCIATE command), so now
- C-Kermit and K95 should almost always "do the right thing" as long as the
- sender properly identifies the file character-set of the source file. And in
- fact, this happens by default in K95, since it gets the current code page at
- startup and makes this the file character-set value. Unfortunately there is
- no good (or at least remotely portable) way to do the same in Unix.
- From Jeff: Deployment of logstr() in many modules. 21 Oct 98.
- Added bounds checking to auto charset switch in gattr(). ckcfn3.c, 21 Oct 98.
- Ditto for SET XFER CHARACTER-SET. ckuus3.c, 21 Oct 98.
- Ditto for SET FILE CHARACTER-SET. ckuus7.c, 21 Oct 98.
- Fixed ?-help messages for ASSOCIATE command. ckuusr.c, 21 Oct 98.
- Some changes from Jeff to SSL option setting commands. ckuus3.c, 22 Oct 98.
- Added { RECEIVE, GET, MGET } /EXCEPT:<list>. If a file arrives whose name
- matches any name in the exception list, it is rejected using the attribute
- refusal mechanism, reason: name. This does not use the O-packet exception
- list mechanism; it is done purely on the client side; thus it can work with
- current/older Kermit programs on the other end. It does, however, require
- A-packets to be negotiated and in use, since this is the only way we have of
- rejecting a file within a group without cancelling the entire transfer. But
- that's true of the collision-based and other refusals too. ckuus[26].c,
- ckcfn[s2].c, 22 Oct 98. Later, once C-Kermit 7.0 servers are prevalent, we
- can convert to using the more graceful O-packet method.
- Various minor fixes to transaction log format. ckcfn[s2].c, 22 Oct 98.
- Inclusion of extended-format command-line options (like --helpfile:blah)
- caused command-line parser to skip the next option, oops. Fixed in ckuusy.c.
- Also fixed command-line error message to print actual program name, not
- hardwired text. 22 Oct 98.
- Previously the wuftpd-like log, enabled by --iksdlog:1 --iksdfile:name, was
- available only to the iksd. I rearranged the code to allow regular user-mode
- C-Kermit to use this too, and renamed the options (and corresponding
- variables) to xferlog and xferfile. UNIX only. ckuusy.c, ckufio.c,
- 22 Oct 98.
- Added SET TRANSACTION-LOG FTP (it already had BRIEF and VERBOSE options) to
- let the ftpd-like log be selected by command. UNIX only. This bypasses the
- regular transaction-log mechanisms, but that's not visible to the user. It's
- hooked into SHOW LOG via special code. ckuus[35].c, 22 Oct 98.
- Fixed FTP log format -- two of the fields were switched. Also put the actual
- username in the username field in the non-IKSD case. And put the connection
- name (network host or serial device name) in the clienthost field for the
- non-IKSD case. ckufio.c, 23 Oct 98.
- Made LOG TRANSACTIONS default disposition be APPEND when using the FTP-format
- log, for compatibility with the ftp log. ckuus4.c, 23 Oct 98.
- Substituted built-in code for zshcmd() in UNIX zcopy(), because the zshcmd()
- version can't be used in IKSD. It works, but it's not finished -- need to add
- informative error returns (see ckcplm.txt), do all the checks that cp does
- (e.g. source file is a directory, whether it's ok to overwrite existing files,
- etc), and fix up permissions afterwards, e.g. to carry forward the execute
- bit. Will finish after the weekend. ckufio.c, 23 Oct 98.
- Discovered that UNIX zxpand() wrote into its argument (e.g. when concatenating
- "/*" to a directory name). It's been this way forever, and obviously could
- have resulted in countless horrible consequences. Fixed it to make a safe
- copy first. ckufio.c, 25 Oct 98.
- Discovered that RENAME did not work when the source file was a directory.
- This was due to a deficiency in cmifi2(), which did not allow for the case in
- which the argument "d" was nonzero (meaning "parse files or directories"), but
- the argument "dirflg" was 0 (meaning "not directories-only"). Fixed in
- ckucmd.c, 25 Oct 98.
- Fixed UNIX zcopy() to:
- . Check for source file is a directory / is wild / etc.
- . Check for source file == destination file by comparing their inodes.
- This works even for symlinks.
- . Allow destination file to be a directory, in which case the source file
- is copied into it.
- . Overwrite existing destination file if its permission allows.
- . Set new file's permission according to umask but also carry forward
- the source file's exececute permission bits (but this only works if the
- destination file did not already exist -- this appears to be a property
- of UNIX open()).
- . Fail if interrupted by Ctrl-C.
- . Return standardized error codes (listed in ckcplm.txt).
- ckufio.c, 25 Oct 98.
- Fixed COPY command to:
- . Not allow a directory as the source file (give a parser error and fail).
- . Not allow wildcards (ditto).
- . Print error messages appropriate to zcopy() return code.
- ckuus6.c, 25 Oct 98.
- Made sure server end of REMOTE COPY and REMOTE RENAME work with new code
- (they do), which was the main reason for doing all this. Added checks within
- zcopy() and zrename() themselves against being called by IKSD guests.
- ckufio.c, 25 Oct 98.
- Problem: REMOTE HOST blah will time out and fail if the "blah" command takes
- too long to finish and/or to produce output. Ditto for sending from a pipe.
- zinfill() in this case needs a way to time out when reading from a process,
- which can be done (in UNIX) with select(). Since all the hairy
- select()-related #ifdefs, etc, are in ckutio.c, I added a new routine there,
- ttwait(fd,secs), to wait the given number of seconds for data to become
- available on the given file descriptor. zinfill() calls ttwait() when it
- knows it is reading from a pipe, and it works fine (at least in SunOS). Now
- the trick will be to interface this mechanism with the file transfer code:
- . What should the timeout be? Well, these days we have no idea what the
- other Kermit's timeout interval is, because it might be dynamic. For
- starters, it might be OK to hardwire this to 1 second. After all, neither
- Kermit program is doing anything anyway if no output is arriving from the
- pipe, so why not give them something to do?
- . How to return timeout condition? Have zinfill() return a unique negative
- number (-3 is currently not used), and then make sure everybody else along
- the way knows what it means.
- . Who are the clients of zinfill()? It is called only through the zminchar()
- macro. zminchar(), in turn, is called by: kgetf() (Kanji file-transfer),
- bgetpkt(), getpkt(), transmit(), xlate(), fcommand(), and dotype(). Of
- these, [b]getpkt() and fcommand() might be reading from a pipe, but
- timeouts are important only during file transfer, so we can ignore
- everything but [b]getpkt().
- This means that zinfill() should call ttwait() only when Kermit protocol is
- active. We can test this with a new variable, kactive: ckuusx.c, ckcpro.w,
- ckufio.c, 25 Oct 98.
- zinfill(), upon timeout, returns -3 to [b]getpkt(), which passes -2 up to its
- caller, sdata(). If sdata() gets this, it simply sends an empty data packet
- (for testing, it sends a data packet containing a dot). ckcfns.c, 25 Oct 98.
- It works, but will need a lot of testing and refinement (for example, a packet
- log shows that after a bunch of timeouts, when the output first appears, a
- NUL is inserted into the data stream). As far as non-UNIX versions go, this
- is strictly an matter of making their versions of zinfill() return -3 on
- timeout.
- The spurious NUL at the beginning of the data packet was caused by the now
- invalid assumption that getpkt() will always either read a character or get an
- EOF indication. Since it does at-least-one-character lookahead, it uses the
- "first == 1" as an indicator that there was no previous character, and sets
- first = 0 the first time through. But if the first time through it gets a
- timeout from zinfill(), the first flag should be left alone. Now the first
- flag is unset only when zinfill() returns an actual character. [b]getpkt():
- ckufio.c, 26 Oct 98.
- The second bad assumption was that timeouts would only occur at the beginning;
- in fact, they can happen anywhere, any number of times. Juggling the code to
- make sure getpkt() returns partial packets upon timeouts reveals that once
- some data is returned by zinfill(), no further timeouts occur. That's
- because fread() is called with INBUFSIZE, and so it blocks until the buffer
- is filled or EOF is encountered. But for the new code to work, it has to
- read only what is there, without blocking. So I made the input file pointer
- for pipes (in zxcmd()) nonblocking, and then adjusted zinfill() and getpkt()
- to behave appropriately. It's still not perfect, but it's getting close.
- ckufio.c, ckcfns.c, 26 Oct 98.
- Fixed a bug in yesterday's changes that broke the case where timeouts occurred
- before any data had been read. getpkt(): ckcfns.c, 27 Oct 98.
- Migrated all getpkt() changes to bgetpkt(). ckcfns.c, 27 Oct 98.
- Tested the following successfully:
- . remote host echo foo
- . remote host sleep 5;echo foo
- . remote host sleep 5;echo foo;sleep 5
- . remote host sleep 5;echo foo;sleep 5;echo bar
- . remote host echo foo;sleep 5;echo bar;sleep 5
- . remote host echo foo;sleep 5;echo bar;sleep 5;echo baz
- . (etc)
- BUG: GET /BIN does not force the server to send in binary mode. Diagnosis:
- Due to changes to ckcpro.w from 14 Aug 98 (see notes above) tinit() can be
- called *after* spar(), but whatru is set in spar() but zero'd in tinit().
- Hmmm, this also explains why the "who are you" info went missing around the
- same time... Cure: move initialization of whatru (and whoaru[]) to spar().
- ckcfns.c, 27 Oct 98.
- This seems to take care of everything. When PATTERNS are OFF on the server,
- GET /BIN always transfers in binary mode and GET /TEXT always transfers in
- text mode. However, if PATTERNS are ON, they still take precedence, since
- there is presently no way for the server to know *how* the binary bit in the
- client's WHOAMI field was set -- because it happened to be the prevailing
- mode (in which case the server's patterns should have precedence) or because
- the user said GET /BINARY (in which case the client's command should govern).
- Unfortunately there are no spare bits in the WHOAMI field to express the
- difference. (It can, however, be easily added to the O Packet.) In the
- meantime, REMOTE SET TRANSFER MODE MANUAL effectively disables PATTERNS in
- the server and allows the GET /BINARY and /TEXT switches to operate in the
- expected way.
- So now the following work too (server has SET TRANSFER PIPES ON):
- get /bin wermit ; (after "remote set xfer mode manual")
- get /bin /as:x.x {!(sleep 5;cat wermit)}
- In light of successful experience with GFTIMER, redid UNIX ztime() to call
- gettimeofday() if GFTIMER is defined (since that has been working anyway for
- many months), rather than the bizarre cascade of historical #ifdef'd code.
- The advantage being that gettimeofday() gives us not just date and time to
- the second, but also the fraction of the second in microseconds.
- UNIX ztime() now also set two variables:
- long ztmsec; Fraction of second in millisec (or -1L if not set)
- long ztusec; Fraction of second in microsec (or -1L if not set)
- These variables are defined in ckcmai.c, and externs for them are in
- ckcdeb.h, so they can be freely referenced in the code without #ifdefs, but
- customers of these variables should always check to make sure they are not
- -1L before using them. ckufio.c, 28 Oct 98.
- For time-critical debugging, added SET DEBUG TIMESTAMP { ON, OFF }. When ON,
- it puts an hh:mm:ss.xxx timestamp at the beginning of each debug log line,
- where .xxx (1000ths of sec) is included if ztmsec is > -1L. Timestamping
- can be turned off and on at will, even while the debug log is open.
- ckuus[23x].c, 28 Oct 98.
- Made debug() recursion-proof. If debug() ever called itself, or called a
- routine (such as zstime(), which it now calls for timestamps) which contains
- debug() statements, it would recurse forever and crash when the stack
- overflowed. dodebug(): ckuusx.c, 28 Oct 98.
- Noticed that all the documentation said SET CLEAR-CHANNEL but the code said
- SET CLEARCHANNEL. Added alternative keywords & abbreviations to make them
- both right. ckuusr.c, 28 Oct 98.
- Checked to make sure we still build OK on:
- . Linux (RH 3.0.3): OK
- . Solaris 2.5.1 (gcc): OK
- . SunOS 4.3.1: OK
- . HP-UX 10.20 (no opt): OK
- . UnixWare 2.1.3: OK
- . Sinix 5.42: OK
- . AIX (no space)
- . VAX/VMS 5.5: OK
- The first few were OK but Sinix, Unixware, and VMS required a fair amount of
- #ifdef juggling and syntax adjustment. Problem areas in Unixware and Sinix
- included: no getusershell() (so must add -DNOGETUSERSHELL); no setreuid() etc
- in Sinix, so just use setuid() (man page says it does it all), adding -lcrypt
- to LIBS here & there, etc. ckuus2.c, ckcfns.c, ckcmai.c, ckcnet.c, ckvfio.c,
- 28 Oct 98.
- Noticed that:
- rem host sleep 5;echo one;sleep 5;echo two;sleep 5;echo three
- works fine with SunOS server, but stops after "one" with UnixWare, SINIX.
- HP-UX, Linux, and Solaris. Found and fixed a potential problem with the
- use of fcnctl() to set the pipe nonblocking, but it made no difference.
- Debug log shows:
- getpkt nleft=0
- getpkt zminchar 2=110
- getpkt zminchar 2=101
- ZINFILL feof
- getpkt zminchar 2=-1
- getpkt eof/eot[one]=3
- In other words, feof() is returning true, even though the pipe is not closed.
- I don't know why, but removing the first of two feof() tests from zinfill()
- in this case (reading from pipe) makes the problem go away. ckufio.c,
- 29 Oct 98.
- Tried building on Sequent DYNIX/ptx(R) V4.4.2:
- . Warnings about trigraphs in comments, e.g. "/* yyyy-mm-dd */".
- So what -- these warnings are too stupid to fix.
- . Typo in _SYS_NML #ifdefs in ckutio.c.
- . struct timeval not declared because SELECT not defined.
- . struct timezone does not exist.
- . gettimeofday() needs to be called with arg #2 = NULL.
- . set[r]e{u,g}id() do not exist. Added USE_SETUID to ckufio.c for IKSD.
- In fact, I'm not sure that there is any reason at all not to always
- use setuid() and setgid() in IKSD -- but I'm not sure it's safe either.
- . {get,set}usershell() don't exist.
- . Most DYNIX/ptx makefile entries were missing the $(KFLAGS) clause.
- . Fixed these, then updated makefile DYNIX/ptx entries to all have
- -DNOGETUSERSHELL, and added new dynixptx44 entry that also has
- -DSELECT and -DBIGBUFOK.
- . This gets lots of select() warnings, which I fixed with #ifdefs.
- . It also gets warnings on args of getsockopt(), getsockname(), and accept();
- all these fixed with #ifdefs in ckcnet.c.
- . Banner was wrong -- said POSIX instead of DYNIX/ptx, fixed in ckuver.h.
- Now it builds and runs fine. 29 Oct 98.
- Reconciled Jeff's recent changes with mine, many modules, plus an adjustment
- to the getpeername() call for Unixware. 3 Nov 98.
- Changes from Jeff to allow fatal error messages from host to be viewed in
- case of disconnect during tn_ini(). ckcnet.c, ckutio.c, 4 Nov 98.
- Updates for ckvins.txt and ckvbwr.txt, 5 Nov 98.
- Made sure that TIOCGSIZE was a synonym for TIOCGWINSZ in Digital Unix, and
- that ttgwsiz() worked OK. Added comments. Made sure it still builds OK on
- DU 3.2 and 4.0B. ckutio.c, 5 Nov 98.
- Allowed "--" as a synonym for "=" on the command line to separate program
- arguments from script arguments, a`la getopt(). prescan(): ckuus4.c,
- cmdini(): ckuus5.c, doarg(): ckuusy.c, HELP OPTIONS: ckuus2.c, documented in
- ckermit2.txt, 5 Nov 98.
- Noticed that LOCAL variable stack depth was defined as MACLEVEL rather than
- CMDSTKL. Fixed in ckuus5.c, 5 Nov 98.
- As an experiment, added a few lines of code to the TAKE command parser to
- allow arguments to follow the filename (also some minor adjustments were
- required to xword()). So now the TAKE command does the same thing as the DO
- command, except it does not push the macro stack. Thus, if any args are
- given, they overwrite the current macro args, if any, just as if the user had
- given explicit DEFINE or ASSIGN commands for them. To test, create a file
- (say xxx) that contains the SHOW ARGS command and then tell C-Kermit to "take
- xxx foo bar baz". Works great, doesn't seem to break anything.
- However, nested TAKEs just keep writing over the same set of arguments, unlike
- nested macros or function calls. which save and restore context. This is a
- bit ugly to explain, so perhaps a better course would be to tie the argument
- stack to the command level rather than the macro level. This would be a
- rather massive (but mostly mechanical) change, involving all references to:
- m_line[level] stack of macro invocation lines
- macx[level] stack of pointers to macro definitions
- macp[level] stack of pointers to current position in macro
- + m_arg[level][arg] stack of pointers to args at level 0..MACLEVEL
- + m_xarg[level] stack of pointers to arg vector array
- + n_xarg[level] stack of dimensions of arg vector array
- + macargc[level] stack of argc's
- ? mrval[level] stack of RETURN values
- topargc argc at top level
- topxarg argv at top level
- Presumably we could (a) replace all MACLEVEL dimensions for the arrays marked
- "+" (and maybe mrval[] too if we want command files to be able to return
- values) by CMDSTKL; (b) move the argument setting / restoring code from dodo()
- to a common place; (c) call the common routine from both dodo() and dotake();
- (d) index all arrays by cmdlvl rather than maclvl; (e) get rid of the many
- special hacks for top level; (f) preserve compatibility with current behavior
- by having TAKE without args supply current args as default. This could work,
- but if a subordinate command file changed its arguments, the changes would be
- undone when it returned to its caller, which is counter to current behavior.
- So we can't make this change.
- Discovered that &_[] does not work at top level. Commented out two lines of
- code in chkarray() that prevented it from working. ckuus5.c, 5 Nov 98.
- Worse than that, &_[] does not work inside FOR, WHILE, SWITCH, XIF. That's
- because dogta() doesn't handle this array. Fixed in dogta(): ckuus6.c,
- 5 Nov 98.
- Fixed popclvl() to restore &_[] array when popping back to top level.
- popclvl(): ckuus5.c, 5 Nov 98.
- So now it is possible for a first-level command file (that is invoked
- without arguments) to access the non-Kermit command line options as follows:
- for %i 0 v(argc)-1 1 { echo %i. "&_[%i]" }
- So, for example, if Kermit was invoked as "kermit -Y -i -- foo bar baz", the
- loop would print:
- 1. "/usr/local/bin/kermit"
- 2. "foo"
- 3. "bar"
- 4. "baz"
- OK, so now back to the problem at hand. Note that:
- define mtake take
- mtake filename arg1 arg2 ...
- allows %0..9 to be saved and restored. But it also shifts the arguments
- to the right: once inside the command file, %1 is the filename, %2 is
- arg1, etc. This can be partially corrected by defining MTAKE as follows:
- define mtake {
- local %f %i
- assign %f fcontents(%1)
- for %i 1 v(argc)-2 1 {
- assign &_[%i] &_[%i+1]
- if < %i 10 _assign \%%i &_[%i]
- }
- take %f
- }
- This works fine except it does not (can not) adjust v(argc). Two solutions
- spring to mind: (a) add a SHIFT command to shift all the args to the left one
- position (and also move &_[10] to %9), adjusting v(argc) (and %*) in the
- process, or (b) add a built-in MTAKE command. (a) seems more generally
- useful so let's give it a shot...
- Added SHIFT [ n ] command. ckuusr.[ch], 5 Nov 98.
- Added doshift(n) routine. First top-level &_[] vector. Then top-level
- globals. Almost got it working, but ran out of time. Will try to finish
- tomorrow. ckuus5.c, 5 Nov 98.
- Fixed doshift(), ckuus5.c, 6 Nov 98. Now MTAKE can be defined as follows:
- define mtake {
- local %f
- assign %f fcontents(%1)
- shift
- take %f
- }
- and it works. Still need to (a) handle %* (might not be possible), and
- (b) document all this. Also think about adding MTAKE as a built-in command.
- Updates to ckubwr.txt based on recent reports. 6 Nov 98.
- Some network-related changes from Jeff, mostly in ckcnet.c. 9 Nov 98.
- Added HELP SHIFT. ckuus2.c, 9 Nov 98.
- SET CLEARCHANNEL OFF had no effect if the other Kermit wanted to negotiate
- clearchannel. Fixed in spar(), ckcfns.c, 9 Nov 98.
- Made SET PREFIXING ALL or CAUTIOUS automatically also SET CLEARCHANNEL OFF.
- ckcmai.c, 9 Nov 98.
- Added *.lzh to binary types. ckcmai.c, 10 Nov 98.
- DIAL and LOOKUP did not recognize internal PBX numbers if PBX-EXCH and PBX-IN
- are set, but PBX-OUT is not set. No big deal, but confusing. So now it is
- possible to handle a PBX that does not require an outside prefix (in case
- there is any such thing). Fixed in dncvt(): ckuus6.c, 10 Nov 98.
- Loading of dial parameters from environment variables at startup had K_PBX_OCP
- and K_PBX_XCH mixed up. Fixed in ckudia.c, 10 Nov 98.
- SET DIAL PBX-EXCHANGE allowed only one exchange to be specified. But some
- PBXs have more than one (e.g. 853-xxxx and 854-xxxx). Changed dialpxx from a
- scalar to an array; changed SET DIAL PBX-EXCHANGE command to load the array,
- and all code that refers to dialpxx to treat it as an array. Also changed
- startup code to load the array from K_PBX_XCH, which now can be defined as a
- series of numbers. ckudia.c, ckuus[346].c, 10 Nov 98.
- But there is still only one PBX-INSIDE-PREFIX. So we need a way of deriving
- the inside prefix dynamically from the exchange that was matched, e.g.:
- SET DIAL PBX-INSIDE-PREFIX fsubstr(xxx,3,1)
- where xxx is some new variable to stand for "the PBX exchange that was
- matched", whose evaluation is delayed until dial string processing, similar
- to the v(filename) variable used in SEND and RECEIVE commands.
- Defined VN_D_PXX for this new variable, and named it v(d$px). Changed
- parsing of SET DIAL PBX-INSIDE PREFIX to not evaluate its operand if it is a
- function call (i.e. starts with "f") or if it *is* the new variable. Changed
- dial string processing to evaluate the PBX inside prefix at dial time, after
- matching one of the PBX exchanges. Works great:
- set dial pbx-out 93,
- set dial pbx-exch 853 854
- set dial pbx-in fright(v(d$px),1)
- lookup +1 (212) 854-9876 ; gives 4-9876
- lookup +1 (212) 853-1234 ; gives 3-1234
- lookup +1 (212) 765-4321 ; gives 93,765-4321
- lookup +1 (333) 765-4321 ; gives 93,1333765-4321
- Also checked that SET DIAL LC-PREFIX works right (I had a report that it was
- broken around the end of May -- it applied itself to long-distance, rather
- than local, calls). It seems to be fine now; I must have fixed it:
- set dial lc-prefix 8,
- set dial pbx-out 93,
- set dial pbx-exch 853 854
- set dial pbx-in fright(v(d$px),1)
- lookup +1 (212) 854-9876 ; gives 4-9876
- lookup +1 (212) 853-1234 ; gives 3-1234
- lookup +1 (212) 765-4321 ; gives 93,8,765-4321
- lookup +1 (333) 765-4321 ; gives 93,1333765-4321
- ckuus[346].c, 10 Nov 98.
- Change from Jeff for SET LOGIN PASS vs quoting. ckuus3.c, 11 Nov 98.
- Added "set file character-set cp1252" as a synonym for "set file character-set
- latin1". As far as Kermit file transfer is concerned, they are the same.
- The same can not be said, however, for the other Windows 12xx code pages.
- ckuxla.c, 11 Nov 98.
- Added CP855 as a file character-set, including invertible tables from
- CP855 to Latin/Cyrillic and back. Ditto for Windows CP1251. ckuxla.[ch],
- 11 Nov 98.
- Changed "cp856" keyword to "bulgaria-pc". ckouni.c, 11 Nov 98.
- Added "bulgaria-pc" as a file character set. The only meaningful (and
- invertible) translations are between it and Latin/Cyrillic. This is the PC
- code page known in Bulgaria as CP856, but we don't call it that because the
- real CP856 is something totally different (a Hebrew code page). ckuxla.[ch],
- 11 Nov 98.
- Added CP1250 (Windows Latin 2) as a file character set, with an invertible
- translation to Latin-2 and back. ckuxla.[ch], 12 Nov 98.
- Added Polish Mazovia PC Code Page as a file character set. Translation tables
- filled in provisionally, pending confirmation from Poland. Not invertible.
- ckuxla.[ch], 12 Nov 98.
- Added some #ifdefs to allow building with -DNOLATIN2. Verified all is OK with
- with -DNOCYRIL &/or -DNOLATIN2. ckuxla.h, 12 Nov 98.
- Changes from Jeff: CKXPRINTF vs curses in ckuusx.c, some casts added in
- ckcnet.c, 13 Nov 98.
- Added &S0 (DSR on always) to USR init string for SunOS 4.x -- it doesn't work
- without it, due to some strange peculiarity of the driver. Solaris works
- without it, other modems work without it on SunOS. Go figure. (Note: I used
- to have &S0 in ALL init strings that supported it but removed it after
- numerous sysadmins complained that Kermit should not mess with it.) ckudia.c,
- 13 Nov 98.
- In cmcvtdate(), "if (dbuf[8] = SP) dbuf[8] = '0';" was supposed to have "=="
- in the if condition. Fixed in ckucmd.c, 13 Nov 98.
- For IRIX 6.5: added IRIX65 symbol to ckcdeb.h and ckuver.h, plus new makefile
- entry. 13 Nov 98.
- Missing "int" added to assorted extern declarations. ckuus[6x].c, 13 Nov 98.
- extern int stchr in ttinl() should have been extern CHAR. ckutio.c, 13 Nov 98.
- Back to mid-September work on UUCP lockfiles versus symlink'd devices, in
- which we create a lockfile for both the symlink name and the real name, e.g.
- /dev/modem and /dev/ttyS0, which works fine. But what if the symlink points
- to a device of the same name but in a different directory? Example:
- /dev/ttyd2 => /hw/ttys/ttyd2 (in IRIX 6.5). Both lockfiles have the same
- name (in this case LCK..ttyd2). The device is opened OK, but at close time
- when we go to delete the lockfiles, we get an error because deleting the first
- one also makes the second one disappear (since they are the same). Fixed
- by adding a check for this to ttlock(). ckutio.c, 13 Nov 98.
- Added a rather elaborate set of #ifdefs to account for the facts that: (a)
- utmp.h might or might not define a ut_host[] member; (b) utmpx.h, which does
- define one, might or might not be available; and (c) if utmpx.h is used
- instead of utmp.h, then it has a struct timeval ut_tv member rather than a
- scalar ut_time member. This allows compilation on Linux and SunOS, in which
- ut_host[] is in utmp.h, as well as on Solaris, IRIX, Unixware, and HP-UX,
- which have utmpx.h, and on platforms that have a utmp.h that does not define
- ut_host[], and no utmpx.h. ckufio.c, 13 Nov 98.
- Added Mazovia as a terminal character set to K95. ckouni.[ch], 13 Nov 98.
- Converted ckouni.[ch] for compilation by non-ANSIC compilers and cleaned up
- formatting, long lines, etc. NOTE: There is some funniness in the
- ucs2_to_utf8() function. Its ucs2 argument is USHORT, but there is a series
- of comparisons of it with numbers like 0x10000, 0x200000, 0x4000000, which
- will always fail, so why are they there? Also note that 0xnnnnUL is not
- supported for non-ANSIC compiles, but then I'm not quite sure how to specify
- an unsigned long constant whose high-order bit is 1. Anyway, the changes to
- ckouni.c are rather massive, so thorough testing is needed. 13 Nov 98.
- this paves the way for moving file-transfer charset translation to the Unicode
- base if we decide to go that route. However, there will still be some
- wrinkles:
- . It will involve a three-step process: x -> Unicode -> y, whereas now we
- generally have only 2 steps (file <=> xfer charset).
- . ckouni.o is more than 3 times bigger than ckuxla.o, and the functions
- are a lot more expensive to call, some of them involving long switch
- statements.
- . The translations in ckuxla.c have evolved over time to meet users' needs.
- Some are invertible, some are not (so as to be readable).
- . ckouni.c does not support language-specific transliterations (such as
- u-umlaut => ue when converting Latin-1 to ASCII with SET LANGUAGE GERMAN).
- Added support for 153600 and 307200 bps serial speeds, which are supported
- (at least) in Solaris 2.5.1. ckutio.c, 13 Nov 98.
- From Jeff: make "sh" an abbreviation for SHOW (because of new conflict with
- SHIFT); some TLS refinements. ckuusr.c, ckcnet.c, 17 Nov 98.
- Made the "Show what?" message a bit more helpful. ckuus4.c, 17 Nov 98.
- Added new makefile entry for UnixWare 7.0.1 and built it there OK. makefile,
- ckuver.h, 17 Nov 98. Makes Telnet connections OK, transfers files over them.
- Other tests from ckuins.txt Section 7 passed OK, except no way to test serial
- comms, modems & dialing. Also made a unixware7g entry (for gcc) but it fails
- miserably. I can't tell why, but it appears to have something to do with the
- UNIX macro -- gcc seems to undefine it for some reason, so #ifdef UNIX clauses
- are not executed (e.g. MAXFCSETS is not defined, which I think could only
- happen if an #ifdef UNIX clause was skipped).
- UnixWare builds only support speeds up to 38400. No Bnnnn symbols are defined
- for them. Instead, we are supposed to use tcsetspeed(), giving it a long
- representing the desired speed in bps. But (a) this requires a POSIX build,
- which fails rather badly; (b) there is, at present, no tcsetspeed() code in
- ckutio.c; and (c) how are we supposed to get the list of supported speeds?
- Discovered that "make sco32v504net KFLAGS=-DNOGETUSERSHELL" works OK on
- UnixWare 7. But it still doesn't give us the high serial speeds.
- So let's try adding -DPOSIX to the unixware7 make. Lots of complaints about
- tv_sec, timeval, etc, so added #ifdefs for UW7 to #include <sys/time.h>. But
- this doesn't help because of the fascist clauses to prevent struct timeval
- from being defined in a POSIX build (see earlier notes about SCO OSR5 on the
- same topic). So now we define the struct ourselves if time.h didn't (luckily
- UW7 also defines a macro to indicate it has defined the struct). Ditto for
- struct timezone. Now it compiles OK, but still lacks serial speeds > 38400.
- Meanwhile, the same <sys/time.h> treatment is needed for the network module
- too. ckcnet.c, 17 Nov 98.
- Added a tcgetspeed() / tcsetspeed() interface to ttgspd() and ttsspd(), and
- then in this case had ttdpdlist() return a hardwired list of all possible
- speeds up to 900K, and let the OS complain at runtime if a speed is not
- supported. Now we get:
- UX:acomp: ERROR: "ckutio.c", line 5620: undefined symbol: TCS_ALL
- UX:acomp: ERROR: "ckutio.c", line 6045: undefined symbol: TCS_OUT
- These are the function codes for tc[gs]etspeed(). But "cd /usr/include ; grep
- TCS_ *.h sys/*.h" turns up no definitions for these symbols anywhere. For
- that matter, tcsetspeed() is not defined in POSIX.1, nor can I find any
- reference to it on any other POSIX-based system I have access to, or on the
- web, or anywhere else. So it must be a UnixWareism. Fine, let's guess at the
- TCS_* values, say 3 2 1? Compiles OK, doesn't work. Try 2 1 0, now it works.
- However, since we can't use the Bnnnn symbols to build a legal-speed list,
- I had to build a hardwired list, containing all the speeds I ever heard of.
- ckutio.c, 17 Nov 98.
- Now that we can run it, trial and error shows the following speeds are
- supported:
- 110 1200 150 19200 2400 300 4800 57600 76800
- 115200 14400 1800 200 28800 38400 50 600 9600
- So I commented the others out of the hardwired list. ttspdlist(): ckutio.c,
- 17 Nov 98.
- The ttget/setspeed() interface is enabled if USETCSETSPEED is defined, which
- is currently the case only for UW7. These functions do not exist in earlier
- versions of UnixWare, so there is no point converting them to POSIX.
- Finalized unixware7 makefile target to include -DPOSIX and use the xermit
- target for select-based, rather than fork-based, CONNECT. Also added a short
- name for it: "make uw7". makefile, 17 Nov 98.
- After all that work on tcget/setspeed(), it looks like it only APPEARS to
- work, but in fact does nothing at all. tcsetspeed() says it succeeds, and a
- subsequent tcgetspeed() shows the speed that was just set, but the speed does
- not change. I verified this by assigning a line (whose nominal speed was 9600
- bps), changing the speed to 57600, and transferring a precompressed file over
- various modem connections: 14400, 24000, ... In every case, the throughput
- was 900 cps. So I rebuilt the non-POSIX version, set the serial port speed to
- 38400 (the max for this build) and got 1600 cps throughput. Thus, the old
- speed-setting API works (but only up to 38400) and tcsetspeed() is a cruel
- hoax.
- Or is it? Maybe I guessed the TCS_* values wrong. Let's try a different set;
- TCS_ALL = 0 (the only one we use). Aha, that does it. Now I get transfer
- rates of 2700 cps over a 24000 bps connection (same precompressed file). As
- further confirmation, the initial transfer rate is about 5700 cps while the
- modem buffers stuff up (== the interface speed of 57600) and then decays to
- 2700 once the pipe is full. So yay, speed setting works. (As additional
- confirmation, everything falls apart at 115200 bps due to the PC's crummy
- UART.)
- But modem signals, carrier detection, etc, do not work. Same reason: POSIX
- builds deselect the TIOCMGET definition from <sys/termios.h>. So we use the
- same trick here as in OSR5 -- define it ourselves. But that's not enough --
- we also have to define all the TIOCM_xx symbols for each modem signal, since
- those definitions, too, are hidden from POSIX. ckutio.c, 18 Nov 98.
- Ensured that "make unixware2" still works.
- Added code to allow user to SET SPEED to any number at all, even if it is not
- in the keyword table, if USETCSETSPEED is defined. As it stands, the user
- gets a parse error message, but the request still goes through and succeeds or
- fails based on whether the OS accepts the speed. ckuus3.c, 18 Nov 98.
- Built on QNX 4.24. Needs -DNOGETUSERSHELL, and does not have initgroups().
- wtmp log is /var/adm/wtmp.1. <utmp.h> has no ut_host[] and there is no
- <utmpx.h>. 32-bit and 16-bit versions OK. ckufio.c, makefile, 18 Nov 98.
- Now on to IRIX 6.5.1 on the Origin:
- System: SGI Origin 200, 2xR10000 180MHz
- OpeSys: SGI IRIX 6.5.1 + Patches
- Memory: 256 MB
- DiskSp: 15.8 GB
- Builds and runs fine. Speeds up to 115200 supported, but there's no way to
- test if they actually work. Noted that the Indy can run the Origin binary
- and vice versa, good. No changes needed.
- Fix from Jeff for a problem that causes "set host *" to loop, eating up CPU
- time, till the connection comes in. Built the result on HP-UX 10.20, since
- that's where the looping problem was reported. Checked against C-Kermit 6.0,
- which makes the CPU lights come on solid, and rises rapidly to the top of
- "top", consuming 95% of the CPU. The fixed version does not make the lights
- come on, and after a minute or two "top" says it uses 0% of the CPU.
- ckcnet.c, 18 Nov 98.
- Added a missing #ifndef NOHELP clause in ckuusy.c, 18 Nov 98.
- Added some missing #ifdef TNCODE's in ckuus4.c so it could be built with
- no network support. 18 Nov 98. (STILL NEEDS FIXING ON VMS)
- Added -DNDSYSERRLIST to OpenBSD makefile target. 19 Nov 98.
- Added a solaris7g makefile entry to build on Solaris 7 with gcc. It works
- fine, except for some warnings from curses.h about redefinitions of items
- that C-Kermit doesn't use (getwc, putwc, getwchar, putwchar). This makes a
- 32-bit version (sizeof int = sizeof long = 4), since gcc doesn't know how to
- make a 64-bit one. It makes Telnet connections OK and transfers files over
- them OK. When dialed in to a Sun serial port, file transfer is a bit flaky
- when sending files out (but this particular machine is known to have flaky
- serial ports). Makefile, 19 Nov 98.
- Added a couple more missing #ifdefs to allow linking after compilation without
- network supportk. ckcmai.c, ckuus4.c, 19 Nov 98.
- Changed password argument to zvpass() and kpass() from "passwd" to "p", since
- passwd conflicts with a struct name, which is fatal in some builds. ckufio.c,
- 19 Nov 98.
- Added #ifdefs to protect all the new gettimeofday() calls from having 2 args
- in Motorola System V/88 R4. ckutio.c, 19 Nov 98.
- Built OK on VMS 5.5 with NONET and with UCX 2.0. 19 Nov 98.
- While running thru the ckuins.txt testing instructions, I discovered that
- ?-help doesn't work in a filename after SEND, e.g. "send *?". This took a
- good bit of sleuthing but eventually I fixed with apparently no ill effects.
- gtword(): ckucmd.c, 19 Nov 98.
- Changed FAST macro definition for IRIX65 to not restrict send packets to
- 4000 bytes, since this version does not have the Telnet server bug noted in
- IRIX 6.2 and earlier. ckuus5.c, 19 Nov 98.
- Added MAINTYPE symbol, which can be defined on the CC command line to answer
- complaints about "main: return type is not blah". ckcmai.c, 20 Nov 98.
- Added a note about MAINTYPE to the openbsd makefile entry, pending
- verification. 20 Nov 98.
- From Jeff: Symbols and keywords added for VT220PC and VT320PC terminal types.
- ckuusr.h, ckuus[57].c, 23 Nov 98.
- Changed zvpass(), after authenticating the user, to always use setuid() and
- setgid(), rather than set[r]e{u,g}id(). This eliminates a lot of #ifdefs
- and it's what we want: once we establish ourselves as the authenticated user,
- we do not need or want any possibility of switching back to root.
- ckufio.c, 23 Nov 98.
- Readjusted MAINTYPE to take precedence over all other declarations.
- ckcmai.c, 23 Nov 98.
- Made #ifdefs around main() declaration in wart agree with those in kermit,
- including MAINTYPE. ckwart.c, 23 Nov 98.
- Added symbol HWPARITY and parsing for "hardware parity" (8 data bits plus
- parity generated by system / driver / hardware outside Kermit). Defined
- HWPARITY for SVORPOSIX. Builds OK (e.g. on SunOS) where HWPARITY not defined,
- and also on Solaris, where it is. ckcdeb.h, ckcmai.c, ckuus[34].c, 23 Nov 98.
- Will fill in the action code tomorrow...
- Fixed some #ifdefs to allow successful compilation and linking with -DNOLOGIN.
- ckuus5,c, cku[ft]io.c, 24 Nov 98. Builds OK now on Motorola SV88R4.0 and
- SV68R3.6. Also on Solaris 2.6 Intel.
- Back to hardware parity. UNIX APIs do not offer any way to set mark or space
- parity. So... SET PARITY HARDWARE { EVEN, ODD }. If some other platforms
- have APIs for 8M or 8S we can add them later. This setting takes effect only
- on SET LINE devices, not on network connections and not in remote mode.
- Added SET STOP-BITS { 1, 2 }, only if HWPARITY is defined. ckuusr.[ch],
- ckuus[23].c, ckutio.c, 24 Nov 98.
- For convenience and familiarity, added SET SERIAL { 7E1,7E2,...8N1,8E2,... }.
- Any choice with 2 stop bits or 8 data bits + parity is available only if
- HWPARITY is defined. ckuusr.[ch], ckuus3.c, ckutio.c, 24 Nov 98.
- Updated SHOW COMM to display new parity settings, stop bits, etc.
- ckuus4.c, 24-25 Nov 98.
- Discovered that ckucns.c, unlike ckucon.c, failed to assign the v(trigger)
- value when a TERM TRIGGER was encountered. Fixed in ckucns.c, 25 Nov 98.
- Discovered that both ckucns.c and ckucon.c failed to reset the v(trigger)
- value upon entry to CONNECT, so a subsequent exit could still show a previous
- trigger value. Fixed in both, 25 Nov 98.
- Changed the LOG command to allow logging to pipes. Very handy. See Section
- 1.13 of ckermit2.txt. ckuus4.c, 25 Nov 98.
- Added transparent printing within #ifdef XPRINT, 25-26 Nov 98:
- . UNIX only, and then only in the ckucns.c module.
- . SET TERM PRINT { ON, OFF }: ckuusr.h, ckuus7.c.
- . Added to SHOW TERM. ckuus5.c.
- . Documented in ckermit2.txt Section 3.3.
- Much fancy footwork required to pass all material through transparently,