C-KERMIT CHANGE LOG (Changes since 8.0.207 / K95 2.1.3 January 2003) Chronological order. Go to the bottom to find the newest edits. F. da Cruz, The Kermit Project, Columbia University, NYC. FTP USER, FTP ACCOUNT, plus the various prompts and switches for FTP username, password, and account all neglected to strip quotes, and in most cases quotes are necessary to specify a username that contains spaces. ckcftp.c, 15 Jan 2003. FTP MPUT f1 f2 f3... gets a parse error if any of the fn's do not match an existing file. This is bad for scripts. In doftpput(), cmfdb() looks for keywords (switches) or CMIFI. When it hits CMIFI, it exits from the initial parse loop and then does additional cmifi()s in a loop until done. The most obvious fix is to parse each field with cmfdb(CMIFI,CMFLD), i.e. fall back to CMFLD if CMIFI doesn't match anything. Then if CMFLD was used, we don't add the filespec to the list. This is a rather big change but it seems to work. No error messages or failures happen for non-matching fields, but an error message is printed (and the MPUT command fails) if none of the fields match any files. This fix got in too late for 2.1.3; workaround: use C-Shell like wildcard list (ftp mput "{*.abc,foo.*}"). ckcftp.c, 16 Jan 2003. GREP did not pass its pattern through the expander, thus variables could not be used for patterns. This must have been an oversight -- I can't find anything in my notes about it. Fixed in dogrep(): ckuus6.c, 24 Jan 2003. New makefile target for HP-UX 11.xx with OpenSSL from Tapani Tarvainen. makefile, 31 Jan 2003. From Jeff: . Avoid core dump when dereferencing tnc_get_signature(): ckuus4.c. . Bump version numbers to 8.0.208, 2.1.4: ckcmai.c. Added /NOLOGIN to FTP [OPEN]. ckcftp.c, 10 Feb 2003. Don't dump core if FTP DEBUG is ON and FTP OPEN does not include a service. openftp(): ckcftp.c, 10 Feb 2003. HELP PATTERN text incorrectly identified commands and functions with floating and anchored patterns. The corrected lists are: Floating: GREP, TYPE /MATCH:, /EXCEPT: patterns, \farraylook(), Anchored: IF MATCH, file-matching wildcards, \fsearch(), \frsearch() ckuus2.c, 10 Feb 2003. INPUT n \fpattern(xxx) did not work for case-independent comparisons. Fixed in doinput(): ckuus4.c, 10 Feb 2003. It seems \fpattern() didn't work with MINPUT at all. There was no code to handle \fpattern() in the MINPUT parse loop, so it never worked. The code had to be totally rewritten to use cmfld() in a loop, rather than cmtxt() and then cksplit(). Furthermore, whenever any of the fields was an \fjoin(), this had to be split. ckuusr.c, 10 Feb 2003. Macro replacement via \m() and \fdefinition() does not work as advertised (i.e. case sensitively) for associative array elements; e.g. \m(xxx) is treated the same as \m(xxx), contrary to section 7.10.10 of the C-Kermit 7.0 update notes, and to the fact that the two really do exist separately. Fixed by adding a static function isaarray(s) which succeeds if s is an associative array reference and fails otherwise, and then having \m() and \fdef() call mxxlook() (case-sensitive lookup) if isaarray(), otherwise (as before) mxlook()). ckuus4.c, 11 Feb 2003. Fixed FTP OPEN to allow the /USER switch to override SET FTP AUTOLOGIN OFF, just as /NOLOGIN overrides SET FTP AUTOLOGIN ON. ckcftp.c, 11 Feb 2003. In K95, "set key \1234 \27H" (any SET KEY command in which the first char of the definition was backslash, and the ONLY character after the backslash quantity was an uppercase letter, that letter would be lowercased). Diagnosis: xlookup() poking its argument (see notes from July 2000). Jeff sent a fix. ckucmd.c, 15 Feb 2003. Ran my S-Expression torture test to make sure Sexps still worked. They do, except the bitwise & and | operators were broken, e.g. (& 7 2) and (| 1 2 4) get "Invalid operand" errors. Jeff's code had added an early failure return from the lookup loop when when a single-byte keyword matched a keyword that started with the same byte but was more than one byte long. So "&" would hit "&&" and fail instead of continuing its search (xlookup tables aren't sorted so there can be no early return). Fixed in xlookup(): ckucmd.c, 16 Feb 2003. Got rid of "krbmit" target from makefile. It's still there, but we don't use it any more. All secure targets now use "xermit", and produce a binary called wermit, just like the regular ones do (except the old ckucon.c ones). Non-secure targets, since they don't define any of the security symbols, wind up compiling and linking to (mostly) empty security modules. makefile, 15 Feb 2003. Added \fcvtdate(xxx,3) to format its result in MDTM format (yyyymmddhhmmss, all numeric, no spaces or punctuation). Of course these numeric strings are too big to be 32-bit numbers and are useless for arithmetic, but they're useful for lexical comparison, etc. ckuus[24].c, 16 Feb 2003. The following FTP commands did not set FAILURE when they failed: RMDIR, CD, CDUP, Fixed in the corresponding doftpblah() routines. ckcftp.c, 16 Feb 2003. RENAME would sometimes not print an error message when it failed, e.g. in K95 when the destination file already existed. ckuus6.c, 17 Feb 2003. Fixed COPY error messages, which did not come out in standard format when /LIST was not included. ckuus6.c, 17 Feb 2003. Fixed #ifdefs in ck_crp.c to allow nonsecure builds on old platforms like System V/68 R3. 19 Feb 2003. Similar treatment for ck_ssl.c. 20 Feb 2003. From Jeff, 21 Feb 2003: . AIX53 and AIX52 symbols for ckcdeb.h, makefile. . New gcc targets for various AIX 4.x/5.x versions: makefile. . Copyright date updates: ck_crp.c, ck_ssl.c. . ENABLE/DISABLE QUERY broken because keyword table out of order: ckuusr.c. . Fixed the use of HTTP proxies for HTTP [RE]OPEN for Unix: ckcnet.c. Also for K95 only: Allow file transfer when K95 is invoked on the remote end of a connection to a Pragma Systems Terminal Server connection; automatically SET EXIT HANGUP OFF when invoked with open port handle ("k95 -l nnnn"). "cd a*" failed even when "a*" matched only one directory. Fixed in cmifi(): ckucmd.c, 21 Feb 2003. In the Unix version, replace "extern int errno;" with "#include " if __GLIBC__ is defined, since glibc now defines a thread-specific errno. ckcdeb.h, 26 Feb 2003. Added #ifdefs to skip compilation of ckuath.c in nonsecure builds. Tested by building both secure and regular versions in Linux. ckuath.c, 26 Feb 2003. Ran the build-in-84-different-configurations script on Linux to make sure it still builds with all different combinations of feature selection options. All OK. 26 Feb 2003. Built on VMS. Needed to add a prototype for mxxlook*() to ckuusr.h; built OK otherwise. 26 Feb 2003. From Jeff: More #ifdef shuffling for nonsecure builds: ckuath.c, ck_ssl.c, 27 Feb 2003. Added code to ensure \v(download) ends in a directory separator in Unix, Windows, and OS/2. ckuus7.c, 27 Feb 2003. Added code to K95 zfnqfp() to tack on directory separator when returning a directory name. ckofio.c, 27 Feb 2003. Somehow an old copy of ckuath.c popped to replace the new one. Put the new one back. 28 Feb 2003. From Jeff: Fix typo in my K95 zfnqfp() code from yesterday; fixes for handling UNCs uniformly, no matter which way their slashes are leaning. ckofio.c, 28 Feb 2003. At Jeff Mezei's suggestion, separate text and binary mode open sequences for VMS session log. ckvfio.c, 28 Feb 2003. Added freebsd48 target for FreeBSD 4.8. makefile, 1 Mar 2003. Changed Mac OS X entries to include -DUSE_STRERROR. makefile, 2 Mar 2003. Fixed GETOK /GUI to evaluate its text argument. ckuus6.c, 3 Mar 2003. Jeff fixed the K95 Dialer QUICK dialog to (a) allow templates, and (b) have a Save-As option. 3 Mar 2003. Jeff fixed a problem with the Xmodem-CRC checksum being crunched whenever there was a retransmission. 7 Mar 2003. Added target/banner for Tru64 5.1B. makefile, ckuver.h, 5 Mar 2003. In Unix, the zcopy() routine (used by the COPY command) reset the user's umask to 0 for the remainder of the Kermit process lifetime. The bug was in ckufio.c 8.0.194, 24 Oct 2002, and is fixed in ckufio.c 8.0.195, 6 Mar 2003. Of course this happened after building 155 C-Kermit 8.0.208 binaries. (But before officially releasing 8.0.208.) In the VMS version, changed: while ((n--) && xx_inc(2) > -1) ; to: while ((n--) && xx_inc(2) >= 0) ; to suppress the "...is being compared with a relational operator to a constant whose value is not greater than zero" warning. ckvtio.c, 7 Mar 2002. Added a debug call to dologend in hopes of catching overzealous Locus switching, which seems to happen only in K95. ckuus3.c, 7 Mar 2002. Rebuilt binaries for some of the more current Unix releases: AIX 4.3.3-5.1, Solaris 7-9 , Red Hat 7.0-8.0, Slackware 8.1, Freebsd 4.7-4.8, NetBSD 1.6, OpenBSD 3.2, Unixware 7.1.3, Open Unix 8, OSR5.0.6a, etc. A Unix binary with COPY umask fix shows a 6 Mar 2003 date for "UNIX File support" in SHOW VERSIONS; a binary without the fix shows 24 Oct 2002. C-Kermit 8.0.208 dated 14 March 2003 released on 10 March 2003. ---8.0.208--- From Jeff 13 Mar 2003: . Updated SSL module allows importation of tickets from host. . freebsd50+openssl target: makefile. . FTP PUT /PERMISSIONS error message for K95: ckcftp.c. Fixed MINPUT to strip quotes or braces from around targets (this was broken on Feb 10th). Thanks to Jason Heskett for discovering and reporting this (killer) bug. ckuusr.c, 14 Mar 2003. Changed version number to 209 Dev.00. ckcmai.c, 14 Mar 2003. While debugging the alphapage script, I found that the command "minput 8 \6\13 \21\13 \13\27\4\13 \30\13" gets "?Not confirmed" in 8.0.208 and 8.0.209, but not in 206 and earlier. This problem too was introduced on Feb 10th by changing MINPUT parsing from cmtxt() followed by cksplit() to cmfld() in a loop. cmfld() uses setatm() to return its result and of course setatm() breaks on \13. Changing setatm() not to do this would break everything else. But cmfld() has no arguments that let us tell it to do anything different in this case. Changing the API would be a disaster. The only solution is to add an "MINPUT ACTIVE" (minputactive) global variable that tells cmfld() to tell setatm() not to break on CR. Now MINPUT with braced targets containing CR and/or LF works in 209, 206, and 201 (but not 208). ckucmd.c, ckuusr.c, ckuus5.c, 15 Mar 2003. MINPUT n \fjoin(&a) works OK if all the members of \&a[] are text strings, but if they are strings of control chars (as above), they don't get separated by the spaces. For example in: dcl \&a[] = "\4\5" "\6\7" xxx minput 10 \fjoin(&a) MINPUT gets two targets: "aaa" and "\4\5 \6\7 xxx". The bug was in the cksplit() call in the \fjoin() case of MINPUT: it needed to specify an include set consisting of all the control characters except NUL. ckuusr.c, 16 Mar 2003. But there's still a problem: dcl \&a[] = "\4\5\13\10" "\6\7" "xxx" creates an array whose first member is "^D^E (one doublequote included). But if braces are used instead, there's no problem. Same deal as MINPUT: cmfld() breaks on CR or LF, thus the end quote is lost. If I set minputactive for DECLARE initializers too, that fixes it. Is there any reason not to do this? Can't think of any (famous last words)... ckuusr.c, 16 Mar 2003. Since it has multiple applications, changed the flag's name from minputactive to keepallchars. ckucmd.c, ckuus[r5].c, 16 Mar 2003. \v(exedir) wasn't being set correctly (it included the program name as well as the directory). Fixed in getexedir(): ckuus4.c, 16 Mar 2003. SET CARRIER-WATCH "auto matic" (spurious space in supplied keyword). Cosmetic only; it still worked. Fixed in setdcd(): ckuus3.c, 16 Mar 2003. "directory a b c" listed too many files -- all files whose names END WITH a, b, or c, rather than the files whose names WERE a, b, or c. Diagnosis: The filespec is changed into a pattern: {a,b,c}, which is the correct form. It is passed to nzxpand(), which goes through the directory getting filenames and sending each one to ckmatch() with the given pattern. ckmatch() receives the correct pattern but then prepends a "*" -- that's not right. It's not just in filename matching either. The following succeeds when it shouldn't: if match xxxxc {{a,b,c}} Changing ckmatch() to not prepend the "*" to each segment fixes the command above but breaks lots of others. Running through the "match" torture-test script shows the problem occurs only when the {a,b,c} list is the entire pattern, and not embedded within a larger pattern. Testing for this case fixed the problem. ckmatch(): ckclib.c, 16 Mar 2003. Fixed FTP MODTIME to not print anything if QUIET ON. ckcftp.c, 16 Mar 2003. Picked up a new ckuath.c from Jeff, not sure what the changes are. 16 Mar 2003. Did a few regular and secure builds to make sure I didn't wreck anything. Changed version number to 209 (final). ckcmai.c, 16 Mar 2003. Jason Heskett found another bug: if you define a macro FOO inside the definition of another macro BAR, and FOO's definition includes an odd number of doublequotes (such as 1), FOO's definition absorbs the rest of BAR's definition. Example: def TEST { .foo = {X"} sho mac foo } do test sho mac foo Results in: foo = {X"}, sho mac foo Diagnosis: the TEST definition becomes: def TEST .foo = {X"}, sho mac foo and the macro reader is erroneously treating the doublequote as an open quote, and then automatically closes the quote at the end of the definition. The error is that a doublequote should be significant only at the beginning of a field. But the macro reader isn't a command parser; it doesn't know what a field is -- it's just looking for commas and skipping over quoted ones. First we have to fix an oversight: SET COMMAND DOUBLEQUOTING OFF should have worked here, but it wasn't tested in this case. Fixed in getncm(): ckuus5.c, 17 Mar 2003. There are only certain cases where it makes sense to treat doublequotes as signicant: . An open quote must be at the beginning or preceded by a space. . A close quote is only at the end or else followed by a space. This too was fixed in getncm(): ckuus5.c, 17 Mar 2003. A fix from Jeff SSL/TLS FTP data decoding. ckcftp.c, 18 Mar 2003. Tried building C-Kermit on a Cray Y-MP with UNICOS 9.0. "int suspend", declared in ckcmai.c and used in many modules, conflicts with: unistd.h:extern int suspend __((int _Category, int _Id)); The "=Dsuspend=xsuspend" trick doesn't work for this; there is no way around the conflict other than to rename the variable: ckcmai.c, ckutio.c, ckuus[35xy].c. 26 Mar 2003. VMS and K95 not affected. OK that gets us past ckcmai.c... Then in ckutio.c I had to add a new #ifdef around the LFDEVNO setting, because the Cray didn't have mkdev.h. Could not find a Cray-specific manifest symbol, so I made a new makefile target (cray9) that sets this symbol. Having done this I have no idea what kind of lockfile would be created, but I also doubt if anybody dials out from a Cray. The binary should run a C90, J90, or Y-MP. makefile, 26 Mar 2003. Added a target for SCO OSR5.0.7. makefile, ckuver.h, 30 Mar 2003. Changed since 208: makefile ckuver.h ckcmai.c ckclib.c ckcftp.c ckucmd.c ckuus*.c ckutio.c. ---8.0.209--- From Mark Sapiro, a fix for the March 17th doubleqote fix, getncm(): ckuus5.c, 4 Apr 2003. From Jeff, 29 Apr 2003: . Corrected target for HP-UX 11.00 + OpenSSL: makefile, . Do not allow WILL AUTH before WONT START_TLS: ckctel.h ckctel.c . Add hooks for SFTP and SET/SHOW SFTP: ckcdeb.h ckuusr.h ckuusr.c ckuus3.c . Add SKERMIT ckuusr.h ckuusr.c . Add ADM-5 terminal emulation: ckuus7.c, ckuus5.c . Uncomment and update HELP SET SSH V2 AUTO-REKEY: ckuus2.c . Enable IF TERMINAL-MACRO and IF STARTED-FROM-DIALER for C-Kermit: ckuus6.c . Fix conflicting NOSCROLL keyword definition: ckuusr.h . Set ttname when I_AM_SSH: ckuusy.c . Add extended arg parsing for SSH, Rlogin, Telnet: ckuusy.c, ckuus4.c . Security updates: ckuath.c, ck_ssl.c . Change K95 version number to 2.2.0: ckcmai.c . Save K95 term i/o state before executing keyboard macro: ckuus4.c . Add tests for SSH Subsystem active during INPUT/OUTPUT/CONNECT: ckuus[45].c . Enable K95 SET SSH V2 AUTO-REKEY: ckuus3.c SFTP and SET SFTP subcommands are implemented up to the case statements. Files of mine that Jeff hadn't picked up: ckuver.h ckcftp.c ckutio.c ckuusx.c (just minor changes for last build-all) On 4 Jan 2003, SET RECEIVE MOVE-TO was changed to convert is argument to an absolute path, which made it impossible to specify a relative path, then move to different directories and have it apply relatively to each directory. Changed this as follows: . Parser uses cmtxt() rather than cmdir() so it won't fail at parse time. . If path is absolute, we fail at parse time if directory doesn't exist. . In reof() we run the the path through xxstring (again, in case deferred evaluation of variables is desired) and then, if not null, use it. . If the directory doesn't exist, rename() fails and reof() returns -4, resulting in a protocol error (this is not a change). We do NOT create the directory on the fly. I also fixed SET SEND/RECEIVE RENAME-TO to parse with cmtxt() rather than cmdir(), since it's parsing a text template, not a directory name, e.g. "set receive rename-to file-\v(time)-v(date)-\v(pid)". This was totally broken, since when I don't know. We don't call xxstring() in this parse, so evaluation is always deferred -- I'd better not change this. ckuus7.c, ckcfns.c, 1 May 2003. From Jeff, Sat May 3 14:15:23 2003: . Pick up the right isascii definition for K95: ckctel.c . malloc... ckuath.c (new safe malloc routines for K95) . Add author listing: ckuus5.c . SSH Heartbeat support (K95 only): ckuus[23].c . Prescan --height and --width to avoid window resizing at startup: ckuusy.c . Add checks for fatal() or doexit() called from sysinit(): ckuusx.c . Move some K95-specific definitions to ckoker.h: ckcdeb.h . Add support for ON_CD macro in zchdir(): ckufio.c . Add a command to let FTP client authenticate with SSLv2: ckcftp.c . Fix parsing of FTP file facts like "UNIX.mode": ckcftp.c ON_CD will need some explaining (to be done). It's implemented for Unix, VMS, WIndows, and OS/2. The FTP file facts fix came from first exposure to the new OpenBSD FTP server: ftp://ftp7.usa.openbsd.org/pub/os/OpenBSD/3.3/i386/ The period in "UNIX.mode" caused an erroneous word break, adding junk to the filename. About the malloc changes, Jeff says "K95 is not behaving well in low memory environments. I'm not sure that C-Kermit does much better. The program does not crash but it certainly does not behave the way the user expects it to. I'm beginning to think that any malloc() error should be treated as fatal." Not visible in these changes because it's in K95-specific modules: Jeff made SET ATTRIBUTES OFF and SET ATTRIBUTES DATE OFF apply to XYZMODEM transfers. From Jeff, 11 May 2003: . Add support for SSH Keepalive to relevant SET command (K95): ckuus3.c . Reduce max overlapped i/o requests from 30 to 7 (K95): ckuus7.c . Don't call sysinit() in fatal(): ckuusx.c. . Some new conditionalizations for SSL module: ck_ssl.c The doublequote-parsing fixes from March and April broke the SWITCH statement, which is implemented by internally defining, then executing, a macro. If I drop back to the old dumb handling of doublequotes, everything is fixed except the problem of March 17th. But can we really expect getncm() to pre-guess what the parser is going to do? getncm()'s only job is to find command boundaries, which are represented by commas. Commas, however, is needed IN commands too. We take a comma literally if it is quoted with \, or is inside a matched pair of braces, parens, or doublequotes. It is not unreasonable to require a doublequote in a macro definition to be prefixed by \ when it is to be taken literally. The proper response to Jason Heskett's complaint of March 17th should have been to leave the code alone and recommand an appropriate form of quoting: def TEST { .foo = {X\"} sho mac foo } And this is what I have done. Another reason for sticking with the old method is that it's explainable. The "improved" method, even if it worked, would be be impossible to explain. Btw, in testing this I noticed that the switch-test script made 8.0.201 dump core. Today's version is fine. The problem with quoted strings inside of IF {...} clauses and FOR and WHILE loops is fixed too. Perhaps "unbroken" would be a better word. ckuus5.c, 11 May 2003. Vace discovered that FTP MGET /EXCEPT:{... (with an unterminated /EXCEPT list) could crash Kermit. Fixed in ckcftp.c, 11 May 2003. CONTINUE should not affect SUCCESS/FAILURE status. ckuusr.c, 11 May 2003. Fixed an oversight that goes back 15 years. While \{123} is allowed for decimal codes, \x{12} and \o{123} were never handled. ckucmd.c, 11 May 2003. Added support for Red Hat and /usr/sbin/lockdev. Supposedly this allows Kermit to be installed without setuid or setgid bits and still be able to lock and use the serial device. Compiles and starts, but not tested. ckcdeb.h, makefile, ckutio.c, ckuus5.c, 16 May 2003. From Jeff: FTP ASCII send data to host when FTP /SSL was in use was broken. ftp_dpl is set to Clear when FTP /SSL is in use. This was causing the data to be written to the socket with send() instead of the OpenSSL routines. ckcftp.c, ckuath.c, 21 May 2003. From Jeff: Stuff for Kerberos 524: ckcdeb.h. Fixes for FTP; "FTP ASCII send data did not properly compute the end of line translations. On Unix (and similar platforms) the end of line was correct for no character sets but incorrect when character sets were specified. On Windows/OS2, the end of line was correct when character sets were specified and incorrect when they were not. On MAC, both were broken. Also, FTP Send Byte counts were incorrect when character sets were specified." ckcftp.c. 17 Jun 2003. From Jeff: fixes to HTTP /AGENT: and /USER: switch action: ckcnet.c ckuus3.c ck_crp.c ckcftp.c ckuus2.c ckuusy.c ckuusr.c ckcnet.h, 21 Jun 2003. From Jeff: Fix SET DIALER BACKSPACE so it can override a previous SET KEY (e.g. from INI file): ckuus7.c. Some SSL/TLS updates: ck_ssl.c. HTTP support for VMS and other VMS improvements (e.g. a way to not have to hardwire the C-Kerit version number into the build script) from Martin Vorlaender: ckcnet.h, ckuus[r3].c, ckcdeb.h, ckvtio.c, ckcnet.c, ckvker.com. Built on Solaris (gcc/ansi) and SunOS (cc/k&r). The new VMS script tests the VMS version and includes HTTP support only for VMS 6.2 or later. 2 Jul 2003. Tried to build on our last VMS system but it seems to be dead. Looks like a head crash (makes really loud noises, boot says DKA0 not recognized) (fooey, I just paid good money to renew the VMS license). Tried building at another site with: Process Software MultiNet V4.3 Rev A-X, Compaq AlphaServer ES40, OpenVMS AXP V7.3 Compaq C V6.4-008 on OpenVMS Alpha V7.3 Had to make a few corrections to ckvker.com. But still, compilation of ckcnet.c bombs, indicating that the SELECT definition somehow got lost somewhere since the 209 release (i.e. no SELECT type is defined so it falls thru to "SELECT is required for this code"). But I don't see anything in ckcdeb.h or ckcnet.[ch] that would explain this. Not ckvker.com either (putting the old one back gives the same result). OK, I give up, maybe it's just that I haven't tried building it on MultiNet recently. What about UCX? Aha, builds fine there except for warnings about mlook, dodo, and parser in ckvfio.c (because of ON_CD) -- I suppose I have #include ... (done) Anyhow it builds OK and the HTTP code is active and almost works (HTTP OPEN works; HTTP GET seems to succeed but creates an empty file every time). Tried building under MultiNet at another installation; same bad result. OK so why won't it build for MultiNet? Comparing ckcnet.c with the 209 version, not a single #ifdef or #include is changed. Tried building with p3="NOHTTP" -- builds OK, aha. Where's the problem? Not ckcnet.h... Not ckcdeb.h... OK I give up, will revisit this next time I get time to do anything with the code. Later Jeff said "Martin did not implement VMS networking for the HTTP code. All he did was activate the #define HTTP which happens to work because his connections are using SSL/TLS connections. http_inc(), http_tol(), etc have no support for VMS networking regardless of whether it is UCX or MULTINET. The vast majority of HTTP connections are not secured by SSL/TLS. It makes no sense to support HTTP on VMS until someone is willing to either do the work or pay have the work done to implement VMS networking in that code base." So the fix is to not enable HTTP for VMS after all. Removed the CKHTTP definition for VMS from ckcdeb.h, 6 Jul 2003. Fixed ckvfio.c to #include (instead of ) to pick up missing prototypes. 6 Jul 2003. From Arthur Marsh: solaris2xg+openssl+zlib+srp+pam+shadow and the corresponding Solaris 7 target. makefile, 6 Jul 2003. Remove duplicate #includes for , , and from ckcftp.c. 6 Jul 2003. Add -DUSE_MEMCPY to Motorola SV/68 targets because of shuffled #includes in ckcftp.c. 8 Jul 2003. From Jeff: Fix problems mixing SSL and SRP without Kerberos. Plus a few minor #define comment changes and a reshuffling of #defines in ckcdeb.h to allow me to build on X86 Windows without Kerberos. ckcdeb.h, ck_crp.c, ckuath.c, 10 Jul 2003. From Jeff: updated ckuat2.h and ckuath.c, 29 Jul 2003. Mats Peterson noticed that a very small Latin-1 file would be incorrectly identified as UCS-2 by scanfile(). Fixed in ckuusx.c, 29 Jul 2003. Fixed ACCESS macro definition to account for the fact that FIND is now a built-in command. ckermit.ini, 30 Jul 2003. From Jeff: Fix for typo in urlparse() (svc/hos): ckuusy.c, 18 Aug 2003. From Jeff: Redhat9 makefile targets (needed for for OpenSSL 0.9.7): makefile, 19 Aug 2003. GREP /NOLIST and /COUNT did too much magic, with some undesirable fallout: "GREP /NOLIST /COUNT:x args" printed "file:count" for each file. "GREP /COUNT:x /NOLIST args" did not print "file:count", but neither did it set the count variable. Removed the magic. Also one of the GREP switches, /LINENUMBERS, was out of order. Fixed in ckuus6.c, 20 Aug 2003. From Jeff: "Reorganizing code to enable building with different subsets of options; a few typos corrected as well." ckcdeb.h, ckuver.h (for RH9), ckcnet.c, ckuus7.c, ckuus3.c: 24 Aug 2003. Scanfile misidentified a big PDF file as text because the first 800K of it *was* text (most other PDF files were correctly tagged as binary). Fixed by adding a check for the PDF signature at the beginning of the file. scanfile(): ckuusx.c, 25 Aug 2003. Ditto for PostScript files, but conservatively. Signature at beginning of file must begin with "%!PS-Ado". If it's just "%!" (or something nonstandard like "%%Creator: Windows PSCRIPT") we do a regular scan. Also added "*.ps" to all binary filename patterns. ckuusx.c, 4 Sep 2003. Ditto (but within #ifndef NOPCLSCAN) for PCL (E) and PJL (%) files, but no binpatterns (note: ".PCL" is the extension for TOPS-20 EXEC scripts). ckuusx.c, 4 Sep 2003. Added comments about OpenSSL 0.9.7 to all linux+openssl targets. makefile, 4 Sep 2003. From Jeff: Added - #define ALLOW_KRB_3DES_ENCRYPT. When this symbol is defined at compilation Kermit will allow non-DES session keys to be used during Telnet Auth. These session keys can then be used for Telnet Encrypt. The reason this is not compiled on by default is that the MIT Kerberos Telnet does not follow the RFC for constructing keys for ENCRYPT DES when the keys are longer than 8 bytes in length. ckuath.c, ckuus5.c, 4 Sep 2003. "ftp mget a b c" succeeded if one or more of the files did not exist, even with "set ftp error-action proceed". This is because the server's NLST file list does not include any files that don't exist, so the client never even tries to get them. Fortunately, the way the code is structured, this one was easy to fix. ckcftp.c, 14 Sep 2003. From Jeff: Corrected code in ckcnet.c to ensure that Reverse DNS Lookups are not performed if tcp_rdns is OFF. Fixed ck_krb5_getrealm() to actually return the realm of the credentials cache and not the default realm specified in the krb5.conf file. Previously krb5_cc_get_principal() was not being called. Fixed ck_krb5_is_tgt_valid() to test the TGT in the current ccache and not the TGT constructed from the default realm. ckcnet.c, ckuath.c, 14 Sep 2003. Marco Bernardi noticed that IF DIRECTORY could produce a false positive if the argument directory had previously been referenced but then removed. This is because of the clever isdir() cache that was added to speed up recursion through big directory trees. Changed IF DIRECTORY to make a second check (definitive but more expensive) if isdir() succeeds, and changed the directory-deleting routine, ckmkdir(), to flush the directory cache (UNIX only -- this also should be done in K95 but it's not critical). This was done by adding a routine, clrdircache() to ckufio.c, which sets prevstat to -1 and prevpath[0] to NUL. ckcfn3.c, ckuus6.c, ckufio.c, 18 Sep 2003. Marco reported the second fix still didn't work for him (even though it did for me). Rather than try to figure out why, I concluded that the directory cache is just not safe: a directory found a second ago might have been deleted or renamed not only by Kermit but by some other process. Why did I add this in the first place? The log says: Some debug logs showed that isdir() is often called twice in a row on the same file. Rather than try to sort out clients, I added a 1-element cache to Unix isdir(). ckufio.c, 24 Apr 2000. Experimentation with DIR and DIR /RECURSIVE does not show this happening at all. So I #ifdef'd out the directory cache (see #ifdef ISDIRCACHE in ckufio.c; ISDIRCACHE is not defined) and backed off the previous changes: ckufio.c, ckcfn3.c, ckuus6.c, 28 Sep 2003. From Jeff: Replace the compile time ALLOW_KRB_3DES_ENCRYPT with a run-time command SET TELNET BUG AUTH-KRB5-DES which defaults to ON: ckctel.[ch], ckuus[234].c, ck_crp.c, ckuath.c. 4 Oct 2003. Allow DIAL RETRIES to be any positive number, and catch negative ones. Also added code to check for atoi() errors (e.g. truncation). At least on some platforms (e.g. Solaris) atoi() is supposed to set errno, but it doesn't. ckuus3.c, ckucmd.c, 4 Oct 2003. Added /DEFAULT: to ASK-class commands (ASK, ASKQ, GETOK): . For popups: no way to send defaults to popup_readtext() or popup_readpass(). . For GUI ASK[Q], pass default to gui_txt_dialog(). . For GUI GETOK, convert "yes" "ok" or "no" default to number for uq_ok(). . For Text GETOK, add default to cmkey(). . For Text ASK[Q], add default to cmtxt(). . For GETC, GETKEY, and READ: no changes. GETOK, ASK, and ASKQ with /TIMEOUT: no longer fail when the timer goes off if a /DEFAULT was supplied. The GUI functions (uq_blah) don't seem to support timeouts. Only the text version has been tested. ckuus[26].c, 4 Oct 2003. From Jeff: add /DEFAULT: for popups. ckuus6.c. 6 Oct 2003. Change SET DIAL INTERVAL to be like SET DIAL RETRIES. ckuus[34].c, 6 Oct 2003. Added target for HP-UX 10/11 + OpenSSL built with gcc, from Chris Cheney. Makefile, 12 Oct 2003. From Jeff, 6 Nov 2003: . #ifdef adjustments: ckcftp.c, ckcdeb.h . Fix spurious consumption of first byte(s) on Telnet connection: ckctel.c . Another HP PJL test for scanfile: ckuusx.c. . K95: Recognize DG4xx protected fields in DG2xx emulation: ckuus7.c. . Add SSLeay version display to SHOW AUTH command: ckuus7.c . Improved SET MOUSE CLEAR help text: ckuus2.c. . Improved Kverbs help text: ckuus2.c (+ new IBM-3151 Kverbs). . Some changes to ck_ssl.c, ckuath.c. From PeterE, 10 Nov 2003: . Improved HP-UX 10/11 makefile targets for OpenSSL. . #ifdef fix for OpenSSL on HP-UX: ck_ssl.c. Another new makefile from PeterE with improved and integrated HP-UX targets. 12 Nov 2003. A couple fixes to the solaris9g+krb5+krb4+openssl+shadow+pam+zlib target from Jeff. Added a solaris9g+openssl+shadow+pam+zlib target. makefile, 21 Nov 2003. From Jeff, 30 Nov 2003: . Fix SEND /MOVE-TO: ckuusr.c. . Fix K95 SET TITLE to allow quotes/braces around text: ckuus7.c. . Improved "set term autodownload ?" response: ckuus5.c. . Fix SHOW FEATURES to specify the protocol for encryption: ckuus5.c . Make {SEND, RECEIVE} {MOVE-TO, RENAME-TO} work for XYZMODEM (K95 only). From Jeff: 7 Jan 2004: . At one point Frank started to add a timer parameter to the uq_txt() function but he only did it for the non-ANSI compilers. I added it for the ANSI compilers, fixed the prototypes and provided a default value easily changed DEFAULT_UQ_TIMEOUT: ckcker.h, ckuus[36].c, ck_ssl.c, ckcftp.c, ckuath.c. . Fixed SET TERMINAL DEBUG ON (typo in variable name): ckuus7.c. . Fixed BEEP INFORMATION; previously it made no sound, now uses MB_ICONQUESTION. ckuusx.c. From Ian Beckwith (Debianization), 7 Jan 2004: . Search dir/ckermit for docs, as well as dir/kermit in cmdini(): ckuus5.c. . New linux+krb5+krb4+openssl+shadow+pam target (kitchen sink minus SRP, which Debian does not distribute): makefile. ? Mangles the DESTDIR support in makefile to install into a staging area: makefile (I didn't take this one yet). Updated copyright notices for 2004, all modules. 7 Jan 2004. Added INPUT /NOMATCH, allowing INPUT to be used for a fixed amount of time without attempting to match any text or patterns, so it's no longer necessary to "input 600 STRING_THAT_WILL_NEVER_COME". If /NOMATCH is included, INPUT succeeds if the timeout expires, with \v(instatus) = 1 (meaning "timed out"); fails upon interruption or i/o error. ckuusr.h, ckuus[r24].c, 7 Jan 2004. Added SET INPUT SCALE-FACTOR . This scales all INPUT timeouts by the given factor, allowing time-sensitive scripts to be adjusted to changing conditions such as congested networks or different-speed modems without having to change each INPUT-class command. This affects only those timeouts that are given in seconds, not as wall-clock times. Although the scale factor can have a fractional part, the INPUT timeout is still an integer. Added this to SHOW INPUT, and added a \v(inscale) variable for it. ckuusr.h, ckuus[r257].c, 7 Jan 2004. undef \%a, \fverify(abc,\%a) returns 0, which makes it look as if \%a is a string composed of a's, b's, and/or c's, when in fact it contains nothing. Changed \fverify() to return -1 in this case. ckuus4.c, 12 Jan 2004. \fcode(xxx) returned an empty string if its argument string was empty. This makes it unsafe to use in arithmetic or boolean expressions. Changed it to return 0 if its argument was missing, null, or empty. ckuus4.c, 12 Jan 2004. Updated \verify() and \fcode() help text. ckuus2.c, 12 Jan 2004. While setting up IKSD, Ian Beckwith noticed that including the --initfile: option caused Kermit to start parsing its own Copyright string as if it were the command line, and eventually crash. I couldn't reproduce on Solaris / Sparc but I could in Linux / i386 (what Ian is using) -- a change from Jeff on 28 Apr 2003 set the command-line arg pointer to a literal empty string in prescan() about line 1740 of of ckuus4.c; the pointer is incremented next time thru the loop, resulting in random memory being referenced. Fixed by setting the pointer to NULL instead of "". ckuus4.c, 12 Jan 2004. declare \&a[999999999999999] would dump core on some platforms. atoi() or whatever would truncate the dimension to maxint. When we add 1 to the result, we get a negative number, which is used as an index, loop test, etc. Fixed both dodcl() and dclarray() to check for (n+1 < 0). ckuus[r5].c, 12 Jan 2004. Unix zchki() would fail on /dev/tty, which is unreasonable. This prevented FOPEN /READ from reading from the terminal. zchki() already allowed for /dev/null, so I added /dev/tty to the list of specials. Ditto for FOPEN /WRITE and zchko(). ckufio.c 13 Jan 2004. Added untabify() routine to ckclib.[ch], 13 Jan 2004. Added FREAD /TRIM and /UNTABIFY. ckuus[27].c, 13 Jan 2004. Added \funtabify(). ckuusr.h, ckuus[24].c, 13 Jan 2004. Dat Nguyen noticed that (setq u 'p') followed by (u) dumped core. This was caused by an over-clever optimization that skipped mallocs for short literals, but then went on later to try to free one that hadn't been malloc'd. Fixed in dosexp(): ckuus3.c, 14 Jan 2004. Catch another copyright date. ckuus5.c, 14 Jan 2004. Fixed SWITCH to work even when SET COMMAND DOUBLEQUOTE OFF (from Mark Sapiro). ckuus5.c, 15 Jan 2004. Changed version to 8.0.211 so scripts can test for recently added features. ckcmai.c, 15 Jan 2004. Fixed a glitch in K95 "help set port". ckuus2.c, 20 Jan 2004. Fix from Jeff: Connections to a TLS-aware protocol which require a reconnect upon certificate verification failure could not reconnect if the connection was initiated from the command line or via a URL. ckctel.c ckcmai.c ckuusr.c ckuus7.c ckuusy.c, 20 Jan 2004. From Alex Lewin: makefile target and #ifdef for Mac OS X 10.3 (Panther): makefile, ckcnet.c, 7 Feb 2004. Added KFLAGS to sco32v507 targets to make PTY and SSH commands work. The same flags could probably also be added to earlier OSR5 targets but they have not been tested there. makefile, 7 Feb 2004. Checked a complaint that "LOCAL &a" did not make array \&a[] local. Indeed it did not, and can not. You have to use the full syntax in the LOCAL command, "LOCAL \&a[]", or else it doesn't know it's not a macro named &a. 7 Feb 2004. Fixed some confusion in creating IKSD database file and temp-file names. I was calling zfnqfp() without remembering that the path member of the returned struct included the filename, so to get just the directory name, I needed to strip the filename from the right. ckuusy.c, 2 Mar 2004. New ckuath.c, ck_ssl.c from Jeff. 2 Mar 2004. Updated Jeff's affiliation in VERSION command text. ckuusr.c, 2 Mar 2004. Designation changed from Dev.00 to Beta.01. ckcmai.c, 2 Mar 2004. Fixed zrename() syslogging -- it had success and failure reversed. Beta.02: ckufio.c, 4 Mar 2004. Problem: when accessing IKSD via a kermit:// or iksd:// URL, and a user ID is given but no password, doxarg() set the password to "" instead of leaving it NULL, but all the tests in dourl() are for NULL. Fixed in doxarg(): ckuusy.c, 5 Mar 2004. The logic in dourl() about which macro to construct (login and connect, login and get directory listing, or login and fetch a file) was a bit off, so all three cases were not handled. ckcmai.c, 5 Mar 2004. Trial Beta builds: . HP-UX B.11.11 PA-RISC . HP-UX B.11.23 IA64 . Tru64 4.0G Alpha . Tru64 5.1B Alpha . Debian 3.0 i386 . Red Hat ES 2.1 i386 . Slackware 9.1 i386 . VMS 7.3-1 Alpha + UCX 5.3 . VMS 7.3-1 Alpha no TCP/IP . VMS 7.3 Alpha MultiNet 4.3 A-X . SCO UnixWare 7.1.4 i386 . SCO OSR5.0.7 i386 . Solaris 9 Sparc Fixed compiler warning in doxarg() caused by typo (NULL instead of NUL) in the 5 March doxarg() edit. ckuusy.c, 9 Mar 2004. IKSD (kermit://) command-line URLs did not work right if the client had already preauthenticated with Kerberos or somesuch because they tried to log in again with REMOTE LOGIN. The macros constructed in doxarg() needed to check \v(authstate) before attempting REMOTE LOGIN. ckcmai.c, 10 Mar 2004. Added ckuker.nr to x.sh (ckdaily upload) and updated ckuker.nr with current version number and dates. 10 Mar 2004. Replaced hardwired references to /usr/local in makefile with $(prefix) (which defaults to /usr/local, but can be overridden on the command line), suggested by Nelson Beebe for use with Configure. 10 Mar 2004. From Nelson Beebe: In the Kermit makefile in the install target commands, line 981 reads: cp $(BINARY) $(DESTDIR)$(BINDIR)/kermit || exit 1;\ Could you please add this line before it: rm -f $(DESTDIR)$(BINDIR)/kermit;\ Some sites (mine included) keep multiple versions of software around, with hard links between $(prefix)/progname and $(prefix)/progname-x.y.z. Failure to remove the $(prefix)/progname at "make install" time then replaces the old $(prefix)/progname-x.y.z with the new one, destroying an old version that the site wanted to be preserved. makefile, 10 Mar 2004. Minor syntax and typo fixes (mostly prototypes): ckcdeb.h, ckcfns.c, ckclib.c, ckufio.c, ckuusr.h, ckuusx.c, 10 Mar 2004. (I still have a few more to do.) Added CC=$(CC) CC2=$(CC2) to many (but not all) makefile targets that reference other makefile targets. On some platforms (notably AIX, Solaris, SunOS) there are specific targets for different compilers, so I skipped those. makefile, 10 Mar 2004. Added error checking to kermit:// URL macros, so they don't plow ahead after the connection is closed. ckcmai.c, 11 Mar 2004. Added FreeBSD 4.9 and 5.1 targets (only the herald is affected). makefile, ckuver.h, 11 Mar 2004. Added "LIBS=-lcrypt" to bsd44 targets since nowadays crypt is almost always unbundled from libc. Also added explanatory notes. makefile, 11 Mar 2004. Changed MANDIR to default to $(manroot)/man/man1, and manroot to default to $(prefix). More adding of CC=$(CC) clauses: {Free,Net,Open}BSD, 4.4BSD. makefile, 11 Mar 2004. Miscellaneous cleanups: ckuusx.c, ckcnet.c, ckufio.c, 11 Mar 2004. Corrected the check in the linux target to see if /usr/include/crypt.h exists, and if so to define HAVE_CRYPT_H, which is used in ckcdeb.h to #include to get the prototype for crypt() and prevent bogus conversions on its return type on 64-bit platforms (the previous test wasn't quite right and the resulting symbol wasn't spelled right). makefile, 12 Mar 2004. From Jeff, 14 Mar 2004: . Initialize localuidbuf[] in tn_snenv(): ckctel.c. . Remove remote-mode checks in hupok() for K95G only (why?): ckuus3.c. . Add help text for new K95-only TYPE /GUI switches: ckuus2.c. . TYPE /GUI parsing, ...: ckuusr.c. . TYPE /GUI action, dotype(): ckuus6.c . Change Jeff's affiliation: most modules. 20 Mar 2004: Looked into adding long file support, i.e. handling files more than 2GB (or 4GB) long. Discovered very quickly this would be a major project. Each platform has a different API, or environment, or transition plan, or whatever -- a nightmare to handle in portable code. At the very least we'll need to convert a lot of Kermit variables from long or unsigned long to some new Kermit type, which in turn is #defined or typedef'd appropriately for each platform (to off_t or size_t or whatever). Then we have to worry about the details of open() vs fopen(); printf() formats (%lld vs %Ld vs %"PRId64"...), platforms like HP-UX where you might have to use different APIs for different file systems on the same computer, etc. We'll need to confront this soon, but let's get a good stable 8.0.211 release out first! Meanwhile, for future reference, here are a few articles: General: http://freshmeat.net/articles/view/709/ Linux: http://www.ece.utexas.edu/~luo/linux_lfs.html HP-UX: http://devrsrc1.external.hp.com/STK/partner/lg_files.pdf Solaris: http://wwws.sun.com/software/whitepapers/wp-largefiles/largefiles.pdf Looked into FTP timeouts. It appears I can just call empty() (which is nothing more than a front end for select()) with the desired timeout before any kind of network read. If it returns <= 0, we have a timeout. This is not quite the same as using alarm() / signal() around a recv() (which could get stuck) but alarm() / signal() are not not used in the FTP module and are not naturally portable to Windows, but select() is already in use in the FTP module for both Unix and Windows. This form of timeout could be used portably for both command response and data reads. What about writes to the command or data socket? They can get stuck for hours and hours without returning too, but the select() approach won't help here -- we need the actual send() or recv() to time out, or be wrapped in an alarm()/signal() kind of mechanism. But if we can do that for sends, we can also do it for receives. Better check with Jeff before I start programming anything. 20 Mar 2004. Later: Decided to postpone the above two projects (ditto IPv6) until after 8.0.211 is released because both will have major impacts on portability. Grumble: all i/o APIs should have been designed from the beginning with a timeout parameter. To this day, hardly any have this feature. 3-4 Apr 2004: More 8.0.211 Beta.02+ test builds: . FreeBSD 3.3 . FreeBSD 4.4 . Linux Debian 2.1 . Linux RH 6.1 . Linux RH 7.1 . Linux RH 7.2 . Linux RH 9 (with 84 different combinations of feature selection) . Linux SuSE 6.4 . Linux SuSE 7.0 . NetBSD 1.4.1 . NetBSD 1.5.2 . OpenBSD 2.5 . OpenBSD 3.0 . QNX 4.25 . SCO UnixWare 2.1.3 . SCO UnixWare 7.1.4 . SCO OpenServer 5.0.7 . SCO XENIX 2.3.4 (no TCP) Changes needed: None. Problem: SCO XENIX 2.3.4 network build failed in the FTP module with header-file syntax and conflicting-definitions trouble. I'm not going to try to fix it; 8.0.209 built OK with FTP, so we'll just keep that one available. Got access to VMS 8.1 on IA64. Building the nonet version of C-Kermit required minor modifications to ckvvms.h, ckv[ft]io.c, and ckvcon.c, to account for a third architecture. Also to SHOW FEATURES in ckuus5.c. Once that was done, the UCX 5.5 version built OK too. Starts OK, makes Telnet connection OK, sends files. Has some obvious glitches though -- "stat" after a file transfer reports 0 elapsed time (in fact it was 00:09:48) and 1219174400 cps (when in fact it was 10364). This doesn't happen on the Alpha. Btw, the IA64 binary is twice as big as the Alpha one. Changed to Beta.03. 5 Apr 2004. Fixed the ckdaily script to include the makefile and man page in the Zip file (they were not included because the Zip file was intended mainly for VMS users, but some Unix users prefer Zip to tar.gz). 6 Apr 2004. Traced problems in VMS/IA64 statistics report to rftimer()/gftimer() in ckvtio.c, which use sys$ and lib$ calls to figure elapsed time. These work on VAX and Alpha but not IA64. Sent a report to the chief engineer of the IA64 VMS port; he says it's probably a bug in VMS 8.1 (which is not a real release); he'll make sure it's fixed in 8.2. As an experiment, tried swapping in the Unix versions of these routines (which call gettimeofday() etc). They seem work just fine (it hung a couple times but I think that's because the underlying system hung too; trying it later on a new connection, it was fine; however I noticed a BIG discrepancy in throughput between sending and receiving). Moved definitions for VMS64BIT and VMSI64 to ckcdeb.h so all modules can use them and added them to the SHOW FEATURES display. Added VMSV80 definition to build procedure. Beta.03+. ckcdeb.h, ckcuus5.c, ckcvvms.h, ckvtio.c, ckvker.com, 6 Apr 2004. While doing the build-all, I noticed the VMS version did not build with Multinet or older UCX versions, always with the same errors -- undeclared variables, undefined symbols, all TCP/IP related. This didn't happen a couple weeks ago... Somehow the order of #includes was messed up -- ckuusr.h depended on symbols that are defined in ckcnet.h, but ckcnet.h was being included after ckuusr.h... this was compounded by two missing commas in ckvker.com. 11 Apr 2004. Removed Beta designation, released as 8.0.211, 10 Apr 2004. I had somehow lost the edit to ckutio.c that changed the UUCP lockfile for Mac OS X from /var/spool/uucp to /var/spool/lock. So I slipped it in and re-uploaded version 8.0.211. You can tell the difference because SHOW VERSIONS has 17 Apr 2004 for the Communications I/O module. Also the 10.3 executable now has a designer banner: "Mac OS X 10.3". makefile, ckuver.h, ckutio.c, ckuus[45].c, 17 Apr 2004. ---8.0.211--- Removed "wermit" from "make clean" (how did it get there?). makefile. From Jeff, applied 10 May 2004. . Rearrange #ifdefs that define OS/2-only features. ckcdeb.h. . Fix two strncat()s that should have been ckstrncat()s. ckuus7.c. . Fix two strncat()s that should have been ckstrncat()s. ckuus4.c. . Fix one strncat(). ckcfns.c. . SET FTP CHAR ON used backwards byte order when output to screen. ckcfns.c. . Fix two strncat()s. ckuus3.c. . Add SET NETWORK TYPE NAMED-PIPE for K95. ckuus3.c. . Add "No active connections" message to hupok(). ckuus3.c. . Fix many strncat()s. ckcnet.c. . Fix some strncat()s. ckcftp.c . Make FTP port unsigned short for 16383 < port < 65536. ckcftp.c. . Improvements to FTP USER command. ckcftp.c. . Fix FEAT parsing to allow for various forms of whitespace. ckcftp.c. S-Expression (AND FOO BAR) would not short-circuit if FOO's value was 0, even though short-circuiting code has been there since Day 1. Similarly for (OR BAR FOO). Turns out the first operand was a special case that bypassed the short-circuit check. Fixed in dosexp(): ckuus3.c, 10 May 2004. Red Hat 7.3 (and maybe others) referenced open() without first ensuring it was declared. The declaration is in , which is after in ckutio.c series of #includes. Made a special case for this. ckutio.c (see comments), 10 May 2004. If the local Kermit's parity is set to SPACE and then a file arrives via autodownload, automatic parity detection improperly switches it to NONE. Fixed in rpack() by switching parity automatically only if parchk() returns > 0 (rather than > -1), since NONE and SPACE are indistinguishable. A bigger problem still remains: autodownload does not work at all if the sender is using actual parity bits (even, odd, or mark) and the receiver's parity is NONE. ckcfn2.c, 10 May 2004. When a DIAL MACRO is defined and the phone number is comprised of more than one "word" (i.e. contains spaces), the dial macro loses the second and subsequent words after the first call. Fixed in xdial() by inserting quotes around phone number before passing it to xdial(). ckuus6.c, 10 May 2004. DIAL MACRO fix was not right; the quotes were kept as part of the phone number and sent to the modem. dodo() pokes its argument to separate the macro argument string into its component arguments. xdial() is called repeatedly on the same string, so after the first time, a NUL has been deposited after the first word of the telephone number. The fix is to have xdial() create a pokeable copy of its argument string before calling dodo(dial-macro,args...). It might seem odd that dodo pokes its argument, but making copies would be would be prohibitive in space and time. ckuus6.c, 23 May 2004. FTP CD did not stripe braces or quotes from around its argument. Fixed in doftprmt(): ckcftp.c, 23 May 2004. Added client side of REMOTE MESSAGE/RMESSAGE/RMSG: ckuus[r27].c, 23 May 2004. Server side of REMOTE MESSAGE: ckcpro.w, 23 May 2004. From Dave Sneddon: an updated CKVKER.COM containing a fix where the COMPAQ_SSL symbol was not defined but later referenced which generated an undefined symbol error. ckvker.com, 5 Jan 2005. From Andy Tanenbaum (28 May 2005): . Fix an errant prototype in ckcker.h and ckucmd.h - () instead of (void). . Add support for MINIX 3.0. makefile, ckutio.c, ckufio.c, ckuver.h. Fixed messed-up sndhlp() call which apparently had been jiggered to compensate for the bad prototype which has now been fixed, ckcpro.w, 12 Jun 2005. From Jeff (12 June 2005): . Security updates. ck_ssl.c, ck_crp.c, ckuath.c. . Fix bug in K95 SET PRINTER CHARACTER-SET. ckuus3.c. . Add printer character-set to K95 SHOW PRINTER display. ckuus5,c . Add SET MSKERMIT FILE-RENAMING to K95. ckuus7.c, ckuusr.h. . Add help for K95 SET MSKERMIT. ckuus2.c. . Add SET GUI CLOSE to K95. ckuusr.h, ckuus2.c, ckuus3.c . Add help text for K95 SET GUI MENUBAR and TOOLBAR. ckuus2.c. . Add --noclose command-line option for K95. ckuusy.c . Add PAM support for Mac OS X. ckufio.c. . Add GSSAPI support for Mac OS X. ckcftp.c. . Pick up more URL options. ckcker.h, ckuusy.c. . Fix bug in delta-time calculation across year boundary. ckucmd.c. . Add Secure Endpoints to copyright notices. ckcmai.c. . Fix FTP HELP to override unverbose setting. ckcftp.c. . Fix assorted minor typos. From Matthias Kurz: automatic herald generation for NetBSD 2.0 and later, "make netbsd2". ckuver.h, makefile, 12 Jun 2005. Added SET TERMINAL LF-DISPLAY, like CR-DISPLAY but for linefeed rather than carriage return. ckuusr.h, ckuus[257x].c, 12 Jun 2005. Made a command-line option --unbuffered to do what the -DNONOSETBUF compile-time option does, i.e. force unbuffered console i/o. Unix only. ckuusr.h, ckuusy.c, ckutio.c, 12 Jun 2005. Fixed getiact() (which displays TERM IDLE-ACTION setting) to display space as \{32}. ckuus7.c, 12 Jun 2005. Added LMV as a synonym for LRENAME, which is itself a synonym for LOCAL RENAME. ckuusr.c, 12 Jun 2005. Put HELP SET TERMINAL DG-UNIX-MODE text where it belonged. ckuus2.c, 12 Jun 2005. Added IF LINK (Unix only) to test if a filename is a symlink. Uses the most simpleminded possible method, calls readlink() to see if it succeeds or fails. No other method is dependable across different Unixes. This code should be portable because I already use readlink() elsewhere within exactly the same #ifdefs. ckufio.c, ckuus2.c, ckuus6.c, 12 Jun 2005. Fixed a bug in which \fdir() wouldn't work when its argument was the nonwild name of a directory file. zxpand(): ckufio.c, 12 Jun 2005. Made \fdirectory() a synonym for \fdirectories(). Made \fdir() an acceptable abbreviation for these, even though it clashes with \fdirname(), which still works as before. ckuus4.c, 12 Jun 2005. Added the long-needed \flopx() function, to return rightmost pieces of strings, such as file extensions. \fstripx() and \flopx() are the orthogonal functions we need to pick filenames apart from the right: \stripx(foo.tar.gz) = foo.tar; flopx(foo.tar.gz) = gz. ckuusr.h, ckuusr.c, ckuus2.c, 12 Jun 2005. Removed reference to defunct fax number, ckcmai.c, 12 Jun 2005. Added -DHAVE_PTMX to linux+krb5+openssl+zlib+shadow+pam. From Timothy Folks. makefile, 12 Jun 2005. Built on Solaris 9 and NetBSD 2.0. From Jeff: New build target for Mac OS X 10.3 with Kerberos 5 and SSL. makefile, 14 Jun 2005. Fixed error in ckuver.h NetBSD #ifdefs. 15 Jun 2005. Fixed SET TERMINAL IDLE-ACTION OUTPUT to work as documented, namely if the output string is empty, to send a NUL. Previously there was no way to make it send a NUL. ckuus7.c, 15 Jun 2005. Suppose (in Unix, for example) a filename contains wildcard characters, such as {abc}.txt. When referring to such a file (e.g. in a SEND command), these characters can be quoted, e.g. \{abc\}.txt. But if the file list has been obtained programmatically, e.g. stored in an array, there is no way, short of tedious, complicated, and error-prone string processing, to reference the file. For this we need a way to disable wildcard processing. I added { ON, OFF } choices for the SET WILD and SHOW FILE commands: ckuusr.h, ckuus[234].c. { ON, OFF } turns wildcarding off and on without affecting the { KERMIT, SHELL } agent choice; it does this by setting a new and separate global variable, wildena. Added semantics to ckufio.c. Crude but effective. It might have been more Unixlike to add Yet Another form of quoting but we have enough of that already (later maybe I'll add a \function() for this). Needs to be propogated to Windows and VMS. 15 Jun 2005. Improved and fixed typos in HELP WILDCARD and HELP PATTERN. ckuus2.c, 15 Jun 2005. The GREP command, and probably anything else that uses ckmatch() for pattern matching, failed on patterns like */[0-3]*.html. The [a-b] handler, when failing to match at the current position, neglected to back up the pattern and try again on the remainder of the string. I also fixed another case, in which matching a literal string a*b?c against the pattern a[*?]*[?*]c caused ckmatch() to recurse until it blew up. ckclib.c, 16 Jun 2005. Added builds and designer banner for Solaris 10. makefile, ckuver.h, 27 Jun 2005. Defined CKHTTP for NetBSD, the HTTP code builds and works fine there. ckcdeb.h, 2 Jul 2005. Added #ifndef OSF40..#endif around definition of inet_aton() in ck_ssl() to allow building in Tru64. Added tru64-51b+openssl to makefile. 15 Jul 2005. HTTP GET would fail if the URL contained any metacharacters, no matter how much you quoted them. Although it uses cmfld() to parse the (partial) URL, it then uses cmofi() to get the output filename, which by default is the "filename" from the URL, which might be something like "rankem.asp?id=1639". cmofi() refuses to accept unquoted metacharacters in "filenames" and that's what happens in this case if the output filename is not specified. Worked around this by disabling wildcard processing around HTTP GET using the new "wildena" variable from June 15th. ckuusr.c, 18 Jul 2005. Fixed the June 16th fix to the pattern matcher. I fixed a real problem, but I made an unrelated optimization that introduced new ones. ckclib.c, 18 Jul 2005. Added missing help text for \fb64encode() and \fb64decode(). ckuus2.c, 18 Jul 2005. Changed SET WILD OFF help text to warn that this setting prevents the creation of backup files (later I'll have to see if something more useful can be done about this). ckuus2.c, 18 Jul 2005. Built OK on Mac OS X 10.4.2 using macosx103 target (but with some "signedness" warnings in ckcnet.c and ckcftp.c). Built on Unixware 7.1.4 with uw7 target. 27-28 Jul 2005. Added -DCKHTTP to Mac OS X 10.3-.4 KFLAGS. Makefile, 4 Aug 2005. Built on BSDI 4.3.1. Added -DCKHTTP. Compact substring notation extended to accept not only start:length but also start-end notation. Thus \s(foo[12:18]) means the substring of foo starting at position 12 of length 18, and tne new \s(foo[12-18]) means the substring of foo starting at position 12 and ending with position 18. Ditto for \:(\%a), etc. ckuus4.c, 9 Aug 2005. See correspondence with Mark Sapiro, Nov 2003 and Sep 2004, about certain variations on IF syntax having been broken by the introduction of "immediate macros" circa 1999. It seems the problem -- variables not being expanded -- always occurs in the ELSE part when (a) the IF condition is false; (b) the ELSE command is "standalone", i.e. expressed as a separate command after the IF command (original C-Kermit 5A syntax), and (c) its command list is a block. This would suggest the problem is in the XXELS parser. Going back to 1999, I find this: Fixed a problem Jim Whitby noticed with quoting in ELSE statements. This problem was introduced when I unified IF and XIF, and occurs only when ELSE begins on a line, followed by a { command list } rather than a single command. The solution (gross) was to make a special version of pushcmd() (called pushqcmd()) for this situation, which doubles backslashes while copying, BUT ONLY IF it's a command list (i.e. starts with "{"); otherwise we break lots of other stuff. Result passes Jim's test and still passes ckedemo.ksc and iftest.ksc. ckucmd.c, ckuus6.c, 27 Sep 99. I undid this change and it made no difference to all the other IF constructions (in fact, it fixed an urelated one that was broken, so now iftest scores 54 out of 54, instead of 53). However, it does not fix the ELSE problem; in fact it pushes it all the way in the other direction: The opposite occurs any time you try to execute an immediate macro inside a macro or any other { block }: not only is the variable evaluated, it is evaluated into nothing. It looks like this happens only in immediate macros, i.e. *commands* that start with '{'. So maybe we really have two isolated problems, that can each be fixed. The situation is illustrated by this simple script: def xx { if false { echo \%1, echo \%2 } else { echo \%3, echo \%4 } } xx one two three four With pushqcmd() it echoes the variable names literally; with pushcmd() it echoes empty lines. Since ELSE, when its argument is a block, dispatches to the immediate-macro handler, it seems we have unified the two problems, so fixing one should fix the other. The problem is that we define a new temporary macro and then call dodo() to execute it. But if the definition contains macro arguments, we have added a new level of macro invocation, thus wiping out the current level of args. The cure is to expand the variables in the immediate macro in the current context, before executing it. This means simply changing the cmtxt() call that reads the immediate macro to specify xxsting as its processing function, rather than NULL, which is used for real macros to defer their argument evaluation until after the macro entered. ckuusr.c, 11 Aug 2005. Added a new makefile target, macosx10.4, for Mac OS X 10.4. This one uses an undocumented trick to get the otherwise unavailable-except-by-clicking Mac OS X version number (in this case 10.4.2) and stuff it into the HERALD string. makefile, 11 Aug 2005. Built OK on Solaris 9, Solaris 10 (with a few implicit declaration warnings in ckuusx.c), Mac OS X 10.4.2 (with some warnings in ckcnet.c and ckcftp.c), Mac OS X 10.3.9 (also using the macos10.4 entry, which gets the right version number, and gets no warnings at all), RH Enterprise Linux AS4 on AMD x86_64, Tru64 Unix 4.0F, SCO UnixWare 7.1.4 For docs and/or scriptlib: Unix C-Kermit can be a stdin/out filter. The trick is to use the ASK, ASKQ, or GETC command for input, specifying no prompt, and ECHO or XECHO for output, e.g.: while true { ask line if fail exit 0 echo \freverse(\m(line)) } exit 0 FOPEN didn't do anything with the channel number if the open failed, so any subsequent command that tried to reference it would get a parse error it was undefined or non-numeric, not very helpful. Changed FOPEN to set the channel number to -1 if the file can't be opened. Now subsequent operations on the channel fail with "Channel -1: File not open". I also added two magic channel numbers: -8 means that any FILE command (besides OPEN and STATUS) on that channel is a noop that succeeds silently; -9 is a noop that fails silently. So now it's possible to simply set a channel number to one of these values to disable i/o to certain file without getting lots of error messages. dofile(): ckuus7.c, 12 Aug 2005. Added automatic herald construction for UnixWare 7. makefile, 12 Aug 2005. Unix isdir() never allowed for arguments that started with tilde, so gave incorrect results for ~/tmp/ or ~fdc. The problem was mainly invisible since most commands that parsed file or directory names used cmifi(), cmdir(), etc, which did the conversions themselves. But IF DIRECTORY was an exception, since its operand had to be treated as just text, and then tested after it was parsed. ckufio.c, 13 Aug 2005. Fixed the following: "ckuusx.c", line 8959: warning: implicit function declaration: ckgetpeer "ckufio.c", line 1869: warning: implicit function declaration: ttwait "ckufio.c", line 2941: warning: implicit function declaration: mlook "ckufio.c", line 2943: warning: implicit function declaration: dodo "ckufio.c", line 2944: warning: implicit function declaration: parser "ckcftp.c", line 2625: warning: implicit function declaration: delta2sec "ckcftp.c", line 4071: warning: no explicit type given for parameter: prm "ckcftp.c", line 8389: warning: no explicit type given for parameter: brief ckuusx.c, ckufio.c, ckcftp.c, ckucmd.h. 13 Aug 2005. Unbuffered stdout code has never worked because the setbuf(stdout,NULL) call has to occur before the stdout has been used. The reason it's needed is that some Kermit code writes to stderr (which is unbuffered) and other code writes to stdout, and therefore typescripts can come out jumbled. Robert Simmons provided the needed clue when he insisted it worked only when executed at the very beginning of main(). So I moved the code to that spot. But since now we also want to make unbuffered a runtime (command-line) option, I had to do a clunky by-hand pre-prescan inline in main() to look thru argv[], even before prescan() was called. ckcmai.c, ckutio.c, ckuusy.c, 13 Aug 2005. (Now that this works, it might be a good idea to remove all use of stderr from Kermit.) Managed, after some finagling, to build a 64-bit version on Solaris 10 at Utah Math with Sun cc. (Can't make any gcc builds at all, 32- or 64-bit, they all blow up in .) New target: solaris10_64. makefile, 15 Aug 2005. The 64-bit Solaris 10 version compiles and links OK and transfers files in remote mode. It can make FTP connections and use them, but Telnet connections always fail with "network unreachable". This is with all default libs and include files. Nelson has a separate set in /usr/local, which he references explicitly in all his 64-bit builds, but using these makes no difference. Some data type is wrong in ckcnet.c. But telnet works fine in 64-bit Linux and Tru64 builds. Debug logs trace the difference to netopen() (of course), the spot where we test the results of inet_addr(), which is already marked suspicious for 64-bit builds. It seems that inet_addr() is of type in_addr_t, which in turn is u_int32, i.e. an unsigned 32-bit int. Yet the man page says that failure is indicated by returning -1. I guess this doesn't matter in 32-bit builds, but in the 64-bit world, the test for failure didn't work right. I made a Solaris-specific workaround, and checked that it works in both 32-bit and 64-builds. I really hate typedefs. ckcnet.c, 15 Aug 2005. Changed the plain-text version (as opposed to the popup or GUI version - the GUI version, at least, already does this) of ASKQ to echo keystrokes asterisks rather than simply not echo anything, so it's easier to see what you're doing, the effects of editing, etc. Experimental; for now, there's no way to disable this. Not sure if there needs to be. Anyway, to get this working required a fair amount of cleaning up of gtword(), which was echoing different ways in different places. ckuus6.c, ckucmd.c, 15 Aug 2005. Added a solaris9_64 target for building a 64-bit version on Solaris 9 with Sun cc. Verified, using the DIR command and \fsize() function on a 4.4GB file, that the Solaris 64-bit version of Kermit gets the size correctly, and that it can copy such a file (thus its fopen/fread/fwrite/fclose interface works right). Initiated a large-file transfer between here and Utah over SSH and verified that it puts the correct file size in the A packet when sending; the right quantites are shown on the file transfer display (file size CPS, percent done, etc). But even at 5Mb/sec, it takes a good while to transfer 4.4GB, more than 2 hours (not streaming; 30 window slots, 4K packets, maybe it would go faster with streaming)... After an hour or so, it filled up the partition and gave up (gracefully) before it reached the 2GB frontier (drained its pending packets, closed the partial file). Restarted at 12:54, this time with streaming and 8K packets (the speed wasn't significantly different). This time it transferred 95% of the file (4187660288 bytes) before failing because the disk filled up. Went to Utah and started a transfer between two Solaris 10/Sparc hosts; this goes about 8 times faster. The transfer completed successfully after 17m41s. All fields in the f.t. display looked right the whole time. Then I verified various other 64-bit combinations transferring the same 4.4GB file: To................ From Sol Amd i64 Tru Sol OK OK OK OK Sol = Solaris 10 / Sparc Amd OK Amd = AMD x86_64 RH Enterprise Linux AS4 i64 OK i64 = Intel IA64, RH 2.1AS Tru Tru = Tru64 Unix 4.0F Alpha (The other combinations are difficult to test for logistical reasons.) Tried sending the same long file with Kermit's FTP client. It chugged along for a while until I stopped it; it would have taken hours to complete. There is no indication that it wouldn't have worked, assuming the FTP server could also handle long files, which who knows. Anyway, Kermit showed all the right data on the display screen. 17 Aug 2005. On AMD x86_64 and IA64 native 64-bit Linux builds, the pty routines did not work at all. ptsname() dumped core. If I commented out ptsname(), then the next thing dumped core. The same code works on the other 64-bit builds. Poking around, I see that this version of Linux has an openpty() function, which I could try using instead of the current API -- grantpty(), etc. Then I see that openpty() is already coded into Kermit's pty module, conditionalized under HAVE_OPENPTY, which has never before been defined for any build. I added a test to the makefile linux target (look for the openpty() prototype in , if found define HAVE_OPENPTY as a CFLAG and also add -lutil to LNKFLAGS). Works fine on the problem builds, and also on previously working 32-bit builds. makefile, 17 Aug 2005. Fixed a bug in the ASKQ echo asterisks code, which made the VMS version of C-Kermit always echo asterisks. Turns out that some code in the main parse loop to reset command-specific flags was in the wrong place, which had other effects too, for example ASKQ temporarily turns off debug logging as a security measure, but the code to turn it back on was skipped in most cases. Some other side effects related to the DIRECTORY and CD commands might have been possible but I haven't seen them. ckuus[56].c, 23 Aug 2005. Problem reported when sending a file to VMS when the name in the F packet starts with a device specification and does not include a directory field, and PATHNAMES are RELATIVE. Example: dsk:foo.bar becomes f_oo.bar. The code assumes that if there is a device field, it is followed by a directory field, and it inserts a dot after the '[', which in this case is not there. Later the dot becomes '_' because of the only-one-dot rule. Solution: only insert the dot if there really is an opening bracket. nzrtol(): ckvfio.c, 23 Aug 2005. A report on the newsgroup complains that C-Kermit and K95 servers were sending REMOTE DIR listings with only #J line terminators, rather than #M#J. Yet all the other REMOTE xxx responses arrived with #M#J. snddir() was neglecting to switch to text mode. ckcfns.c, 26 Aug 2005. Back to long files. What happens if 32-bit Kermit is sent a long file? It gets an A-packet that looks like this: ^A_"A."U1""B8#120050815 18:28:03!'42920641*4395073536,#775-!7@ )CP The 32-bit receiver reacts like so: gattr length[4395073536]=100106240 the first number being the string from the A-packet, the second being the value of the long int it was converted to by atol(). Clearly not equal in this case. When this happens Kermit should reject the file instead of accepting it and then getting a horrible error a long time later. Added code to gattr() to convert the result of atol() back to a string and compare it with the original string; if they're not equal, reject the file on the assumption that the only reason this could happen is overflow. Also some other code in case the sender sends the only LENGTHK attribute. Now files whose lengths are too big for a long int are rejected right away, provided the sender sends the length in an A packet ahead of the file itself. If this new code should ever cause a problem, it can be bypassed with SET ATTRIBUTE LENGTH OFF. ckcfn3.c, 26 Aug 2005. As I recall from when I was testing this a few weeks ago, when the too-big length is not caught at A-packet time, the transfer fails more or less gracefully when the first attempt is made to write past the limit. I went to doublecheck this by sending a big file from the 64-bit Solaris10 version to a 32-bit Mac OS X version that does not have today's code. The Mac thinks the incoming file is 2GB long when it's really 4GB+. But in this case, something new happens! Although the percent done and transfer rate go negative, the file keeps coming. It would seem that Mac OS X lets us create long files without using any special APIs. The transfer runs to completion. Mac OS X Kermit says SUCCESS (but gets the byte count and cps wrong, of course). But then a STATUS command says FAILURE. The file was, however, transferred successfully; it is exactly the same length and compares byte for byte with the original. This tells me that in the Mac OS X version -- and how many others like it??? -- today's rejection code should not be enabled. Meanwhile I put today's new code in #ifndef NOCHECKOVERFLOW..#endif, and defined this symbol in the Mac OS X 10.4 target. Over time, I'll have to find out what other platforms have this characteristic. And of course I'll also have to do something about file-transfer display, statistics, and status. makefile, ckcfn3.c, 26 Aug 2005. From now on I'm going to bump the Dev.xx number each time I upload a new ckdaily. This one will be Dev.02. ckckmai.c, 26 Aug 2005. Got rid of all the extraneous FreeBSD 4 and 5 build targets. Now there's one (freebsd) for all FreeBSD 4.1 and later. makefile, 27 Aug 2005. Mac OS X 10.4 (Tiger) is a 64-bit OS. Building C-Kermit 0n 10.4.2 without any special switches stilll gives a 32-bit executable. Ditto building with -mpowerpc64. Further investigation turned up a tip sheet on MySQL that says you have to include all of these: -mpowerpc64 -mcpu=G5 -mtune=G5 -arch ppc64. That did the trick. New makefile target: macosx10.4_64. But the 10.4.2 system I tried did not have 64-bit [n]curses or resolv libs, so this build has no -DNOCURSES -DNO_DNS_SRV. makefile, 27 Aug 2005. Created a symbol CK_64BIT to indicate true 64-bit builds at compile time. Added 64-bit announcement to the startup herald and the VERSION text. ckcdeb.h, ckuus[r5].c, 27 Aug 2005. Added a built-in variable \v(bits) to indicate the size of the build (16, 32, 64, or whatever else sizeof() might report). ckuusr.h, ckuus4.c, 27 Aug 2005. Got rid of all the warnings in 64-bit Mac OS X about args to getsockopt(), getsockname(), and getpeername(), and the comparisons on the return value of inet_addr(). ckcnet.[ch], 27 Aug 2005. Now to check the effects on other builds... Linux on AMD64: ok. Linux on IA64: ok. Linux on i386: ok. Mac OS X 10.3.9 32-bit: ok. Solaris 10 64-bit: ok. Solaris 9 32-bit: ok. Tru64 4.0F: ok. FreeBSD 4.11: ok. FreeBSD 5.4 ia64 (64-bit): ok. FreeBSD 5.4 i386 (32-bit): ok. The Tru64 5.1B build totally blew up because they have their own unique sockopt/etc length-argument data type (int!), so I had to roll back on using socklen_t for this in all 64-bit builds. Checked to make sure it still builds on Tru64 4.0F after this change (it does). ckcnet.h, 27 Aug 2005. The HP-UX 11i/ia64 build comes out to be 32-bit but thinks it's 64-bit. CK_64BIT is set because __ia64 is defined. So how do I actually make a 64-bit HP-UX build? I tried adding +DD64 to CFLAGS, and this generates 64-bit object files but linking fails to find the needed 64-bit libs (e.g. -lm). For now I added an exception for HPUX to the CK_64BIT definition section. ckcdeb.h, 27 Aug 2005. Took the time to verify my recollection about the "graceful failure" on a regular Pentium Linux system when receiving a too-big file... OK, it's not exactly graceful. It gets a "File size limit exceeded" error; the message is printed in the middle of the file-transfer display, apparently not by Kermit, and Kermit exits immediately. Looks like a trap... Yup. "File size limit exceeded" is SIGXFSZ (25). What happens if we set it to SIG_IGN? Just the right thing: The receiver gets "Error writing data" at 2147483647 bytes, sends E-packet to sender with this message, and recovers with total grace (drains packet buffers, returns to prompt). ckutio.c, 27 Aug 2005. Backed off from rejecting a file because its announced size overflows a long. Now instead, I set the file size to -2 (a negative size means the size is unknown, but we have always used -1 for this; -2 means "unknown and probably too big"). In this case, the f-t display says: File Size: POSSIBLY EXCEEDS LOCAL FILE SIZE LIMIT then the user can interrupt it with X or whatever, or can let it run and see if maybe (as in the case of Mac OS X) it will be accepted anyway. This way, we skip all the bogus calculations of percent done, time remaining, etc. ckcfn3.c, ckuusx.c, 27 Aug 2005. Discovered that VMS C-Kermit on Alpha and IA64 is a 32-bit application; sizeof(long) == sizeof(char *) == 4. Tried adding /POINTER_SIZE=64 to VMS DECC builds on Alpha and IA64, but the results aren't great. Tons of warnings about pointer size mismatches between Kermit pointers and RMS ones, and the executable doesn't run. It appears that access to long files would require a lot of hacking, similar to what's needed for 32-bit Linux. --- Dev.02: 27 Aug 2005 --- From Jeff, 28 Aug 2005. . Fix SSH GLOBAL-KNOWN-HOSTS-FILE / USER-KNOWN-HOSTS-FILE parsing, ckuus3.c. . Pick up K95STARTFLAGS from environment, ckuus4.c. . Fix some typos in command-line processing (-q), ckuus4.c. . Be sure to suppress herald if started with -q, ckuus7.c. . Fix ssh command-line switches, ckuusy.c. Eric Smutz complained that HTTP POST was adding an extraneous blank line, which prevented his application from successfully posting. RFC 2616 states (in Section 4.1): In the interest of robustness, servers SHOULD ignore any empty line(s) received where a Request-Line is expected. In other words, if the server is reading the protocol stream at the beginning of a message and receives a CRLF first, it should ignore the CRLF. Certain buggy HTTP/1.0 client implementations generate extra CRLF's after a POST request. To restate what is explicitly forbidden by the BNF, an HTTP/1.1 client MUST NOT preface or follow a request with an extra CRLF. This seems pretty clear. One section of code in http_post() (just above the postopen: label) was appending a CRLF to a buffer whose last already was terminated by CRLF, and then appended a second CRLF; thus two empty lines. I removed the second one. ckcnet.c, 28 Aug 2005. I looked into the 64-bitness of NetBSD, it seems to be like Linux and FreeBSD on 64-bit hardware, i.e. you just build it there and it works, at least on Alpha and AMD64, going back to NetBSD 1.4 or 1.5. But I don't have access to any of these for verification and documentation on the Web is scanty. Checked PeterE's complaint again of warnings in ckutio.c about parameter list of get[ug]id() and gete[ug]id(). When I "make hpux1100o" on HP-UX 11.11 (PA-RISC), there are definitely no warnings. He says the same thing happens on 10.xx, but I don't have access to that any more. I also did "make hpux1100o" on HP-UX 11.23 (11i v2) (PA-RISC), also no warnings. (Except in both cases, a warning about a comment within a comment in /usr/include/sys/ptyio.h). On HP-UX 11i v2 on Itanium, however, there are TONS of warnings, mostly of the "variable set but never used" kind. Also "dollar sign used in identifier". Tracking this last one down, I see it's complaining about code that's in #ifdefs for other platforms, such as Apollo Aegis. Is "aegis" defined in HP-UX 11i v2/IA64? No! (It would show up in SHOW FEATURES if it was.) Some phase of the compiler is complaining about code that it should be skipping (and that, in fact, it *is* skipping it because the build is successful). It's as if cc is running lint for me but not telling lint which macros are defined and which are not. Verified that 64-bit linking fails in the same way for HP-UX 11i v2 on both IA64 and PA-RISC. Sent a query to HP. Compiling ckcnet.c and ckcftp.c got the familiar sockopt-related warnings on HP-UX 11i v2; turns out it is just like Tru64 Unix in using an int for the length argument. Added another special case and the warnings went away. ckcnet.h, 28 Aug 2005. Added some stuff to SHOW FEATURES to see what kinds of macros are exposed (e.g. INT_MAX, LONG_MAX, LLONG_MAX, etc) and also show sizeof(long long) and sizeof(off_t). Building this code all over the place will give me an idea of how widespread these data types are, and to what extent I can tell whether they are available from clues in the header files. (At first glance, it appears that I'm not picking up , but adding an #include for it is just asking for trouble.) No complaints about long long or off_t from Solaris 9 or recent Linuxes. ckuus5.c, 28 Aug 2005. Fixed a warning in HP-UX 10 and 11 stemming from some old-style prototypes in ckutio.c for get[re][gu]id(). ckutio.c, 29 Aug 2005. Updated minix3 target from Andy Tanenbaum. makefile, 29 Aug 2005. PeterE confirms that "long long" and off_t are available in all HP-UX 10 and 11, and in HP-UX 9 on PA-RISC but not Motorola. 30 Aug 2005. Got 64-bit builds to work on HP-UX. According to my notes, John Bigg of HP said (in 1999) that HP-UX 10.30 and later require PA-RISC 1.1, and do not work on PA-RISC 1.0. But is PA 1.0 64-bit or what? Today, Alex McKale of HP said "The 64-bit binaries will work on all machines that have the same or later release of HP-UX (excluding PA-RISC 1.1 machines)". Still need clarification... Maybe it's that all IA64 builds can be 64-bit but I need dual builds for PA-RISC. Meanwhile I started transfer of a 4GB+ file from Solaris to HP-UX 11i but it exceeded some quota on the HP long before it approached the 2G point. It failed cleanly and up until then it was working fine (numbers, stats, etc). 30 Aug 2005. Support of large files in 32-bit builds began in 10.20. 64-bit application support began in 11.00, but not all machines that run 11.00 support 64 bits. About long files, see HP /usr/share/doc/lg_files.txt. PeterE found that certain patterns can still make Kermit loop; example: if match T01011-00856-21-632-073 *[abc] { echo GOOD } else { echo BAD } if match T01011-00856-21-632-073 *[a-z] { echo GOOD } else { echo BAD } The minimum offending pattern is * followed immediately by an [xxx] construction, followed by anything else, including nothing. Previous versions of Kermit handled this one correctly, without looping (but failed certain matches that should have succeeded). The new section of code I added on 15 June, upon failure to match, advances the string pointer and backs up the pattern to the previous pattern, and starts again (recursively). However, there needed to be a corresponding check at entry for an empty target string. ckmatch(): ckclib.c, 12 Sep 2005. PeterE discovered that "kermit -y filethatdoesnotexit" gives an erroneous error message that names the user's customization, rather than the name given on the command line. doinit(): ckuus5.c, 12 Sep 2005. FREAD does not get an error if it tries to read a record or file or piece of file that is too big for its buffer. In particular, FREAD /SIZE:xxx seems to succeed even if less than xxx was read. It should fail unless, perhaps, it successfully read up to the end of the file. Furthermore, if xxx is bigger than the file buffer size, it should complain. The buffer is line[LINBUFSIZ], 32K. The lack of failure was due to code in dofile() that adjusted the given size silently if it was greater than the buffer size, which I removed, and also added a check when parsing the /SIZE: switch. dofile(): ckuus7.c, 12 Sep 2005. That still didn't help with FREAD /SIZE:n returning less than n bytes, even when they were available. That's because the underlying routine, z_in(), didn't check fread()'s return code, which is the number of bytes read. If fread() has smaller buffers, it needs to be called in a loop. z_in(): ckuus7.c, 12 Sep 2005. Flen() fails on strings of length 8192 or more. The limitation is in the callers of zzstring, which seem to be specifying an 8K buffer, in this case fneval(). The operable symbols are FNVALL (max length of value returned by a function) and MAXARGLEN (maximum length of an argument to a function). I changed both of these for BIGBUFOK builds to be CMDBL. Buffers can never be infinite, there has to be a limit. It's important to make everything work consistently within that limit, and to make something useful happen when the limit is exceeded. At this point, I can probably also increase the limits for modern 32-bit systems, and certainly for 64-bit ones. Also there's no point in worrying about 16-bit platforms any more; earlier C-Kermit versions can still be used on them if necessary. ckuusr.h, 12 Sep 2005. Special #ifdefs for finding resolv.h and nameser.h in MINIX3 from Andy Tanenbaum. ckcnet.c, 20 Sep 2005. PeterE noticed that ckmatch(), even though it works pretty well now, does a lot of extra and unnecessary recursion after determining the string and pattern do not match, at least when the pattern is of the form *[abc]. After several false starts I was able reduce this effect to a minor level (but not eliminate it all together) by changing a while loop into a do loop. ckmatch(): ckclib.c, 15 Oct 2005. Added -DNOLONGLONG to HP-UX 8.00 and earlier builds, and to Motorola-based HP-UX 9.00 builds. This is simply to inhibit the test for whether "long long" is supported by the compiler, since when it isn't, the module containing the test won't compile. makefile, ckuus5.c, 16 Oct 2005. Making ASKQ always echo askterisks is a bad idea, because when it doesn't echo, it's the perfect way to read silently from stdin, e.g. in a CGI script (INPUT can also be used for this but it's not as straightforward). So I put the default for ASKQ back to no echoing, then gave ASKQ its own switch table, which is the same as for ASK with the addition of an /ECHO:x switch, which tells what character to echo. ckucmd.c, ckuus[26].c, 17 Oct 2005. Fixed a bug in FTP GET /COMMAND filename commandname; it always dumped core dereferencing a null string (the nonexistent local asname). ckcftp.c, 17 Oct 2005. For docs: if you don't like the funny business that happens when you type an IF command at the prompt, use XIF instead and it won't happen. Also note that commands like "if xxx { echo blah } else { echo blah blah }" don't work when typed at the prompt; you have to use XIF for this. Back to ckmatch()... Under certain conditions (e.g. patterns like *[abc]) failure to match would not stop the recursion because the string and pattern arguments are on the stack, as they must be, so there was no way for level n-1 to know that level n had detected a definitive nonmatch and that no further attempts at matching were required. The right way to handle this is to recode the whole thing as coroutines, the cheap way out is with a global static flag. Works perfectly, in the sense that the match.ksc test results are identical to what they were before and the extra backing up and recursion are eliminated. (The Oct 15th fix wasn't really a fix, it broke a couple of cases.) ckclib.c, 20 Oct 2005. ckuus7.c(2987): warning #267: the format string requires additional arguments (in PURGE command); fixed 20 Oct 2005. From Andy Tanenbaum, final changes for MINIX3: #ifdef out the inline definitions for gettimeofday() and readlink(). ckutio.c, 23 Oct 2005. From Jeff: struct gss_trials initializers changed from gss_mech_krb5 to ck_gss_mech_krb5. ckcftp.c, 23 Oct 2005. From Jeff: some improvements to K95 GUI SHOW TERMINAL. ckuus5.c, 23 Oct 2005. Found and corrected some misplaced #ifdefs in shofeat(), ckuus5.c, 23 Oct 2005. --- Dev.03 --- Fixed a compiler warning in a debug() statement in zzstring() by adding parens. ckuus4.c, 24 Oct 2005. Added -DNOLONGLONG to sv68r3v6 target, makefile, 25 Oct 2005. New makefile targets for HP-UX from PeterE to handle the 'long long' situation. 26 Oct 2005. From Jeff: changes to support OpenSSL 0.9.8, ck_ssl.h. ckcasc.h has had short names defined for ASCII control characters for 20-some years but now they are causing conflicts, so EM becomes XEM (also for OpenSSL 0.9.8). Changed K95's default terminal type from VT320 to VT220 because VT320 termcaps/terminfos are disappearing from Unix hosts: ckuus7.c. Reorganize the data-types section of SHOW FEATURES to add more macro tests for integral sizes and to provide for the proper printf formatting in order to allow the sizes to be output ("You are going to need to be careful because %llx is not supported on all platforms. On Windows, it is the same as %lx, 32 bits"): ckuus5.c, 26 Oct 2005. Defined NOLONGLONG ckcdeb.h for various old platforms where we know we are never going to need 64-bit ints (even if they support a long long datatype, chances are pretty slim they supported 64-bit file sizes). ckcdeb.h, 26 Oct 2005. PeterE noticed that GOTO targets can only be 50 characters long. This was by design, a long time ago, on the assumption that nobody would make longer labels. But in SWITCH statements, case labels can be variables that expand to anything at all. If we chop them off at 50, we might execute the wrong case. Changed the maximum label size to be 8K, and added code to dogoto() to check when a label or target is too long and fail, to prevent spurious GOTO or SWITCH results. ckuusr.h, ckuus[r6].c, 26 Oct 2005. Testing revealed there was still a problem with SWITCH case labels that were variables that expanded into long strings. Turns out that I was being too clever when I decided that, if the SWITCH macro was n1 characters long and the case-label search target was n2 characters long, I only had to search the first n1-n2+1 characters of the macro definition. That was true before I allowed case labels to be variables, but not any more! Fixed in dogoto(): ckuus5.c, 26 Oct 2005. --- Dev.04 --- Dev.04 didn't actually contain Jeff's data-type changes to shofeat(), I think I saved the wrong buffer in EMACS... Fixed now. 27 Oct 2005. PeterE corrected a typo in the HP-UX 7.00 makefile target. 27 Oct 2005. PeterE had been reporting problems stress-testing the new SWITCH code, but only on HP-UX 9, primarily stack overrun. Turns out to be the HP-UX 9 optimizing compiler's fault. No optimization, no problems. PeterE found that even when dogoto() detects a string that is too long and fails, this does not stop SWITCH from producing a result, which can not possibly be trusted. Changed the part of dogoto() that handles this to not just fail, but also to exit the script immediately and return to top level. ckuus6.c, 28 Oct 2005. An idea popped into my head after having typed too many commands like "dir ck[cuw]*.[cwh]" to check the list of matching files, and then having to retype the same filespec in a SEND command: Why not unleash some unused control character such as Ctrl-K to spit out the most recently entered input filespec? It was easy, just a few lines in cmifi2() and gtword(), plus a couple declarations. To see all the changes, search for "lastfile" (all the new code is protected by #ifndef NOLASTFILE). ckucmd.c, 28 Oct 2005. I added a new variable \v(lastfilespec) that expands to the same last filespec, for use in scripts. ckuusr.h, ckuus4.c, 28 Oct 2005. The Unix version of C-Kermit failed to put anything in the session log if SET TERMINAL DEBUG ON. Rearranged the pertinent clause so logging happens independent of TERMINAL DEBUG. For now, since the user who noticed this wanted debug format to go into the session log, that's what I do. The alternative would be to just log the raw incoming stream as usual, or to add Yet Another SET Command to choose. ckucns.c, 11 Nov 2005. Fixed HELP INTRO text. ckuus2.c, 11 Nov 2005. Added NOLONGLONG for SV68. ckcdeb.h, 11 Nov 2005. --- Dev.05 --- Added a debug() statement in FTP secure_getbyte() to see what's going on with Muhamad Taufiq Tajuddin's 205-byte-per-second FTP/SSL downloads. --- Dev.06 --- Result: nothing, SSL_get_error() does not report any errors. Suggested testing SSL_read()'s return code, if 0 don't update the screen. Created a new data type CK_OFF_T in ckcdeb.h that will eventually resolve to whatever each platform uses for file sizes and offsets. ckcdeb.h, 17 Nov 2005. Made a new library routine ckfstoa() that converts a file size or offset to a string. This is to solve the problem with having to use different printf() formats for different representations of file size (int, long, long long, off_t, signed, unsigned, etc). Replaced a few printf("%l",size) with printf("%s",ckfstoa(size)) with the expected results. This is just a start, the definitions will need adjustment for many platforms, variables need to be redeclared, and all the offending printf's (and printw's) will have to hunted down and converted. ckclib.[ch], ckuus4.c, 17 Nov 2005. Built a minimal version on Linux with: make linux "KFLAGS=-DNOLOCAL -DNOICP -DNOCSETS -DNODEBUG" Worked fine, result was 260K on i686. 21 Nov 2005. Discovered that Kermit's date parser, contrary to the documentation, failed to handle strings like "Wed, 13 Feb 2002 17:43:02 -0800 (PST)", which are commonly found in email. This was because of an overzealous and misguided check in the code; once removed, all was well. ckucmd.c, 26 Nov 2005. Added a new format code 4 to \fcvtdate() to emit asctime() format, used in BSD-format email message envelopes (i.e. the "From " line). shuffledate(), ckucmd.c, ckuus[24].c, 26 Nov 2005. Added a new function \femailaddress(). Given a From: or Sender: header line from an RFC2822-format email address, extracts and returns the actual email address, such as kermit@columbia.edu. ckuusr.h, ckuus[42].c, 26 Nov 2005. Using the new functions, I wrote a script to fetch mail from a POP3 server over a TLS connection. But the line-at-a-time input (needed for changing line terminators and byte-stuffing text lines that start with "From ") is slow, 17 sec to read 29 messages totaling 175K. Added INPUT /CLEAR so INPUT can be started with a clean buffer without requiring a sepearate CLEAR INPUT command. ckuusr.h, ckuus[r24].c, 27 Nov 2005. One thing that INPUT was never able to do well was read and save the complete incoming data stream. That's because, while waiting for its target, the buffer might overflow wrap around. Yet there was never a way to tell it to stop when its buffer fills up and let me save it. I added a /NOWRAP switch that does this. If the buffer fills up before any other completion criterion is met, INPUT returns failure, but with \v(instatus) set to 6 (the next available instatus value). Thus a program that wants to read and save (say) an email message from a POP server, which could be any length at all, and which terminates with . could do this: set flag off while open connection { input /nowrap 10 \13\10.\13\10 # Wait for . if success { frwrite /string \%o {\freplace(\v(input),\13\10.\13\10,\13\10)} set flag on break } else if ( == \v(instatus) 6 || == \v(instatus) 1 ) { frwrite /string \%o {\v(input)} continue } break } if flag (handle success) Note carefully the braces around the FWRITE text; without them, trailing spaces would be lost. Previously the only way to INPUT an entire data stream without losing anything (assuming it was ordinary lines of text that were not "too long"), was line-by-line: while open connection { input /clear 10 \13\10 if fail break if eq "\v(input)" "$ \13\10" break fwrite /string \%o {\freplace(\v(input),\13\10,\10)} } The new code is 3 times faster using the default INPUT buffer length of 4K. Raising it to 16K makes it 3.6 times faster (not worth it). Changing the POP3 script to use INPUT /NOWRAP makes it about twice as fast (it does more; it has to do all the byte-stuffing and unstuffing). 27 Nov 2005. Changed ssl_display_xxx() to just return if SET QUIET ON. Otherwise there is no way to suppress the messages. Also protected a previously unprotected printf("[SSL - OK]\r\n"); by if ( ssl_verbose_flag ). ck_ssl.c, 28 Nov 2005. Discovered that FOPEN /APPEND doesn't work if the file doesn't exist. It uses cmiofi() which is a super-hokey front end to cmifi2(). I had code to call it but for some reason it was commented out, with a note to the effect it didn't work. I uncommented it but that didn't help much. So I wrote an entirely new cmiofi() that works exactly as it should, using chained FDBs, _CMIFI to _CMOFI (I think the original cmiofi() predated chained FDBs). ckuus7.c, ckucmd.c, 29 Nov 2005. Getting rid of the awful hacks required to call cmiofi() meant I also had to change the EDIT command, which is the only other place where it's used. Unfortunately now it's no longer possible to give EDIT without a filename (to just start an empty editor) but I doubt anyone will notice. ckuusr.c, 29 Nov 2005. IF KERBANG didn't always work right. If a kerbang script TAKEs another kerbang script, the second one should have IF KERBANG false, but it didn't. Added a check for \v(cmdlevel) == 1. Now you can write a wrapper that runs a kerbang script in a loop, and the latter can use IF KERBANG to know whether to EXIT (if called at top level) or END (if called by another script, thus allowing -- in this case -- the loop to continue). ckuus6.c, 29 Nov 2005. Changed \flop() and flopx() functions to take a third argument, a number signifying at which occurrence of the break character to lop, so: \flopx(sesame.cc.columbia.edu) = edu \flopx(sesame.cc.columbia.edu,,2) = columbia.edu ckuus[24].c, 1 Dec 2005. Built OK on VMS 7.2-1 with MultiNet 4.4. Built with and without OpenSSL on Linux OK, ditto Solaris 9. Built OK on RH Linux AS4 on X86_64 (64-bit); "show var fsize" (using new ckfstoa()) works OK there. Also Mac OS X 10.3.9 (32-bit), Tru64 UNIX 4.0F (64-bit), HP-UX 11iv2 (64-bit) (picky new compiler spews out tons of useless warnings), FreeBSD 6.0 on ia64 (64-bit). --- Dev.07 --- Changed "make netbsd" to be a synonym for "make netbsd2" because the original netbsd target was ancient. Renamed it to netbsd-old. makefile, 3 Dec 2005. Updated INPUT and MINPUT help text. ckuus2.c, 3 Dec 2005. Discovered that on a SET PORT /SSL connection, Kermit treats incoming 0xff data bytes (e.g. sent from the POP server) as IACs and goes into Telnet negotiations. Jeff says "You will need to implement NP_SSLRAW and NP_TLSRAW that do the same as NP_TCPRAW but negotiate SSL or TLS as appropriate." This was not as easy as it sounded, because apparently a lot of the Telnet code is used by SSL and TLS even when Telnet protocol is not being executed. I wound up doing this as follows: I added /SSL-RAW and /TLS-RAW to the switch table. Rather than disable Telnet, they do exactly what the /SSL and /TLS switches do, but also set a special flag. This flag is checked in only two place: netclos() (to prevent Kermit from sending TELNET LOGOUT when closing the connection), and tn_doop() (to prevent Kermit from reacting to incoming IACs; it makes tn_doop() return(3), which means "quoted IAC", which causes the caller to keep the IAC as data). ckcnet.h, ckctel.h, ckctel.c, ckuus7.c, 4 Dec 2005. The INPUT command did not account for tn_doop() returning 3. Fixed in doinput(), ckuus4.c, 4 Dec 2005. Added another debug() statement in FTP secure_getbyte() to see what's going on with Muhamad Taufiq Tajuddin's 205-byte-per-second FTP/SSL downloads, plus new code to test SSL_read()'s return code (byte count); if 0 don't update the screen. ckcftp.c, 4 Dec 2005. --- Dev.08 --- Fixed a typo in the non-ANSIC definition of ckfstoa(). ckclib.c, 7 Dec 2005. Our Ctrl-C trap (the ON_CTRLC macro) wasn't working for kerbang files. Rearranged some code to make it work. ckcmai.c, 8 Dec 2005. Started converting code to use CK_OFF_T for file sizes and offsets, and all [s]printf's to replace "%ld" or whatever with "%s", and the size variable with a call to ckfstoa(). Since I haven't actually changed the definition of CK_OFF_T from what all the size variables were to begin with (i.e. long), it shouldn't do any harm. So far just ckcfn3.c 10 Dec 2005. An updated HP-UX 9.xx makefile target from PeterE to fix a core dump that happens on that platform due to insufficient resources. 14 Dec 2005. Added debug() statements to http_blah() routines to tell whether the connection is "chunked". There seems to be a bad performance problem. ckcnet.c, 14 Dec 2005. PeterE complained about ugly DIRECTORY error message, ?No files match - "{blah}". The braces are used internally in case the user typed more than one filespec. I changed the error message to remove them. Ditto DELETE. ckuus6.c, 15 Dec 2005. The problem with HTTP downloads is that Kermit always does single-character read() or socket_read() calls (or the SSL equivalent); see http_inc(). I added buffering code for non-SSL connections only but it's gross because it has to swap ttyfd and httpfd before calling nettchk(). I tried making a nettchk() clone that accepts a file descriptor as an argument but it didn't work because too many other routines that are invoked directly or implicitly by nettchk() (such as in_chk()) are still hardwired to use ttyfd. HTTP GETs are now 20 times faster on the local network (the improvement is less dramatic over a clogged Internet). ckcnet.[ch], 15 Dec 2005. --- Dev.09 --- HTTP file-descriptor swapping is not thread safe. Doing it right, of course, is a big deal, so for now I just don't define HTTP_BUFFERING for Windows. ckcnet.c, 15 Dec 2005. Noticed that HTTP not included in FreeBSD and OpenBSD builds. Fixed in ckcdeb.h, 22 Dec 2005. Fleshed out 32/64-bit data type definitions and changed struct zattr (file attribute structure) members length and lengthk to have the new CK_OFF_T type. Changed final arguments of debug() and tlog() to be the new LONGLONG type. ckcdeb.h, 22 Dec 2005. Changed ckfstoa() to return a signed number in string form, rather than an unsigned one. That's because off_t is signed (thank goodness). Added the inverse function, ckatofs() so we can convert file sizes and offsets back and forth between binary number and string. ckclib.c, 22 Dec 2005. Changed Attribute Packet reader to convert incoming file size attribute with ckatofs() rather than atol(). ckcfn3.c, 22 Dec 2005. Converted debug(), tlog(), ckscreen(), etc, to handle potentially "long long" arguments by making their "n" argument CK_OFF_T. ckuusx.c, ckcdeb.h, 22 Dec 2005. Converted the rest of the source files to use CK_OFF_T for all file size and offset and byte-count related variables, and converted all references to these variables in printfs to go through ckfstoa(). Then I built it on Linux/i386 with: make linux "KFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" which makes off_t be 64 bits and magically makes all the regular file APIs use 64-bit sizes and offsets without changing the API calls in the source code. It's going to be a lot of work to get through all the kinks but I was able to send a long file, do directory listings of long files, do \fsize(longfile), etc. When it sends a file, the length is shown correctly in the A packet. If the receiver does not support big numbers, it receives the file OK anyway, without showing the size, the thermometer, or percent done (and then will get an error when the file keeps coming after the 2G mark). Kermit 95 actually refuses long files for "Size", but only if the announced is less than 2^63 bytes. When today's Linux version receives a file, it shows the length correctly in the file-transfer display, as well as percent done, thermometer, etc. Also built this version on true 64-bit Linux, and it worked fine. Many files changed, 22 Dec 2005. For the record, this API is specified in X/Open's Single UNIX Specification Version 2, which is branded as UNIX 98. It is called Large File Support, or LFS, and was developed at the Large File Summit. It looks like the operative feature-test macro in glibc for transitional large file support is __USE_LARGEFILE64. So if this is defined, we can also supply _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64 automatically for 32-bit Linux builds. But there's a Catch-22, you don't know if this is defined until you read the header files, but you have to define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS before you read the header files. Maybe it's good enough to grep through for __USE_LARGEFILE64. makefile, 23 Dec 2005. Checked this on true 64-bit Linux. The same symbols are defined in CFLAGS, but they do no harm; it builds without complaint and works fine. 24 Dec 2005. Built it on Red Hat Linux 6.1 from 1999. This picked up the long file support too. Guess 6.1 isn't old enough to not have it! Kermit seems to work OK on regular files but I don't have enough disk space to create a long file, and my bigfile.c program (which creates a long file containing only 1 byte) doesn't work ("fseeko: invalid argument"). It looks like parts of this API were visible in Linux before they were actually working. 24 Dec 2005. Converted all fseek() and ftell() to macros that expand to fseek() and ftell() or fseeko() and ftello() depending on whether _LARGEFILE_SOURCE is defined. ckufio.c, ckuus7.c, ckuusx.c, 24 Dec 2005. Made a CK_OFF_T version of cmnum(). It would be a very big deal to just change cmnum() to return a new type, so another idea is to rename cmnum() to something else, cmnumw(), change its result argument to CK_OFF_T, and then make a stub cmnum() to call it to get an int, then call cmnumw() explicitly any time we need a big number. ckucmd.c, 24 Dec 2005. Calling cmnumw() directly requires changes to each routine that uses it. The INCREMENT and DECREMENT commands, for example, required changes to doincr(), varval(), and incvar(), and all references to them. ckuusr.[ch], ckuus[56].c, 24 Dec 2005. Calling cmnumw() in chained FDBs required defining a new function code, _CMNUW, adding a new member to the OFDB struct for returning wide results, and adding a new case to cmfdb(). ckucmd.[ch], 24 Dec 2005. Changed FSEEK and FCOUNT to use the new chained FDB interface, now we can seek and look past 2GB. ckuus7.c, 24 Dec 2005. Next come switches, which store their results in a struct stringint. This struct was defined in each module where it was used (ckuus[r367].c, ckcftp.c). I moved the definition to ckuusr.h and added a wval member, which can be referenced by any switch-parsing code that calls cmnumw(). 24 Dec 2005. Changed SEND /CALIBRATE:n to allow big values of n. This makes it possible to test the protocol aspects of long-file transfer without actually having a long file handy. ckuusr.c, 24 Dec 2005. SEND /SMALLER-THAN:n, SEND /LARGER-THAN:n, and and SEND /START:n also now allow large values of n. ckuusr.c, 24 Dec 2005. Changed the algebraic expression evaluator to use wide values. ckuus5.c, 24 Dec 2005. Fixed ckfstoa() to handle the case when n is negative and (0 - n) is also negative, which happens for numbers 2^(n-1) or greater, where n is the number of bits in the word size we're dealing with, e.g. 64, in which case 2^63 has its sign bit set so seems to be negative. In such cases, ckfstoa() returns "OVERFLOW" instead of a numeric string. We'll have to see how this plays out but I think it's better to cause a parse error and stop things dead than to return a spurious number. ckclib.c, 24 Dec 2005. Converted the S-Expression handler to use wide integers. ckuus3.c, 24 Dec 2005. Took all the LONGLONG stuff out of ckcdeb.h, we don't need it. All of these changes result in 64-bit arithmetic (more or less) on 32-bit Linux, as well as on true 64-bit platforms. Rebuilt today's code on Solaris 9 in the 32-bit and 64-bit worlds, on Red Hat 6.1, Red Hat AS4.2. I haven't bothered trying a 32/64 hybrid build for Solaris, since I can build a pure 64-bit version there. Quick tests show the large-number arithmetic works OK in all cases except, of course, on pure 32-bit builds (unfortunately I can't find a running Linux system old enough to verify this for Linux, but it's true for other 32-bit platforms). 24 Dec 2005. Tried building a hybrid version on Solaris 9 after all since the LFS API is ostensibly the same as for Linux: make solaris9 "KFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" It built smoothly and the resulting binary is 2.5MB compared to 3.4MB for the 100% 64-bit version. Looks like a keeper. For now, added solaris9lfs and solaris10lfs entries to the makefile but if these work on PCs we can make these the regular entries for Solaris 9 and 10. 27 Dec 2005. Built on Mac OS X 10.4 with the regular target. It seems that in that case, off_t is 64 bits anyway. Noticed that a lot of stuff didn't work, like exponentiation in S-Expressions. Tried building it as above, which worked, and now CK_OFF_T is 64 bits instead of 32, but (^ 2 30) is still 2.0. In fact 2-to-the-any-power is 2.0. It seems that the Mac OS X version did not have FNFLOAT defined. It also seems that every test in dosexp() like: if (result != fpresult) fpflag++; should have been protected by #ifdef FNFLOAT..#endif /* FNFLOAT */ -- a double-ended break, as they say in the nuclear power industry. ckuus3.c, 27 Dec 2005. Added GREP /EXCEPT:pattern. ckuus[26].c, 27 Dec 2005. Fixed a problem with uninitialized pv[].wval (switch-parsing parameter-value) members that showed up on certain platforms or with certain compilers. Now the Mac OS X 10.4 version works. ckuus[r367].c, ckcftp.c, 28 Dec 2005. Built on Unixware 7.1.1, a pure 32-bit build, seems fine. Rebuilt on Red Hat AS 4.2 just to make sure I didn't break anything, it's OK. No testing on HP-UX, etc, because HP testdrive file sytem is full, can't upload anything. 29 Dec 2005. Commented out the SHOW FEATURES section that displays constants like INT_MAX, CHAR_MAX, etc, because printing each value in the appropriate format is too tricky, and we don't need them anyway. ckuus5.c, 29 Dec 2005. Updated ckvfio.c to use CK_OFF_T for the relevant variables. Built and tested on VMS/Alpha 7.2: file transfer in remote mode; making a Telnet connection and then local-mode file transfer; S-Expressions, all OK. Also built a no-net version OK. 29 Dec 2005. Built and tested on Red Hat AS4 AMD X86_64, used it to upload new sources to FreeBSD 4.11. Built on FreeBSD 4.11/i386. Here's another one where off_t is 64 bits, even though long is 32 bits. But it seems to work ok, not sure why, when CK_OFF_T is 32 bits. There is no _LARGEFILE_SOURCE stuff in the header files. 29 Dec 2005. Built on Mac OS X 10.3.9 using the new macosx10.4 target to pick up LFS. Works fine. Built on Red Hat Linux 4WS on IA64 (64-bit). Now this one is odd, stat() fails on big files. It happens also if I use the "linuxnolfs" target, which does not define _USE_LARGEFILE or _FILE_OFFSET_BITS=64. DIRECTORY BIGFILE shows the size as -1, but if "log debug", it says "no files match", i.e. different behavior, observer effect. I hate when that happens. Let's see if that's an anomoly... Built on Tru64 Unix 4.0F (64-bit Alpha). It sees long files just fine. Rebuilt and checked on x86_64 again... fine. OK, let's not worry about IA64 yet. Another small fix to the HP-UX 9.0 target from PeterE. makefile, 29 Dec 2005. ---Dev.10--- Code adjustments from Jeff, mainly to the SSL and TLS Raw mode code from several weeks ago, plus changing some data types in the security code to CK_OFF_T, plus a different data type for CK_OFF_T for K95 because Windows size_T isn't signed. This presumably will allow large-number arithmetic but it will not give large file access because that will require replacing all C library file i/o calls (esp. in ckofio.c) with native Windows APIs. Build on Solaris 9 with and without SSL and on Linux RH AS4.2 with and without SSL. ck_crp.c, ck_ssl.c, ck_ssl.h, ckcdeb.h, ckcftp.c, ckcmai.c, ckcnet.c, ckcnet.h, ckctel.c, ckuat2.h, ckuus4.c, ckuus7.c, ckuusr.c, 30 Dec 2005. It was reported that WRITE SESSION always returned a failure status, even when it succeeded. The problem was that Unix versions of zsout() and zsoutl(), for the session log only, were using write() and returning write()'s return code, which is different from what zsout() and zsoutl() are documented to return. Also plugged a couple potential holes in zsoutx() that I noticed while I was in the neighborhood. ckufio.c, 30 Dec 2005. Added FSEEK /FIND:pattern. This form of FSEEK accepts all the other switches and arguments and performs the desired seek. Then, if the seek was successful, it starts from that point and reads through the file, line by line, searching for the first line that contains the given string or matches the given (unanchored) pattern and, if found, sets the file pointer to the beginning of that line. Useful, e.g., for very long timestamped logs, where you want to start processing at a certain date or time; searching for a particular string is much faster than doing date comparisons on each line. ckuus[27].c, 30 Dec 2005. It was annoying me that FILE STATUS (FSTATUS) required a channel number to be given even if only one file was open, so I supplied the correct default in that case. ckuus7.c, 30 Dec 2005. INPUT /NOWRAP, added recently, is used for efficiently copying the INPUT stream intact, but it's not good for matching because if the INPUT target is broken between the end of the previous buffer and the beginning of the next one, the context is lost and the match does not occur. I thought of several ways around this, but they all involve saving a huge amount of context -- old input buffers, the arrays of target strings and corresponding match positions, etc. The alternative is fairly simple but it's not transparent to the user. Here's what I did in a POP script: .eom := "\13\10.\13\10" set flag off # FLAG ON = success while ( open connection && not flag ) { .oldinput := \fright(\v(input),8) # Save tail of previous INPUT buffer input /clear /nowrap 4 \m(eom) # Get new INPUT buffer if success { # INPUT matched - good .s := {\freplace(\v(input),\m(eom),\13\10)} set flag on } else { # No match .s := \v(input) # Check if target crossed the border .oldinput := \m(oldinput)\fsubstr(\v(input),1,8) if \findex(\m(eom),\m(oldinput)) set flag on } ... } I think this will be easier to explain than any dangerous and grotesque magic I might put into doinput() itself. For now, added a few words about this to HELP INPUT. ckuus2.c, 30 Dec 2005. Back to the pattern matcher. Noticed that "IF MATCH index.html [a-hj-z]*" succeeded when it should have failed. In ckmatch(), the clist section needed one more clause: it can't float the pattern if an asterisk does not occur in the pattern before the clist. This change fixes the problem without breaking any other cases that weren't already broken, most of which involve slists, i.e. {string,string,string,...}. ckclib.c, 30 Dec 2005. Tried FSEEK /FIND: on a largish file (over 100,000 lines), using it to seek to a line near the end. It took 0.756 seconds, compared with Unix grep, which did the same thing in 0.151 sec. That's because C-Kermit is using ckmatch(). But if the search target is not a pattern, it should be a bit faster to use ckindex(). Yup, 0.554 sec, a 36% improvement. Can't expect to compete with grep, though; it's highly tuned for its single purpose. ckclib.[ch], ckuus7.c, 1 Jan 2006. Updated visible copyright dates to 2006: ckcmai.c, ckuus2.c, ckuus5.c, 1 Jan 2006. Noticed that NetBSD 2.0.3 has 64-bit off_t, and that _LARGEFILE_SOURCE is mentioned in . Tried building Kermit with _LARGEFILE_SOURCE added to CFLAGS, it's good. Added it to the netbsd target. makefile, 1 Jan 2006. Fixed typo, #ifdef CK_NOLONGLONG in ckuus5.c should have been #ifndef CK_LONGLONG (which, it turns out, we don't use anyway). 2 Jan 2005. Observed that FreeBSD 4.x has a 64-bit off_t, but does not use the _LARGEFILE_SOURCE convention. Reasoning that all versions of FreeBSD have off_t (I was able to check back to FreeBSD 3.3), I simply #define CK_OFF_T to be off_t in ckcdeb.h within #ifdef __FreeBSD__ .. #endif. Another one down. This can be done for any platform that is guaranteed to have off_t. Turns out FreeBSD 3.3 has 64-bit off_t too. 2 Jan 2005. OpenBSD, same as FreeBSD. Also, added OS-version-getting thing to makefile target for the program herald, as in the other BSDs. Built on OpenBSD 2.5 from 1998, it has 64-bit off_t too. ckcdeb.h, makefile, 2 Jan 2005. Dumping the command stack every time there's an error is really too much. I added SET COMMAND ERROR-DISPLAY {0,1,2,3} to set the verbosity level of error messages. Only level 3 dumps the stack. ckuus[235].c, 2 Jan 2005. Built on HP-UX 11.11 with _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64. The result works fine as far as I can tell. It sees big files, it can open them, seek to positions past the 2^31 boundary. It can send large files. It can do large-number arithmetic (^ 2 62). The only problem is that during compilation, every single modules warns: cc: "/usr/include/sys/socket.h", line 504: warning 562: Redeclaration of "sendfile" with a different storage class specifier: "sendfile" will have internal linkage. cc: "/usr/include/sys/socket.h", line 505: warning 562: Redeclaration of "sendpath" with a different storage class specifier: "sendpath" will have internal linkage. These warnings should be perfectly harmless since they are not coming from C-Kermit code, nor does C-Kermit use either one of those functions. These warnings don't come out in HP-UX 11i v2, but on that one we get tons and tons of picky compiler warnings (variables set but not used, defined but not referenced, etc). A couple, however, turned out to be valid; one case of "expression has no effect", and two of "string format incompatible with data type" (I missed a couple file-size printfs). There were also numerous warnings about signedness mismatch or sign conversion of constants like IAC (0xff). Does the HP-UX Optimizing Compiler have a compiler flag to make all chars unsigned? Yes, +uc, but the man page says "Be careful when using this option. Your application may have problems interfacing with HP-UX system libraries and other libraries that do not use this option". Sigh, better not use it. After reviewing "HP-UX Large Files White Paper Version 1.4" and HP's "Writing Portable Code" documents, I added -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 to the hpux1000 target, which is the basis for all HP-UX 10.00 and later builds. Large files are available in HP-UX 10.20 and later. 10.00 and 10.10 were not real releases, and anyway these flags should be harmless there unless the large-file implementation was only partly done. Built OK on both PA-RISC and IA64, optimized and plain. makefile, 4 Jan 2006. Built on FreeBSD 6.0 on IA64. All OK except I got a warning about the argument passed to time() in logwtmp() in ckufio.c. This section had already been partially fixed; thus I put the improved version into #ifdef CK_64BIT, which is our newly available symbol that should be automatically defined for any true 64-bit build. ckufio.c, 4 Jan 2006. Finally got around to testing Jeff's changes to SSL/TLS RAW mode from December 30th against our POP server. It didn't work, couldn't log in. Tried backing off the ckctel.c changes first; that allowed login and communication, but it did not suppress activation of Telnet protocol whenever a 0xff byte arrived. Backed off the rest of the changes and now all is OK again. ckctel.c, ckcnet.c, ckuus7.c, 9 Jan 2006. Built on NetBSD 1.4.1 (1999), found that it did not like the large file assumption -- fseeko() and ftello() do not exist; added a clause to the netbsd target to check for fseeko and not define _LARGEFILE_SOURCE if not found. Oddly enough, off_t is 64 bits anyway, but it doesn't look like the APIs are half-done. For example, stat() uses off_t (64 bits) for the file length, but fseek() uses long (32 bits) and there is no 64-bit analog. Anyway the new netbsd target works on both 1.4.1 and 1.5.2 (no large files) and on 2.0.3 (large files). makefile, 9 Jan 2006. Built on QNX-32 4.25, which has no large file support. Got a few strange compiler (WatCom) warnings, but it built and runs OK. Noticed that file transfers into QNX over a Telnet connection can't use streaming, but that's nothing new to this version; same thing happens with C-Kermit 7.0. 9 Jan 2006. Built on IRIX 6.5. I didn't bother with large files there because it does not support the _LARGEFILE_SOURCE interface; you have to change all the APIs at the source level from blah() to blah64(). Seems to work fine as a 32-bit app even though its off_t is 64 bits. Tried a pure 64-bit IRIX 6.5 build but it dies in ckcnet.c when it hits SOCKOPT_T and GSOCKNAME_T with "The identifier 'socklen_t' is undefined". Looks like I no longer have access to SCO OSR5. Made a pure 32-bit build on SCO UnixWare 7.1.4, all OK. Found that this version also supports LFS, added it to the uw7 target. makefile, 9 Jan 2006. --- Dev.11 --- Evidently the HP-UX bundled (non-ANSI non-optimizing) compiler doesn't like long integers in switch expressions. Changed three examples of these in the S-expression code. ckuus3.c, 10 Jan 2006. A section of tstats() where GFTIMER isn't defined (e.g. on Motorola sv68r3v6) was garbled. Fixed in ckcfn2.c, 10 Jan 2006. A fix for setting 921600 bps on Linux from Paul Fulghum, Microgate Systems Ltd. ttgspd(): ckutio.c, 11 Jan 2006. Noticed that when I changed the compact substring notation code back on August 9th, I broke the ability to use arithmetic expressions within the brackets, which explains some rather odd behavior I saw with some of my scripts. Looking more deeply into this, I also see that all the parsers I have been using up to now for this, as well as for array bounds pairs, have been inadequate because they never allowed for nested constructions, such as a member of a bounds pair that itself was an array element, possibly with another array element as a subscript. I wrote a new routine for this, called boundspair(), which is like arraybounds() except it accepts an extra argument, an array of characters that can serve as bounds-pair delimiters, and it returns the pair separator that was encountered in another new argument. For the alternative substring notation for [startpos-endpos] I had to change the delimiter from '-' to '_' because '-' can be used in arithmetic but '_' is not a recognized operator. This is so I can parse, e.g. [a:b] or [a_b] in the same context, and then find out which form was used, e.g. \s(line[9:12]) or \s(line[9_12]); the first string is 4 bytes long, the second is 12. Everything seems to be OK now. \s(line[10]) gives everything starting at 10, but \s(line[10:0]) gives the null string. Bad syntax in the bounds pairs results in a null string; missing pieces of the bounds pair result in defaults that should be compatible with previous behavior. ckuus[45].c, ckuusr.h, 13 Jan 2005. Changed arraybounds() to call boundsdpair(). This was a rather drastic change, not strictly necessary, but I think I got all the kinks out. ckuus5.c, 13 Jan 2005. Changes from PeterE to the makefile for HP-UX 6 and 7, to accommodate bigger symbol tables, etc. 19 Jan 2005. Determined that SCO OSR5.0.6 (and earlier) do(es) not support large files. Don't know about 5.0.7. 30 Jan 2005. Created a new build target for SCO OSR6.0.0. Gets the exact 6.x.x version dynamically. Supports large files and big-number arithmetic via CK_OFF_T. The sockopt() family of functions changed the data types of some of their arguments since OSR5. It was already possible to define SOCKOPT_T and GSOCKNAME_T from the command line but I had to add code to also allow this for GPEERNAME_T too. ckcnet.c, makefile, 30 Jan 2005. Apparently, ever since C-Kermit 7.0 was released, it has never been possible to use a variable for the as-name in a RECEIVE command in Kermit 95. This is because evaluation of the as-name field was deferred until after we could check whether it might be a directory name (which, in Windows, could start with a backslash). This little bit of magic was not a good idea, magic hardly ever is. I changed the code to evaluate both as-name fields in the normal way. If they want to receive to a directory called "\%1", they'll just have to spell it differently. The workaround is to turn the whole command into a macro and evaluate it before executing it, e.g.: assign xx receive /as-name:\%1 do xx ckuus6.c, 1 Feb 2006. Built OK on FreeBSD 6.1 on AMD64. Adjusted some copyrights and date stamps. ckcmai.c, makefile, 8 Feb 2006. --- Dev.12 --- Fixed a signed/unsigned char warning in the new boundspair() calling code in the compact substring notation handler. ckuus4.c, 9 Feb 2006. Removed a spurious extra linux+openssl label from the makefile, added solaris10g_64 synonym. 9 Feb 2006. Satisfied myself that LFS is OK on Solaris 10 i386, and I'm going to assume it's also OK on Solaris 9. Made LFS standard for all Solaris 9 and 10 builds (including the secure ones) except the explicitly 64-bit ones, and made the provisional solarisXXlfs targets into synonyms. makefile, 9 Feb 2006. --- Dev.13 --- Further attempts at SSL/TLS message suppression when QUIET is ON. ck_ssl.c, 16 Feb 2006. From J.Scott Kasten: (quote...) I just uploaded a patch to /kermit/incoming. The file name is "jsk-patch-for-cku211.diff". I have also included the patch as ASCII text in this email below. This patch may be applied to the cku211.tar.gz source code via: cd cku211, patch -p1 <../jsk-patch-for-cku211.diff The patch adds 4 new build targets: netbsdwoc - a stripped no curses target for iksd used. netbsdse - security enhanced target with srp, ssl, and zlib. irix65gcc - build on SGI Irix 6.5 platform using gcc. irix65se - security enhanced target with srp, ssl, and zlib. The patch fixes one build target: irix64gcc - The "-s" option is not supported by gcc under Irix. I thank all of you in the Kermit Project for such a fine utility. I recently had to get a 16 MB file overseas across a spotty communications link to repair a computer remotely. Kermit was the only thing that could do the job, so I wanted to contribute these patches back to the mainstream to say thanks. This digitally signed email is a binding contract that officially assigns the rights to the source code patch (shown below) that I developed to the Kermit Project at Columbia University. (...end quote) ck_ssl.c, makefile, 23 Feb 2006. Changed the new NetBSD target names to be consistent with the conventions used in most other targets: netbsdwoc -> netbsdnc netbsdse -> netbsd+ssl+srp+zlib irix65se -> irix65+ssl+srp+zlib and removed old, now superfluous, NetBSD targets (old-netbsd, netbst15, netbst16), leaving synonym labels in their place. Also updated (crudely) the Linux target variations (curses instead of nocurses, no curses at all) to be (appropriately modified) copies of the current linux target. It would be nicer to combine them, but this gets the job done. makefile, 23 Feb 2006. --- Dev.14 --- Fixed the HELP command when used with tokens like @, ^, #, and ;. The first two had been omitted from the table. The second two required a new path into the guts of the parser, since comments are normally stripped at a very low level. ckuus[r2].c, ckucmd.c, 24 Feb 2006. Built on AIX 5.1 ("make aix51") without incident. Then I tried: make aix51 "KFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" This had no effect. I found the relevant document ath the IBM website. It says to use -D_LARGE_FILES instead. I added this to the AIX 4.2 target since (a) IBM says large files are supported by AIX 4.2 and later, and (b) all Kermit AIX targets past 4.2 use the 4.2 one. Plus a clause to make sure CK_OFF_T is defined appropriately. ckcdeb.h, makefile, 6 Mar 2006. Added a 32-bit aix51+openssl target. Builds OK, works fine (tested against our SSL POP server). Tried I tried adding -D_LARGE_FILES. It seems to work fine, so we'll keep it. Cleaned up the other aix5blah entries a bit also. makefile, 6 Mar 2006. Fixes from J. Scott Kasten to the IRIX 6.4 and 6.5 makefile targets. They were badly wrong. makefile, 6 Mar 2006. The reason Kermit was looping on directories in IRIX was a classic "double-ended break". The makefile targets failed to define DIRENT so Kermit was open/read on directories rather than opendir()/readdir(). But then it was also failing to account for the fact that read() would return -1 on error. The makefile fix adds -DDIRENT, and the read() case in traverse() now properly terminates its loop on error. ckufio.c, 6 Mar 2006. --- Dev.14 --- In response to a complaint that C-Kermit would not build on HP-UX 11 with OpenSSL, I tried it myself on both 11.11/PA-RISC and 11i v2/Itanium. It built OK on both but I had to add a new target (hpux1000o+openssl-nozlib) for no Zlib since these boxes did not have it installed. makefile, 9 Mar 2006. Added OpenSSL version number display to SHOW FEATURES. ckuus5.c, 9 Mar 2006. Gavin Graham noticed that FTP [M]GET /DELETE /MOVE-TO: was rejected with "?Sorry, /DELETE conflicts with /MOVE or /RENAME". This check belongs in the PUT code but not in the GET code. Commented it out and tested the result. The combination is now accepted but then Kermit refuses the incoming file as if it had been given a /SMALLER-THAN: or /LARGER-THAN: switch, which it didn't happen. Turns out there was one more place where I wasn't initializing the new "wide int" member of the switch-parsing pv[] struct. Once this was fixed, the /MOVE-TO part still didn't work. Turned out the /DELETE case was part of a long if-else-if-else- chain, which effectively made /DELETE and /MOVE-TO: or /RENAME-TO: mutually exclusive. Fixed this, now it works fine. ckcftp.c, 13 Mar 2006. Got access to AIX 5.3, built there, all OK, including large files. 13 Mar 2006. --- Dev.16 --- Patches from Mark Sapiro to suppress getsockopt() and getsockname() warnings in Mac OS X. ckcnet.[ch], 18 Mar 2006. In response to a complaint from Clarence Dold, tried "make redhat9" (which is the rather dated target that tried to include all forms of security) on RH Linux AS4.3, it failed miserably. I made a new makefile target, removing Kerberos IV and got a lot farther. But then in ckcftp.c, the following struct definition: struct { CONST gss_OID_desc * CONST * mech_type; char *service_name; } gss_trials[] = { { &ck_gss_mech_krb5, "ftp" }, { &ck_gss_mech_krb5, "host" }, }; refers to a variable, ck_gss_mech_krb5, that is not defined anywhere. Up above, however, is a static definition for gss_mech_krb5, so I changed the struct definition to match. Next, in ckuath.c, the compiler could not find the com_err.h file. Turns out in Linux this is in a subdirectory, et, so we have to add a -I clause to the makefile target for this. Made a target for Linux+SSL only. Made a target for Linux+Krb5 only; this required moving an #ifdef in ckuus7.c to prevent an unguarded reference to SSLEAY_VERSION. New targets: linux+krb5+ssl, linux+krb5, linux+krb5. ckcftp.c, ckuus7.c, makefile, 27 Mar 2006. New targets of HP-UX 10/11 with OpenSSL from PeterE. makefile, 27 Mar 2006. Added large file/integer support to SHOW FEATURES. ckuus5.c, 27 Mar 2006. Built OK on Solaris 9 and 10 with gcc (someone was complaining that this didn't work, but that was 8.0.211). Started build on a Sun 3/80 mc68030 with NetBSD 2.0 and gcc 3.3.3. But it died with an assembler error in ckcfn2.c (compiler bug). 27 Mar 2006. --- Dev.17 --- NebBSD 2.0 build completed by turning off optimization on ckcfn2.c ("KFLAGS=-O0"). Result supports 64-bit ints and, presumably, large files. uname -p = "m68k", -m = "sun3". 29 Mar 2006. Corrected an omission in applying PeterE's updates to the HP-UX targets. makefile, 28 Mar 2006. Tried resurrecting the solaris2xg+krb5+krb4+openssl+shadow target. It asks to link with libdes but there is no libdes. Removed -ldes from the target, now at least it builds and runs wart. The compilation blows up in ckcftp.c for missing header files: ckcftp.c:462: kerberosIV/krb.h: No such file or directory ckcftp.c:500: gssapi/gssapi_generic.h: No such file or directory ckcftp.c:501: gssapi/gssapi_krb5.h: No such file or directory Got a bit farther by adding appropriate -I's and -L's to KFLAGS but it still dies compiling (or linking?) ckcftp.c, but it doesn't say exactly why. OK, deferred. Added SET SEXPRESSION TRUNCATE-ALL-RESULTS { ON, OFF }. This can be used for force integer arithmetic in any kind of calculation that requires it, such as date calculations. This is a global setting, not on any kind of stack. Also, updated SHOW SEXP and added HELP SET SEXP which wasn't there before. ckuus[23].c, 30 Mar 2006. To make the RENAME command a bit more useful, need to add some switches. But it shares a switch table, qvswtab[], with some other commands. Broke this off into its own switch table. ckuus6.c, 17 Apr 2006. Added RENAME switch values that can be used in the same table with the DELETE switch values, which are shared by many commands. ckuusr.h, 17 Apr 2006. Discovered that the RENAME command could be entered without any arguments and it would still succeed. Fixed in dorenam(): ckuus6.c, 17 Apr 2006. Added parsing for RENAME /UPPER:option (to uppercase the file name(s)), /LOWER:option (to lowercase), and /REPLACE:{{s1}{s2}} (to do string replacement on the filename(s)), but not the semantics. When any of these switches is given, the target ("to") name is not parsed; they act on the source name. The /LOWER: switch takes keyword args to specify whether it should act only only files that have all UPPER case latters, or on ALL files (i.e., including files with mixed-case names); similarly for the /UPPER: switch. There is some creative parsing allowing these to be given with or without a colon and keyword argument, which works fine except if you include the colon but no argument, execute the command (which works fine), and then recall the command. I haven't yet decided about the interaction among these switches. Clearly if /UPPER is given after /LOWER, it overrides. But if /UPPER (or /LOWER) is given with /REPLACE, what should happen? ckuus6.c, 17 Apr 2006. Filled in actions for RENAME /UPPER: and /LOWER: for the single file case, and tested all combinations of switch values and filename configurations. Once that was OK, moved the code out into a separate routine, renameone(), and then called it from both the single-file case and the multifile case. ckuus6.c, 19 Apr 2006. Added RENAME /SIMULATE. Filled in the code for string replacement, needs testing. ckuus6.c, 20 Apr 2006. Changed /REPLACE options to allow a negative number to specify an occurrence from the right, so -1 means the last occurrence, -2 means the next-to-last, etc. ckuus6.c, 24 Apr 2006. Added RENAME /COLLISION:{OVERWRITE,PROCEED,FAIL}. This is implemented but not tested. ckuus6.c, 24 Apr 2006. Worked on RENAME /COLLISION:FAIL. I decided it was less than useful to ... Added SET RENAME { COLLISION, LIST } to let user change default collision and listing actions. ckuusr.[ch], ckuus[36].c, 25 Apr 2006. Experimented with parsing for /CONVERT:cset1:cset2. The problem here is that there is no straightforward way for a switch to have multiple arguments. Or is there...? If I parse cset1 with cmswi() rather than cmkey(), it almost works; the only problem is that the character-set keywords don't have CM_ARG set, so they don't know to stop on, and ignore, a colon. If I make a copy of the table and set CM_ARG in the flags field for each keyword, it works fine: if I Tab in the first name, it fills itself out, supplies a colon, and waits for the second name. So in the code, the first time that RENAME /CONVERT is invoked, I put code to copy fcstab[] and set CM_ARG in each flags field. Works fine, and now we know how to make a switch that takes multiple arguments. ckuus6.c, 24 Apr 2006. I thought I had a function to convert the character set of a string but I don't, so actually implementing /CONVERT: will be difficult. Actually the parsing wasn't that easy either. It works OK interactively, but not in a TAKE file. To make a long story short, I had to change gtword() and cmkey2() to not require "/" at the beginning of a switch, and then to parse arguments-that-are-followed-by-other-arguments as if they were switches, so that they can end with colon rather than space. This might seem dangerous, but switches always have "/" at the beginning, so the check is superfluous. ckucmd.c, 26 Apr 2006. Back to /CONVERT... Once I was able to get the code to call cvtstring() I was able to debug it (at first it was skipping every second character). And now we have a general-purpose string-translating function we can call from anywhere. Requires that C-Kermit be built with Unicode support. ckuus6.c, 26 Apr 2006. Added SHOW RENAME. ckuusr.h, ckuus[r5].c, 26 Apr 2006. Conditionalized some Unix/Windows assumptions in renameone() so the code could work in VMS. ckuus6.c, 2 May 2006. Added RENAME /FIXSPACES to change all spaces in the filename(s) to underscore or any other character or string that is given. This is just a special case of RENAME /REPLACE:{{ }{x}} with easier syntax. ckuusr.h, ckuus6.c, 2 May 2006. Added an "all-but" control to the /REPLACE options: /REPLACE:{{.}{_}{~1}} means replace all but the first (this one works); /REPLACE:{{.}{_}{~-1}} means replace all but the last (this one not yet). ckuus6.c, 2 May 2006. Filled in the second one ("all but" the given occurrence). The algorithm is simply to reverse the three strings and then use the same code as we use in the left-right-case, and then unreverse the result. At first I used yystring() for this but yikes, what a bad design! So I made a better string-reversal routine, gnirts(), for this (luckily yystring() is only used in one place, for which its design is appropriate). ckuus6.c, 3-4 May 2006. Added code to handle the case where the file being renamed includes a path specification. In this case we separate the path, apply the renaming functions to the filename only, and then at the end rejoin the original filename with the path, and join the new name with same path or, if a destination directory was given, with that. ckuus6.c, 4 May 2006. Added HELP SET RENAME and updated HELP RENAME. ckuus2.c, 4 May 2006. "Tom Violin" (Tom Hansen) noticed that the first time you FOPEN a file, Kermit's memory consumption goes way up. In fact there's a warning to that effect in the code, where, upon first open, a potentially big array of potentially big structs is allocated. I rewrote the code to allocate each array member (struct ckz_file) as needed, i.e. when a file is opened, and to free it when the file is closed (or the open fails). This was actually quite a lot of work, which is why I didn't do it the first time around: every single "." had to be changed to "->". Every check for a valid channel first had to check if the channel's struct was allocated and every other reference to z_file[i]->anything had to be prechecked that z_file[i] was not a NULL pointer. Also I made some improvements to FILE STATUS, and I fixed FILE CLOSE to default the channel number if only one channel was open, as I did for FILE STATUS a while back. ckuus7.c, Cinco de mayo 2006. Ran my old BUILDS script that builds C-Kermit with about 100 different combinations of feature-selection switches. Fixed a few small glitches so now they all build OK (except can't do NOANSI builds any more on recent Linuxes because of varargs()). ckuus3.c, ckuus5.c, ckuus6.c, ckuus7.c, ckucmd.c, ckcfns.c, 6 May 2006. Fixed RENAME /LOWER and /UPPER, when given with no colon or agrument, to default to ALL. ckuus6.c, 13 May 2006. Built on VMS 7.2-1, tested new RENAME command there; seems to be OK. 13 May 2006. --- Dev.18 --- I wanted to test large files against RESEND but I don't have access to any system that can run C-Kermit and that also has enough space for a large file. I created a "fake" large file on Linux (3G hole plus 1 byte), and sent it over a localhost connection, and interrupted it repeatedly and then initiated a RESEND at the sender. In each case, it picked up where it left off. But before the 2G boundary was crossed the disk filled up. Inconclusive. 14 May 2006. PeterE got a warning in the new FILE OPEN code when building in HP-UX 9. I added a cast, built on HP-UX 11, no more complaint. However there are warnings about internal vs external bindings of sendpath and sendfile in every module. Too bad, these are not Kermit tokens, it's a conflict in HP's header files. Marc Sapiro doesn't see them; probably it's something on the HP testdrive site. ckuus7.c, 17 May 2006. Fixed the tru64-51b+openssl target -- the terminating doublequote of KFLAGS was missing -- and also the osf target, which failed to import the LIBS definition from whatever other target invoked it. Now the SSL build goes OK on Tru64 5.1B. Replaced x.tar.z in the download areas without declaring a new Dev number. The new one has a makefile with today's date. Software engineering at its best! makefile, 18 May 2006. Scott Kasten noted that the estimated-time-remaining calculation would go bonkers on LFS systems when RESENDing a large file. It looks like the shocps() and shoetl() functions escaped the CK_OFF_T conversion. I made what seemed to be the right adjustments, and then was lucky enough to find a computer that had enough free disk space for me to send a large file, interrupt it several times, resend it, all seems to be OK. 28 May 2006. Later Scott verified these changes independently for Linux, but the problems in IRIX remain. Patches from Scott Kasten for large files on IRIX 6.5: ckcdeb.h, makefile, 12 Jun 2006. --- Dev.19 --- Added a new function for dealing with JPGs and GIFs: \fpicture(filename,&a) returns 0 if file not recognized or can't be opened; returns 1 if landscape, 2 if portrait or square. If array given, element 1 is width, element 2 is height. ckuusr.h, ckuus4.c, 19 Jun 2006. Scott Kasten reports that the FTP client can transfer large files OK, at least in Linux, but has trouble with recovery: . Kermit takes a very long time to start the transfer, sometimes over 30 minutes. Suspect the ftp server is counting the bytes in a long file? Or maybe it's a text-mode transfer and it's counting the lines? Probably in response to Kermit's SIZE command. . The size shown in the FT display is wrong by a random amount. And of course so are the progress bar, percent done, and time remaining. . The file, however, is transferred correctly. REGET works correctly too. I tried setting up a test scenario locally but our Solaris FTP server does not support large files: FTP SENT [SIZE BIGFILE] FTP RCVD [550 BIGFILE: not a plain file.] FTP SENT [PASV] FTP RCVD [227 Entering Passive Mode (128,59,48,24,246,37)] FTP SENT [RETR BIGFILE] FTP RCVD [550 BIGFILE: Value too large for defined data type.] Created the same 3GB on a Tru64 Unix system that allows FTP access. Made the connection from C-Kermit on Solaris (32-bit with LFS): 16:46:12.908 FTP SENT [SIZE BIGFILE] 16:46:12.947 FTP RCVD [213 3000000001] Note that it takes less than half a second to get the reply. Now I start the download and then interrupt it at about 2%: 16:46:12.979 FTP SENT [TYPE I] 16:46:13.174 FTP RCVD [200 Type set to I.] 16:46:13.226 FTP SENT [PASV] 16:46:13.262 FTP RCVD [227 Entering Passive Mode (15,170,178,171,11,37)] 16:46:13.299 FTP SENT [RETR BIGFILE] 16:46:13.337 FTP RCVD [150 Opening BINARY mode data connection for BIGFILE..] 16:47:24.895 FTP RCVD [426 Transfer aborted. Data connection closed.] 16:47:24.934 FTP RCVD [226 Abort successful] 16:47:24.991 FTP SENT [MDTM BIGFILE] 16:47:25.028 FTP RCVD [213 20060706204458] Now I do a REGET: 16:51:55.321 FTP SENT [PASV] 16:51:55.357 FTP RCVD [227 Entering Passive Mode (15,170,178,171,11,43)] 16:51:55.394 FTP SENT [REST 122736640] 16:51:55.430 FTP RCVD [350 Restarting at 122736640. Send STORE or RETRIEVE..] 16:51:55.431 FTP SENT [RETR BIGFILE] 16:51:55.469 FTP RCVD [150 Opening BINARY mode data connection for BIGFILE..] This worked perfectly, as far as I can tell; the FT display picked up in the right place; the thermometer, percent done, and estimated time remaining were the same as when we left off last time. I did the same thing several more times, everything was OK. It would have taken a really long time to let this run to completion, but I think this demonstrates that Scott's symptoms are server-dependent. No changes. 6 July 2006. Checked current code on VMS 8.2-1 on IA64 / UCX 5.5, builds fine. No changes. Updated listing at HP. 6 July 2006. Checked FTP GET of large file in ASCII mode against Tru64 FTP server. It was fine, and there was no delay in the server's response to our SIZE command (as there would be if it were scanning the entire file to count how many bytes would be required to send it in text mode). 7 Jul 2006. Tested FTP PUT big file against Tru64, OK. Ditto FTP RESEND big file: C-Kermit>resend BIGFILE PUT BIGFILE (binary) (3000000001 bytes)---> PASV 227 Entering Passive Mode (15,170,178,171,13,186) ---> SIZE BIGFILE 213 343211280 ---> MDTM BIGFILE 213 20060707141243 ---> APPE BIGFILE 150 Opening BINARY mode data connection for BIGFILE (128.59.59.56,45470). Made REPUT a synonym for RESEND. ckuusr.c, 7 Jul 2006. Added FTP REPUT and FTP RESEND since previously there was no FTP-prefixed command for recovering uploads, only the regular RESEND command, which might not have been obvious to people. ckcftp.c, 7 Jul 2006. Added help text for FTP RESEND and REPUT and amended RESEND help text. ckcftp.c, ckuus2.c, 7 Jul 2006. Changed name of \fpicture() to \fpictureinfo() and added help text. By the way, ImageMagick can do this too: identify -format "%w %h" dscf0520.jpg. The advantage of having it in Kermit is that not everybody has ImageMagick. ckuus[24].c, 7 Jul 2006. Changed the numeric comparisons = < > <= >= != to allow long integers by changing the data type to CK_OFF_T, etc. ckuus6.c, 7 Jul 2006. Noticed that \fkeywordvalue(foo=this is a string) only kept the first word. Fixed it to keep the whole definition. Also added \fkwvalue() as a briefer synomym. ckuus4.c, 7 Jul 2006 Sometimes we want to check if a file's status before we've FOPEN'd it, in which case the channel variable is likely to be empty and \f_status(\%c) would get an error. Making the obvious change didn't fix this, however. It turns out that the function evaluator failed to adjust argn (argument count) when trailing arguments were empty, and argn was being used in this case, and probably others, to test whether an argument existed. I added code to adjust argn to reflect the number of aruments up to and including the rightmost non-empty one. ckuus4.c, 7 Jul 2006. Fixed \fstripb() to not dump core if second argument is missing. ckuus4.c, 7 Jul 2006. Discovered that it was not obvious what pattern to use to match strings enclosed in square brackets. "if match [abc] \[*\]" didn't work. Neither did various other tricks like NCRs for the brackets. However, "if match [abc] \\[*\\]" does work. Trying to fix this would no doubt break 100 other things, so let's call it a feature. 7 Jul 2006. Added \fgetpidinfo(n) to return info about a process ID; for now it simply returns 1 if the process is alive and 0 if not (or -1 if the argument is bad or missing or on any kind of error). ckuusr.h, ckuus[24].c, 7 Jul 2006. The "where-did-my-file-go" message seemed to be ending with a LF rather than CRLF, probably because the terminal modes had not yet been restored, leaving the next prompt hanging below it, rather than on the left margin, if C-Kermit exited immediately after the transfer. Fixed by changing all \n's to \r\n's in wheremsg(): ckcpro.w, 8 Jul 2006. Added \v(lastkwval) so we can retrieve programmatically the keyword most recently processed by \fkeywordval(). ckuusr.h, ckuus4.c, 9 Jul 2006. --- Dev.20 --- Added #ifdef SV68, #include , #endif because Unix System V/68 on Motorola choked on the SEEK_CUR reference without it. ckuus4.c, 10 Jul 2006. Make \fkeywordval(xxx) undefine xxx (i.e. when a keyword is given with no value). This way command-line keywords will always override preexisting default definitions, whether they have a value or not, which makes it easier to parse command lines like "foo=bar blah xx=yy". ckuus[24].c, 12 Jul 2006. On 29 Nov 2005 I changed IF KERBANG to solve a problem (see entry for that date), but introduced a new one; namely that you can't have (e.g.) a FATAL macro that uses IF KERBANG to decide whether to EXIT all the way or STOP back to the prompt. Changed it again, this time to require not that the command level be 1, but that the command *file* level be 0 (i.e. that we are in the top-level command file, irrespective of the command or macro level, but not in a subfile). ckuus6.c, 12 Jul 2006. It is unhelpful when Kermit gets a syntax error in the middle of a big compound statement block (e.g. FOR or WHILE loop) and dumps out the whole thing in an error message. I changed the two places where this can happen to call a new routine that, instead of dumping out the entire cmdbuf, checks its length first and if it's more than a line long, truncates it and adds an ellipsis. ckuus6.c, 12 Jul 2006. The new RENAME command didn't give very good error messages, e.g. if the filespec didn't match any files. Fixed in dorenam(): ckuus6.c, 12 Jul 2006. Fixed DIR /TOP to work if the /TOP:n argument was omitted, defaulting to 10. domydir(): ckuus6.c, 12 Jul 2006. Added DIR /COUNT:v to count the number of files that match the given criteria and store result in the variable v. ckuusr.h, ckuus[r26].c, 24 Aug 2006. Added HDIRECTORY as an invisible synonym for DIR /SORT:SIZE /REVERSE. Can be used with other switches, of course, so (e.g.) HD /TOP shows the ten biggest files. ckuusr.h, ckuus[r26].c, 24 Aug 2006. DIR /FOLLOWLINKS and /NOFOLLOWLINKS always did the same thing; the switch was ignored, a symlink is always followed. Fixed in ckuus6.c, 24 Aug 2006. Added DIR /NOLINKS, which means don't show or count symlinks at all. ckuusr.h, ckuus[r26].c, 24 Aug 2006. Build on Solaris 9 and NetBSD 3.0, 24 Aug 2006. Added a missing definition for LOCK_DIR in the Linux HAVE_BAUDBOY case, suggested by Gerry Belanger. ckutio.c, 6 Oct 2006. Suggested by Jim Crapuchettes: \v(dialmessage) is the text string corresponding to \v(dialstatus). ckuusr.h, ckuus4.c, 6 Oct 2006. Soewono Effendi sent code for exit sequence to leave DTR on; this amounted to unsetting HPUCL in c_cflag. I did it a simpler way, hopefully portable to all Unixes, but who knows at this late date. The code is inside #ifndef CK_NOHUPCL..#endif in case it causes trouble. It is executed if SET EXIT HANGUP is OFF and a serial port was open at the time Kermit exits (or closes it explicitly). ttclos(): ckutio.c, 6 Oct 2006. Built on Solaris9/Sparc; FreeBSD 6.2/AMD64; NetBSD 3.0/i386; HP-UX 11i v2; SCO OSR6.00. --- Dev.21 --- Added netbsd+openssl target to makefile. Built OK (NetBSD 3.0, OpenSSL 0.9.7d) except with some warnings in ck_crp.c. Connects and logs in OK to a secure site. 10 Oct 2006. Added a debug statement to ftp_hookup() to record the TCP port that was used. ckcftp.c, 11 Oct 2006. Built with OpenSSL 0.9.7l on Solaris 9. Built with OpenSSL 0.9.8d on Solaris 9; connects and logs in to a secure site. 11 Oct 2006. The new RENAME command didn't work if both the source and destination names included directory segments, e.g. "rename /tmp/foo ~/bar" (see notes of 4 May 2006). This was fixed in renameone() by a special case in which the second argument is given but it is a filename, not a directory name. ckuus6.c, 11 Oct 2006. Fixed unguarded reference to dialmsg[] for \fdialmessage(), noticed by Gerry Belanger. ckuus4.c, 12 Oct 2006. Added a TOUCH command that does what UNIX touch does: creates the file if it does not exist, updates the timestamp if it does. If a wildcard is given, it operates only on existing files. It shares the DIRECTORY command parser, so all the same file selection switches can be given. ckuusr.[ch], ckuus[26].c, 12 Oct 2006. PeterE noticed that if you FOPEN a file, do some seeks or reads, then FCLOSE it, then FOPEN it again (or open a different one), some of the old information is still there (e.g. current line number). This is an artifact of the changes of May 4th. Now the file closing and opening routines are a bit more careful about scrubbing and initializing the file info struct. ckuus7.c, 12 Oct 2006. --- Dev.22 --- Built OK on Red Hat Linux AS4 with both "make linux" and "make linuxnc". 15 Oct 2006. DIRECTORY /BRIEF ignored file selection switches and always listed all files. This was because of how I cleverly called filhelp() (the routine that lists matching files when ? is typed in a filename field) and, of course, filhelp() doesn't know anything about the DIRECTORY command's file selections. Changed filhelp() to accept all the args needed for passing along to fileselect(), renamed it to xfilhelp(), and made a filhelp() stub that chains to xfilhelp() with null selections. ckcker.h, ckucmd.[ch], ckuus6.c, 29 Nov 2006. SHOW CONNECTION for an SSH connection said the connection type was "NET" rather than "SSH". Fixed in dolognet(): ckuus3.c, 29 Nov 2006. SHOW CONNECTION didn't show the TCP port number. This command works by parsing the current connection log entry string, which doesn't have a field for this, but which sometimes shows the port number as part of the hostname (but more often not). Added code to dolognet() to log the TCP port number, if known. This involved adding a gettcpport() function to ckcnet.c. ckcnet.[ch], ckuus3.c, 29 Nov 2006. This was impossible: def \%1 upper, echo \f\%1(abc) -- i.e. to "compose" a function name. Fixed in zzstring(). But note that it's still not possible to do this: def \%1 \fupper, echo \%1(abc) -- because at the point where "\fupper" is encountered, which is automatically fed to fneval(), the argument list hasn't been read yet. ckuus4.c, 29 Nov 2006. The meaningless Lisp command (=) would cause Kermit to hang. Due to some idiosyncracy in the parser, it would see this as ((=) and would go into "wait for the closing paren" mode. There was already a hack in the code to compensate for this, but it didn't work. I fixed the hack but I don't understand the real problem. Anyway, comparing Kermit with real (Franz) Lisp I discovered that comparison operators do not require two arguments, as Kermit has been doing, although they do require at least one. I changed Kermit to not require two, so now all the comparison predicates behave exactly like Franz Lisp, including getting an error if there are no args). ckuus[r3].c, 29 Nov 2006. From to-do list: Make a way to inhibit pattern matching in SWITCH labels. It's already there; just quote the wildcard characters; the only trick is that for some reason (such as that SWITCH is really an internally defined macro), a double quote is needed: switch \%1 { :a\\*z, echo literally "a*z", break :abcxyz, echo literally "abcxyz", break :a*z, echo a...z, break :default, echo NO MATCH } In first case, the asterisk is taken literally; in the third it's a metacharacter and the label matches any string that starts with 'a' and ends with 'z'. Array initializion would quit early if any initializers were undefined, e.g. "decl \&a[] = \%a \%b \%c" would stop at the first element if \%b was not defined, even though \%c might be defined. Fixed in dodcl(): ckuusr.c, 30 Nov 2006. DIR /ARRAY:a filespec, when the filespec does not match any files, terminates with the array undeclared. It would be better to return a declared but empty array (\&a[0] = 0). The code is already there to do that, but isn't working. And yet "declare \&a[0]" does indeed create a 0-element array ("show array" shows a dimension of 0). Turns out there were two problems; one was the careless recycling of a local variable ("array"), resulting in failure to create \&a[] (but not any other array). Fixed in domydir(): ckuus6.c, 30 Nov 2006. The other problem was that dclarray(), when called with an array name and a dimension of zero, does two different things depending on whether the array already existed. There is still a fair amount of confusion about whether a dimension of 0 indicates an array with 1 element (as it should) or a nonexistent array. We call dclarray() with a size of 0 to undeclare an array but we also need to able able to declare an array with only element 0. I changed dclarray() to treat a negative dimension as a command to destroy the array, and 0 or positive as a command to create the array with the given dimension. ckuus[r56].c, 30 Nov 2006. Next problem: when chkarray() returns 0, this should not be interpreted to mean the array does not exist. Looks like the only place this happened was in \fcontents(); fixed in ckuus4.c, 30 Nov 2006. If we include file selectors with DIR /ARRAY:&a and some of the files that match the given filespec but don't fit the selectors, the array's dimension is bigger than its number of elements. Added code at the end of domydir() to resize the array so \fdim() returns the number of filenames in the array, and also made sure that element 0 contains that number too. ckuus6.c, 30 Nov 2006. This would be a nice elegant way to loop over a bunch of files, if it worked: for \%i 1 \ffiles(*) 1 { rename \fnextfile() xxx_\flpad(\%i,3,0) } But in this loop, Kermit skips every other file (beginning with the first) and then runs out of files halfway through the loop. Why? Because in commands like RENAME and DELETE, the filename parser is in a chained FDB with the switch parser. First the switch parser, cmswi(), gets its hands on \fnextfile(), passing it through the evaluator and thus getting the first filename, which it then sees is not a switch, so now the field is parsed by the next parser in the chain, cmifi(), which causes \fnextfile() to be executed again. In fact, the FOR loop has nothing to do with; the same thing happens like this: void \ffiles(*) delete \fnextfile() This deletes not the first file, but the second one. Obviously users can be told not to refer to \fnextfile() in chained-fdb fields: for \%i 1 \ffiles(*) 1 { .f := \fnextfile(), delete \m(f) } but this is hardly intuitive. I had some clever ideas of how to make \fnextfile() work as expected in this context but it's way too much magic. Better to simply document that \fnextfile() is "deprecated" and the array format should be used: for \%i 1 \ffiles(*,&a) 1 { delete \&a[\%i] } The difference is, an array element doesn't change every time it's referred to! Added a /PRESERVE switch to the COPY command to preserve the timestamp and permissions of the file. I did this using the Kermit APIs so it should work for any version of C-Kermit or K95. ckuus[26].c, 30 Nov 2006. Added COPY /OVERWRITE:{ALWAYS,NEVER,OLDER,NEWER} to control name collisions when copying across directories. ckuus[26].c, 1 Dec 2006. --- Dev.23 --- Fixed a bug in SET TELNET PROMPT-FOR-USERID, SET AUTH KERBEROS[45] PROMPT, and SET AUTH SRP PROMPT in which the user's string was compared with a literal (s == ""), reported by Pavol Rusnak. Worse, empty strings (if the test succeeded) were turned into null pointers, and then fed to strlen(). Fixed in ckuus3.c, 5 Dec 2006. Added an optional 4th argument to \findex(), \frindex(), \fsearch(), and \frsearch(): the desired occurrence number of the searched-for string. \frsearch() was a bit tricky. ckuus[24].c, 7 Dec 2006. Added \fcount(s1,s2) to tell the number of occurrences of s1 in s2. ckuus[24].c, 8 Dec 2006. Added \ffunction(s1) to tell if a given built-in function is available. ckuus[24].c, 8 Dec 2006. Changed RENAME /COLLISION:PROCEED to be /COLLISION:SKIP, which is clearer. ckuus[26].c, 8 Dec 2006. For communication protocols: INPUT /COUNT:n to read exactly n characters without any matching. Can be used, for example, with CONTENT_LENGTH in CGI scripts; NUL characters are counted but not collected. ckuusr.[ch], ckuus4.c, 8 Dec 2006. There was a bad bug in the date-parsing routines; it's been there for years. If a date string includes a timezone, e.g. "Sat, 9 Dec 2006 19:26:23 EST", and converting to GMT changes the date, the variables for day, month, and year (which are used later) were not updated, and the final result was a day off. Fixed in cmcvtdate(): ckucmd.c, 10 Dec 2006. Built OK with SSL/TLS. Tested with the POP script, found that I broke INPUT when adding the /COUNT feature; there was a path through the code that could leave the "anychar" variable unset and therefore random. Fixed in doinput(). The POP script, which does not use /COUNT, works again and so does a new CGI script, which does use /COUNT. ckuus4.c, 10 Dec 2006. Supplied a missing comma in the help-text array for HELP SET TERMINAL, which resulted in bad formatting in K95 around SET SNI-FIRMWARE-VERSIONS. ckuus2.c, 10 Dec 2006. Made "help locus" a synonym for "help set locus". ckuusr.[ch], ckuus2.c, 11 Dec 2006. This morning the Columbia FTP server was malfunctioning in a perfect way for me to implement and test an FTP timeout mechanism. The server would close the data connection after sending the file, but the client never saw the close and was stuck forever in a recv(). I added code to do a select() on the data connection prior to entering the recv(), with a timeout on the select() that the user can establish with SET FTP TIMEOUT. Built and tested on Solaris 9, clear-text FTP. Also built cleanly for FTPS and tested against a server that does not hang; I don't have access to an FTPS server that would tickle the timeout code. ckcftp.c, 11 Dec 2006. --- Dev.24 --- Fixed a bug in the INPUT /COUNT: parser: the array of search strings was never initialized, which didn't matter before, but with /COUNT:, if the first element was not a NULL pointer, we'd treat it as a search string, and then if it happened to match something in the input stream, the operation would stop before the count was exhausted. Fixed by (a) initializing the array, and (b) ignoring any search strings if /COUNT: was given. ckuusr.c, 13 Dec 2006. Removed a debug() statement from zsattr() that suddenly started making some version of gcc complain, reported by Gerry Belanger. ckufio.c, 13 Dec 2006. --- Dev.25 --- Some casts for the 3 interior args of the new select() call in ckcftp.c for HP-UX 9. 14 Dec 2006. Changed \fkeywordvalue() to accept a string rather than a single character as its second argument, so that more than one separator could be specified, and to return -1 on error, 0 if it found nothing, 1 if given a kewyord but no value, and 2 if there was a keyword and a value. dokwval(): ckuus[24].c, 14 Dec 2006. Checked FTP timeout on command channel with FTP DIRECTORY of a big directory using a path into our ftp server that preserves the hanging behavior. The timeout was actually working, but the failure condition wasn't propogating back to the user, and there was no error message. Fixed in doftprecv2() and failftprecv2(): ckcftp.c, 15 Dec 2006. Added the obvious timeout checks for FTP uploads, but I have no way to test the code since our misbehaving FTP server does not hang when receiving files, only when sending them. But uploads work both with and without a timeout set, so at least no harm is done. ckcftp.c, 17 Dec 2006. When downloading with FILE DESTINATION NOWHERE (= /CALIBRATE), Kermit still checked the size of the incoming file and refused it if there wasn't enough free disk space, on platforms (such as VMS) where zchkspa()) actually works; reported by Bob Gezelter. ckcfn3.c, 18 Dec 2006. Built on Mac OS X 10.4.8 and NetBSD 3.1_RC3, all OK. 19 Dec 2006. ------------------------------ ***********************