ckc197.txt
资源名称:cku197.tar.Z [点击查看]
上传用户:dufan58
上传日期:2007-01-05
资源大小:3407k
文件大小:866k
源码类别:
通讯/手机编程
开发平台:
Windows_Unix
- command skipping files it should have listed. ckufio.c, 9 Mar 99.
- Supplied a missing "" in the unixware2 makefile target. 9 Mar 99.
- Increased size of v(filespec) buffer and removed warning about overflow.
- ckuus[rx].c, 9 Mar 99.
- Changes to SCO XENIX 2.3.4 makefile entry to update it to 7.0. 9 Mar 99.
- Put all of ckctel.c within #ifdef TNCODE..#endif, since there is no point in
- compiling it if TNCODE is not defined, and it chokes the SCO 3.2.4 compiler
- with "expression too complex". Various other minor tweaks to ckutio.c,
- ckucon,c, ckctel.c, and ckuver.h for XENIX. 9 Mar 99.
- Moved #include <signal.h> to above #ifdef SIGWINCH, since <signal.h> is where
- SIGWINCH is defined (David Sanderson). ckctel.c, 9 Mar 99.
- Fixes from Jeff to prevent IKSD from issuing Login: or Password: prompts when
- it is in server mode, and therefore accepting null passwords for anonymous
- users. ckcdeb.h, ckcmai.c, ckuus7.c, ckcpro.w, 9 Mar 99.
- Patches for NetBSD from the NetBSD group. ckcdeb.h, cku[ft]io.c, ckuusx.c,
- 10 Mar 99.
- Minor adjustments to the makefile to build on XENIX 2.3.4 with curses.
- 10 Mar 99.
- More Kerberos changes from Jeff. ckctel.c, 10 Mar 99.
- Added check for guest to { SEND, GET, RECEIVE } { /MOVE-TO, /RENAME-TO }.
- ckuus[r6].c, 10 Mar 99.
- Updates for DG/UX 5.4R4.11 on m88k. makefile, ckuver.h, ckuus[r5].c,
- 10 Mar 99.
- Updates for DG/UX 5.4R3.10 on m88k. makefile, ckutio.c (had to simplify the
- GTODONEARG #ifdefs to unconfuse its cpp), 11 Mar 99.
- Changed message about CONNECT failing because no CD to a hint. ck[uv]con.c,
- ckucns.c, 11 Mar 99.
- Changes from Jeff to accommodate (nonstandard) SAK Telnet option from IBM:
- ckuusr.h, ckuus[r3].c, ckctel.[ch], 13 Mar 99.
- Moved sw_armed and winchh() from ckcnet.c to ckctel.c, and added some needed
- #ifdefs to allow nonet builds. 13 Mar 99.
- Made rlog_naws() not static because it is called from ckctel.c module.
- ckctel.c, ckcnet.c, 13 Mar 99.
- Added -funsigned-char to SCO OSR5 makefile entries. makefile, 13 Mar 99.
- Discovered that the DIRECTORY command returned total garbage for perms, size,
- and date on SCO 5.0.5. It seems that lstat() is available and pretends to
- work (returns 0), but in fact puts junk in the stat buffer. Added -DNOLSTAT
- to SCO targets. (The SCO man page also mentions a statlstat() function but it
- works just as poorly as lstat()). However, even using stat() and testing with
- S_ISLNK() failed to reveal symlinks. Therefore a forced call to readlink()
- was required in this case. But even that did not work -- it turns out SCO
- readlink() doesn't like it if a "/" is on the end of a directory name. So now
- we strip it off before calling readlink(). zgetfs(): ckufio.c, 13 Mar 99.
- Actually the problem with lstat() seems to be more like this: On some
- platforms lstat() is to be used ONLY on symlinks; first stat() must be
- called to see if it is a symlink() and then (only) if it is, then call
- lstat() on it. But on other platforms, stat() does not tell you if a
- file is a symlink; you must call lstat() on all files to find out which
- ones are symlinks. Yet on OTHER files, lstat() still doesn't tell you if
- a file is a symlink -- it either behaves like stat() or else it returns
- garbage. In that case you have to call stat() and then readlink() on
- each file to see if it is a link.
- Another discovery: if DIR /RECURSIVE encounters a symlink to a directory, it
- follows it even if the linked-to directory is in the same directory, in which
- case it descends the same tree again. This happens on all UNIXes. So isdir()
- also has to check if it's a link, which fixes this problem. But breaks CD,
- etc. Another hornet's nest. I think I fixed it but it might need more work:
- isdir() says a file is a directory if it is a directory OR if the recursive
- flag is NOT set and it is a link to a directory. ckufio.c, 13 Mar 99.
- Previous change needed additional work for SCO 5.0.5. Generalized
- SCO-specific #ifdefs to be usable on any UNIX build: -DNOLINKBITS means that
- neither S_ISLNK() nor _IFLNK test is reliable and readlink() should be called
- instead. Added this to SCO CFLAGS. ckufio.c, makefile, 14 Mar 99.
- SCO 3.2v4.2 supports symlinks but C-Kermit doesn't sense them. Added
- -DNOLSTAT -DNOLINKBITS to the make targets. XENIX entries are OK since it
- doesn't support symlinks anyway. makefile, 14 Mar 99.
- Later, this was found in "man NS lstat" on OSR5.0.5:
- lstat obtains information about the file named by path. In the case of a
- symbolic link, lstat returns information about the link, and not the file
- named by the link. It is only used by the NFS automount daemon and should
- not be utilized by users.
- Send from remote, interrupt with X at local, connect back to remote. REMOTE
- prints SEND-failure hint ("interrupted" not set). Fixed in ckcfn[s3].c,
- 14 Mar 99.
- Added -DDCLPOPEN to SCO 3.2v4.2 makefile entries to suppress warnings about
- getcwd() and -DDCLPOPEN for popen(). Also added a new symbol, DCLFDOPEN, to
- force C-Kermit to declare fdopen() to suppress warnings about that one too,
- and added -DDCLFDOPEN to the 3.2v4.2 targets. Now it builds without
- complaint. makefile, cku[ft]io.c, 14 Mar 99.
- Updated the install target in the makefile to actually do most of the right
- stuff. 15 Mar 99.
- Added code to look around for the ckermit2.txt file at startup and keep a
- record of where (if anywhere) it was found. This is used in various messages
- and help text: NEWS, SUPPORT, SHOW FILE, etc. Also, updated assorted HELP,
- NEWS, INTRO, etc, texts. ckuins.txt, ckuus[245].c, 15 Mar 99.
- Updates to ckuusr.c and ckctel.c from Jeff. 15 Mar 99.
- Finished PURGE command. UNIX only. ckuus[27].c, 15 Mar 99.
- Fixed a few fencepost errors in the PURGE command. ckuus7.c, 16 Mar 99.
- Fixed znext() (again!) to return a positive number if it returned a file,
- and 0 when no more files left. ckufio.c, 16 Mar 99.
- From Jeff: integration of the TELOPT command with the Telnet protocol state
- machine. ckuusr.c ckctel.c ckuath.c ckctel.h ckuus5.c ckuus2.c, 16 Mar 99.
- Added SET OPTIONS PURGE. ckuusr.h, ckuus[237].c, ckermit2.txt, 16 Mar 99.
- The WHOAREWE mechanism was slightly off kilter: it was not setting FILE NAMES
- LITERAL unless the TRANSFER MODE was AUTOMATIC. In fact, it should always use
- literal file names when it recognizes a kindred spirit, regardless of the
- transfer mode -- text/binary file transfer is independent of filename
- conversion. This was causing REGET to fail -- the original file would come
- with a literal filename, the REGotten file would come with a converted one,
- thus appearing to be a different file and thwarting recovery. whoarewe():
- ckcfns.c, 16 Mar 99.
- Forgot to make the FAST, CAUTIOUS, ROBUST HELP-keywords invisible, so the
- 80x24 top-level "?" screen was overflowing. ckuusr.c, 16 Mar 99.
- Added -DCK_NEWTERM to Unixware entries -- buffering problem after file
- transfer... It's beginning to look like I should use newterm() whenever it's
- available.
- Fixed VMS-specific #ifdef foulups in ckudia.c and ckctel.c, 16 Mar 99.
- Updates to makefile from Jeff for KRB & SRP. 16 Mar 99.
- Adjustments for 16-bit QNX build. Had to remove a couple features (CSETS,
- KVERBS, etc) since ckuus4.o segment got too big. ckuus3.c, makefile,
- 16 Mar 99.
- Telnet changed to request binary mode in the other direction only if the
- TELOPT setting for that direction is REQUEST. This fixes stairstep problem
- when Telnetting to the BSDI Telnet server. From Jeff. ckctel.c, 17 Mar 99.
- Lots of picky little changes from compiler complaints on many platforms.
- Most modules, 17 Mar 99.
- It looks like AIX 4.2 needs CK_NEWTERM after all. But AIX 4.3 hangs at the
- end of a file transfer if built with CK_NEWTERM. So no more sharing makefile
- entries between AIX 4.2 and 4.3. makefile, 17 Mar 99.
- Had to add -DCK_NEWTERM for IRIX 5.3. makefile, 17 Mar 99.
- Support for VMS PRN files from Lucas Hart. ckvfio.c, 17 Mar 99.
- VMS CONNECT was missing a crucial IKSD start/stop negotiation. ckvcon.c,
- 18 Mar 99.
- UNIX builds without CKSYMLINK could not expand wildcards due to a missing
- #else part in the #ifdef CKSYMLINK..#endif clause in isdir(). ckufio.c,
- 18 Mar 99.
- I thought that UNIX znewn() took MAXNAMLEN into account when creating backup
- names, but I must have dreamed it. File transfer failed miserably when
- sending files to a 14-char file system when the backup name would be longer
- than 14 chars. Rewrote znewn() to lop the minimum necessary number of
- characters from the end of the filename before creating the backup name, and
- tested the result on a real 14-char file system with filenames ranging from 10
- to 14 and with backup numbers crossing decade boundaries; all OK now.
- ckufio.c, 18 Mar 99.
- Some weeks ago I noticed that sometimes the DIR command on HP-UX 5.00 would
- produce a phantom entry like:
- ---------- -1 0000-00-00 00:00:00
- Today I discovered that the phantom entries are deleted files, and there can
- be lots of them. It turns out that on some platforms, read() from a directory
- (or readdir()) can return deleted files, so the result of each read should be
- checked immediately for existence by looking at the inode. The code to do
- that was already there, but now in the wrong place due to the many additions
- for recursion, etc. Fixed in traverse(), ckufio.c, 18 Mar 99.
- From Jeff, 18 Mar 99:
- . Fix an IKSD deadlock: ckctel.c.
- . Make TELOPT command wait for responses: ckuusr.c.
- . Add SET TELNET BUG INFINITE-LOOP-CHECK: ckuus[23].c, ckctel.c.
- . Some fixes for SAVE KEY: ckuus7.c.
- From Jeff, 19 Mar 99:
- We received reports from Lucas Hart that the IKSD would not respond to
- packet requests from VMS C-Kermit 7.0 Beta 5. It was determined that
- VMS C-Kermit was not adhering to Telnet Protocol and was sending bare
- CRs on the wire from spack() when TELOPT_ME(TELOPT_BINARY) was WONT.
- Why was this happening when the code to properly handle Telnet
- Protocol was in spack() and worked fine on Unix and K95? It turns out
- that TCPSOCKET was not defined in ckcfn2.c because in VMS we define
- TCPSOCKET conditionally depending on the TCP/IP stack that is being
- used.
- I doubled-checked all of the other files that reference TCPSOCKET to
- determine if they failed to include ckcnet.h or included it in an #ifdef
- TCPSOCKET. ckcfns.c failed to include ckcnet.h at all and no other
- file wrapped ckcnet.h in an ifdef.
- Tests show VMS C-Kermit now works fine.
- Added ckcnet.h to dependencies for ckcfns.c and ckcfn2.c. makefile, 19 Mar 99.
- Added prototypes for tn_wait() and tn_push() to ckctel.h. 19 Mar 99.
- The DG/UX 5.4R3.10 version did not have any of the "check if chars waiting at
- the console" methods enabled. Added -DSELECT to the makefile entries, but
- that made ckutio.c blow up in the preprocessor, which apparently does not like
- #ifdefs inside function call argument lists. Rearranged the gettimeofday()
- call in msleep(). ckutio.c, 20 Mar 99.
- Assorted minor fixes to the UNIX makefile. 20 Mar 99.
- ---Beta.05---
- From Jeff, 23 Mar 99:
- . A fix for fword() and fsplit(). ckuus4.c.
- . Telnet details... close in progress ... ckcnet.c, ckctel.c.
- . Add DONT/WONT Kermit to "-0" command-line actions. ckuusy.c.
- . Force K95 to restore the cursor in SET TERM CURSOR. ckuus7.c.
- . Authorization/encryption changes. ckuath.c, ckuat2.h, ckctel.c, makefile.
- If the first command line arg is a filename, do not automatically execute the
- initialization file. If the script author wants the init file to be executed
- she can include a TAKE command in the script. Prior to this, there was no
- way to *prevent* init file execution when a script was invoked in this manner.
- prescan(), ckuus4.c, 23 Mar 99.
- Along similar lines: a rather drastic change to promote the use of C-Kermit as
- a scripting tool -- if a filename is given as the first command-line argument,
- the rest of the words on the command line are arguments for the script, NOT
- for Kermit. So no more "scriptname -x -y = arg1 arg2 arg3 ...". Now it's
- just "scriptname arg1 arg2 arg3 ...", just like writers of scripts in any
- other language would expect. If the first command-line arg is NOT a filename,
- the behavior is as before; this required considerable code juggling between
- prescan() and cmdini(), and also required that ckcmai() *always* call cmdini()
- before prescan(). Thus the conditional internal call to cmdini() from within
- prescan() was removed. Now we can have Kermit scripts that behave exactly
- like shell scripts: no init file execution, no messages, no banner, etc, and
- argument passing is exactly the same. ckcmai.c, ckuus[45].c, and documented
- in the new section 7.19 of ckermit2.txt, 23 Mar 99.
- At Jeff's suggestion, redid yesterday's work to preserve existing behavior
- mainly so as not to break K95 startup scripts & shortcuts. New syntax is
- the same, except the "kerbang" line now must end with " +" (a space and a
- plus sign). ckcmai.c, ckuusr.h, ckuus[45].c, 24 Mar 99.
- From Jeff: Put back the fix to fword/split() that was lost in yesterday's
- edits. ckuus4.c, 25 Mar 99. Later, Mark Sapiro (who reported the problem)
- verified the fix.
- From William Bader: Cleanup of the older SCO makefile targets. Some of these
- have a limit of 25 -D's in a cc invocation, and so a common block of
- definitions for these targets was moved to ckcdeb.h. Plus he found a data
- declaration at the entry to a switch() statement (a no-no): ckuus3.c. Plus a
- place where strcpy() was copying something to itself in doxsend(): ckuusr.c.
- Built from new sources & makefile on SCO OSR5.0.5 (5 different targets) -- all
- OK, but that proves nothing about the others. 25 Mar 99.
- Added BUILDID=yyyymmdd to makefile. It doesn't do anything; it's just there
- for anybody (like Peter E) who uses shell scripts to do lots of builds from
- intermediate (e.g. inter-Beta) test versions and wants a unique ID. makefile,
- 25 Mar 99.
- Added brace-stripping to EXIT message. ckuusr.c, 25 Mar 99.
- Added help for the "+" option. ckuus2.c, 25 Mar 99.
- Cleaned up the hideous #ifdef mess around #include <sys/time.h> in ckutio.c
- by moving it to ckcdeb.h. Any make targets that are not covered by the new
- symbol SYSTIMEH, or are improperly covered by it, can add -DSYSTIMEH or
- -DNOSYSTIMEH. Did quick builds on SunOS, SCO, HP-UX, and AIX to make sure I
- didn't break anything big. ckcdeb.h, makefile, ckccfg.txt, 25 Mar 99.
- Added vanity banners for Motorola SV/68 and SV/88. makefile, ckuver.h,
- 25 Mar 99.
- Changed prescan to handle the case where "+" is given with nothing after
- (it just errors out). ckuus4.c, 25 Mar 99.
- Changed SHOW FILE and SHOW PROTO to add SHOW XFER to their Also See lists.
- ckuus4.c, 25 Mar 99.
- Added a new symbol USE_STRERROR, which should be defined if strerror() is
- available for use. Added a new FreeBSD 3.x makefile target that defines this.
- plus designer heralds for the three FreeBSD versions. makefile, ckuusx.c,
- ckcdeb.h, ckuver.h, 25 Mar 99.
- FAST, CAUTIOUS, and ROBUST did not work as top-level commands because I put
- them in the command keyword table but never filled in the action routines.
- Since they were invisible anyway, I just removed them. Now they are executed
- as macros, just as they were before. ckuusr.c, 25 Mar 99.
- Minor corrections to yesterday's Motorola SV/68 and /88 fixes from Gerry
- Belanger. ckcdeb.h, makefile, 26 Mar 99.
- Another updated SCO makefile target from Wm Bader. 26 Mar 99.
- Moved the flonam[] declaration so NOSPL builds would work. ckuus4.c, 26 Mar 99.
- Although statements of the form:
- if <condition> .%a = <definition>
- worked correctly, the same construction used for a macro:
- if <condition> .macroname = <definition>
- was parsed incorrectly, so subsequent "if defined macroname" would fail when
- it should succeed. Fixed in dodef(): ckuus6.c, 26 Mar 99.
- Added DIR /MESSAGE:text to append the given message to the end of each
- directory listing line. Handy in scripts. ckuusr.h, ckuus6.c, ckermit2.txt,
- 26 Mar 99.
- Changed SHOW OPTIONS to call prtopt() to manage word wrap and page pausing,
- rather than just doing printf's, since lines can easily get longer than the
- screen. ckuus[r567].c, 26 Mar 99.
- Added a "netbsdxx" target, which includes -DNOIKSD. makefile, 26 Mar 99.
- Updated sys3upcgm target to remove redundant -D's. makefile, 26 Mar 99.
- Fixed the SET HOST hint about Rlogin being a priv'd port not to appear unless
- they actually were trying to make an Rlogin connection. ckuus7.c, 26 Mar 99.
- From Jeff: More fixes to auth and encrypt stuff, added /USERID to SET HOST
- command switches: security modules + ckuusr.h, ckuus7.c, 27 Mar 99.
- From Jeff: Allow /USERID switch to take empty value; update SET HOST help
- text; ckuus[27].c, 29 Mar 99.
- One of the more embarrassing and unprofessional aspects of Kermit's script
- language is the IF/XIF distinction. A simple change allows multiple commands
- on one line if the line is surrounded by braces and commands are separated by
- commas:
- C-Kermit> { echo one, echo two }
- one
- two
- C-Kermit>
- This, in turn, makes it possible to have constructions like:
- if <condition> { command, command, ... }
- else if <condition> { command, command, ... }
- else if <condition> { command, command, ... }
- else { command, command, ... }
- Another simple change allows XIF statements to include any statement after the
- "else" token, just as C programmers would expect:
- xif <condition> {
- commands
- } else xif <condition> { <-- This is new.
- commands
- } else while <condition> {
- commands
- }
- But the real goal is to consolidate IF and XIF without breaking existing
- scripts; difficult because "XIF <cond> { commands } else { commands }" is one
- command, whereas "IF <cond>" followed by ELSE is two commands. So I finagled
- the internal rules:
- a. If an IF command has a THEN-part that starts with "{" then treat it as XIF.
- b. If an XIF command lacks an ELSE-part, treat it as an IF.
- This seems to allow all combinations, plus others not recognized before.
- Aside from testing each case individually I also changed all XIFs to IFs in
- ckedemo.ksc, and it worked fine. So bye bye XIF. ckucmd.h, ckuusr.h,
- ckuus[56].c, ckucmd.c, ckermit2.txt [1.21,7.20], 29 Mar 99.
- More auth stuff from Jeff: ckcnet.c, ckuath.c, ckuus3.c, ckuus5.c, ckuus7.c,
- makefile, 29 Mar 99.
- More auth stuff from Jeff: ckuath.c, ckuus7.c, 30 Mar 99.
- Added #ifdef NOSHOW around the SHOW OPTIONS routines. ckuus[r7].c, 30 Mar 99.
- Moved IF/WHILE-condition evaluator to a separate routine, boolexp(). Changed
- boolexp() IF/WHILE parser to use chained FDBs rather than only cmkey() so it
- can parse not only regular IF/WHILE conditions, but also numbers and "fields".
- ckuus6.c, 30 Mar 99.
- Added flag for cmfld() as an option to parse items within parentheses instead
- of within braces. This allows it to parse the parenthetical expression in
- "if (<condition>) <command>" as a field even if it contains spaces. ckucmd.c,
- 30 Mar 99.
- But the idea of parsing a parenthesized expression as a field and then
- reparsing it proved unfruitful so I gave up on that and simply made "(", ")",
- "&&" (and AND), and "||" (and "OR") keywords with the appropriate semantics.
- This has numerous advantages (?-help still works for the condition words, etc)
- but requires space around every token. The result executes ckedemo.ksc
- without a hiccup and after some debugging, also handles boolean expressions
- of pretty much arbitrary complexity. ckuus6.c, ckermit2.txt, 30 Mar 99.
- More auth stuff from Jeff: ckuusr.h,ckuus[37].c,ckcnet.c,ckuath.c, 30 Mar 99.
- From William Bader, 31 Mar 99:
- . Updated SCO targets: makefile.
- . Move USE_MEMCPY to after all system headers have been included: ckcdeb.h.
- . Break down complex printfs for Xenix C compiler: ckctel.c, ckuus4.c.
- . Xenix 2.3.4 cc adjustments to ckufio.c.
- . Additional #includes for SCO Xenix 2.3.4 TCP/IP: ckcnet.h.
- WHILE command wasn't working after yesterday's changes. Fixed by putting
- parens around the condition generated for the WHILE macro. ckuus6.c,
- 31 Mar 99.
- Made XIF invisible. ckuusr.c, 31 Mar 99.
- If "while true { get x.x }" is given in remote mode, typing lots of ^C's
- caused a core dump every time. There was a window between when the console
- was restored to its previous modes (the ttres() call in proto()) and the
- interrupt handler was re-armed (in parser()). I hacked around this by having
- proto() re-arm the interrupt handlers before ttres() is called (which, in
- remote mode, restored the terminal's sensitivity to ^C, etc). ckcfn2.c, 31
- Mar 99.
- The ^C^C^C pseudointerrupt at server command wait always set success = 0. In
- fact, it should leave the success variable alone if any file transfers have
- been attempted; should set it to 1 if no file transfers have been attempted
- since server mode was started, and should set to 0 if a transfer was in
- progress. Fixed in ckcpro.w, 31 Mar 99.
- Reinstated FAST, ROBUST, and CAUTIOUS as top-level keywords (which simply
- run the macros of the same name), so now completion and HELP work for them.
- However, they are still invisible due to limited real-estate on the top-level
- "?" screen. ckuusr.c, 31 Mar 99.
- Discovered that two top-level keyword symbols had the same value. Fixed in
- ckuusr.h, 31 Mar 99.
- Assorted improvements to HELP texts. ckuus2.c, 31 Mar 99.
- Made /LOG and /LIST and /VERBOSE all be synonyms for each other in the PURGE
- and DELETE switch tables. Ditto for /NOLOG, /NOLIST, and /QUIET. ckuus[67].c,
- 31 Mar 99.
- Changed askmore() not to ask if not at top level. That's because the terminal
- modes are likely to be messed up and so single-character responses (like space
- bar, "n", etc) can't be processed correctly anyway. ckuusx.c, 31 Mar 99.
- Added DIRECTORY [ other-switches ] /ARRAY:x [ filespec ]. If the /ARRAY:x
- switch is given (x is the array name, required), the filenames are put in the
- array, rather than listed. This allows the DIRECTORY file-selection switches
- to be used to build a custom file list easily and quickly. ckuusr.h,
- ckuus6.c, 31 Mar 99.
- Fixed some long lines in ckuath.c. 1 Apr 99.
- Backed off on yesterday's askmore() change -- apparently it is not needed
- after all. ckuusx.c, 1 Apr 99.
- Added three simple routines to allow rudimentary screen formatting by scripts:
- ck_cls(), ck_cleol(), and ck_curpos(row,col). In UNIX, these rely on
- termcap/terminfo; elsewhere they use the built-in stuff (MYCURSES, SMG, etc).
- ckuusr.h, ckuusx.c, 1 Apr 99.
- Added SCREEN { CLEAR, CLEOL, MOVE <row> <col> }. These all work fine on a
- termcap system (SunOS), on terminfo system (SCO, HP, Solaris), and on VMS with
- SMG, but obviously need wider testing. The UNIX versions of these commands
- use the tgetent() info (which we were already getting) thru calls to
- tgetstr(), tgoto(), and tputs(). They don't depend on curses at all, and
- curses does not need to be initialized for these commands to be used (but SMG
- does; the new code takes care of that). (I realize that some of these new
- commands have synonyms in K95; these are indicated in the K95 HELP SCREEN
- text.) Also ensured that -DNOCURSES builds still work. ckuusr.[ch],
- ckuus[x2].c, 1 Apr 99.
- Reinstated screen-clearing on Ctrl-L in the parser. ckucmd.c, 1 Apr 99.
- Made CLS a visible command in all versions, not just K95. ckuusr.c, 1 Apr 99.
- Auth changes from Jeff: ckuus[37].c, ckuath.c, 2 Apr 99.
- Fixed long lines in ckuath.c, 2 Apr 99.
- Makefile changes for AT&T 7300 and SCO UNIX. 2 Apr 99.
- Discovered that the NOT operator does not always work as intended in compound
- Boolean expressions. E.g. in "if ( not true || false )" evaluates to true
- rather than false because NOT affects everything that follows. NOT is a unary
- operator that should bind only to the quantity or expression immediately to
- its right. To fix:
- . I added a new math operator, "prefix !", which inverts the truth value
- of its operand (as distinct from "prefix ~", which flips the bits, and
- "postfix !", which is the factorial operator).
- . Used this to implement NOT internally.
- ckuus[56].c, 2 Apr 99.
- More auth changes from Jeff: ckuath.c, ckcnet.c, ckuus3.c, 2 Apr 99.
- From Jeff: Make 2nd [x]makestr() arg const in ANSIC builds. ckclib.[ch],
- 2 Apr 99.
- Changed GETC to not supply a gratuitous CRLF if given from a script (i.e.
- cmdsrc() != 0). ckuus6.c, 2 Apr 99.
- Added != to repertoire of logical operators for Boolean assertions, as in
- "if ( != %c 3 ) ..." ckuusr.h, ckuus6.c, 2 Apr 99.
- Deduced that termcap/terminfo cursor coordinates are 0-based, not 1-based.
- Adjusted the curses version of ck_curpos() accordingly. ckuusx.c, 3 Apr 99.
- Discovered a new problem: missing macro parameters were not being replaced
- by an empty value. For example:
- def cd { cd %1 }
- xx
- would cause an error, rather than defaulting to the current directory as it
- should. Hmmm, actually, it's an old problem -- it was always there. Years
- ago, we went to extreme lengths to try to accommodate backslashes in filenames
- in K95: cmifi() prescans the string (using the chkvar() function) to see if it
- contains variables. So if the user said "cd c:blahfoo", the scan would not
- turn up any variables, and so we would not pass the string through the
- evaluator, which would have eaten the backslashes (or worse). But what about
- "cd %a"? Is "%a" a variable or an actual directory? To solve this dilemma,
- chkvar() would send a copy of "%a" to the evaluator and see if it had a
- definition. If it did, chkvar() would say it was a variable. If it did not,
- chkvar() would say it was not a variable, and so therefore it would not be
- evaluated. It turns out this has rather disastrous consequences for macro
- arguments that are omitted. In the "xx" definition above, %1 does not have a
- definition, even though it is a variable, and therefore it is not evaluated,
- and therefore "%1" is given literally to the CD command. The only sensible
- fix for this is to change chkvar() to check the syntax of the variable, but
- not whether it has a value. That means if any PC users want to refer to a
- file that has the same syntax as a variable, they'll need to double the
- backslash. chkvar(): ckuus6.c; cmifi2(): ckucmd.c, 3 Apr 99.
- This was (at least) a double-ended problem. It also turns out the evaluator,
- zzstring(), gave a failure return code if a variable was empty, which is
- wrong -- emptiness is a perfectly valid value for any variable. zzstring():
- ckuus4.c, 3 Apr 99.
- There's more. cmifi(), rather than checking the return code from zzstring(),
- checked the length of the result (0 == failure, > 0 == success), which, again,
- prevented substitution of an empty variable value. cmifi() was changed to
- test the zzstring return value; if negative we return a parse failure; if 0 or
- greater but the result was empty, we substitute the given default. ckucmd.c,
- 2 Apr 99.
- In fact, the improper-checking-of-zzstring-success syndrome was pervasive
- throughout all the ckucmd routines and similar fixes had to be applied to most
- of them. ckucmd.c, 3 Apr 99.
- The mess in cmofi() was especially bad. Instead of calling chkvar(), it had
- its own inline -- but slightly different -- version of chkvar(), which in any
- case did not accomplish its purpose. For example, "mkdir c:123" (the classic
- example) created a directory named "{". But cmifi(), which does use chkvar(),
- could not handle "cd c:123" or "rmdir c:123" when 123 referred to "{". So
- I changed cmofi() to use chkvar() like cmifi() does -- at least now they are
- symmetrical. For total consistency, I put every reference to chkvar() in
- ckucmd.c in #ifdef OS2..#endif (previously some of them were this way and some
- weren't). Obviously this will need testing and debugging in K95. ckucmd.c,
- 3 Apr 99.
- Meanwhile, chkvar() was also called by IF DEFINED. Since chkvar() no longer
- checks if a variable is defined, the IF DEFINED code had to be changed to
- check this itself. doif(): ckuus6.c, 3 Apr 99.
- Bulletproofed all cm...() routines against null pointers passed as arguments.
- ckucmd.c, 3 Apr 99.
- In running the big script torture tests I saw a few glitches, and in trying to
- isolate them, was able to produce a core dump consistently. At some time in
- the past not revealed in my notes, some of the cm...() routines were "fixed"
- to not write into their help-message argument (xhlp), by first copying it to a
- global malloc'd buffer using makestr() (thus freeing the previous one, if
- any), and then changing xhlp to point at the malloc'd buffer. This seemed
- like a safe bet, and I'm still not sure why it wasn't, but these very makestr()
- calls (the free() in particular) were the location of each crash, which
- usually occurred only after the program had been running for quite a while.
- Changing the global malloc'd buffer to a series of local automatic ones cured
- the problem. ckucmd.c, 3 Apr 99.
- Or did it? There were still some infrequent glitches evident in any scripts
- involving arrays, or more to the point, arrays explicitly declared with the
- DECLARE statement that included a list of initial values. Turns out I was
- malloc'ing BYTES rather than WORDS for the array pointers in the DECLARE
- parser. This was obviously a serious memory leak and could have had any
- consequences at all. The bad code has been with us since 18 Jun 1997 (i.e.
- after 6.0 was released, but before K95 1.1.13. I doubt, however, that this
- has been the cause of any crashes in real life, because who uses array
- initializers?). Fixed in ckuusr.c, 3 Apr 99.
- After these changes, "send *" wouldn't work. This one was really scary.
- Something was writing over cmarg2. I traced it to zfnqfp() in ckufio.c.
- There was a loop that, under certain bizarre conditions, might not terminate
- properly, and when it didn't it could write all over memory -- and it seems
- today was my lucky day at creating bizarre conditions. I put in a better
- termination test and also rearranged some code that didn't make sense.
- ckufio.c, 3 Apr 99.
- Certain debugging statements write memory addresses, PIDs, etc, into the debug
- log, some of them periodically -- e.g. for every command, which makes it very
- difficult to automatically compare long debug logs. I commented out many of
- the debug statements that do this. ckutio.c, ckucmd.c, ckuus4.c, 3 Apr 99.
- After all this I ran hundreds of script torture tests and transferred many
- gigabytes of files in both directions with no trouble. I'm not 100% confident
- that all holes are plugged, but some are. Progress...
- The next day...
- New simplified makestr() from Jeff -- I just took it without looking at
- it very much. But I used it all day and it seemed OK. Script torture tests
- still work, etc. ckclib.c, 4 Apr 99.
- Putting zfnqfp() back the way it was before yesterday brings back the
- overwriting of cmarg2, so something is still wrong. Added code to zfnqfp()
- to force a core dump at various places (before and after the code that writes
- over cmarg2), and then got a backtrace with gdb. In all cases, the stack
- looked just fine. Built a version with the malloc debugger. Can still
- replicate the error, but the malloc debugger finds nothing wrong. Built a
- version on an entirely different platform (PC with SCO 5.0.5, with both gcc
- and with SCO cc) and got exactly the same problem, so it's not architecture or
- compiler dependent. So this pretty much narrows it down to plain old bad
- code. But the zfnqfp() code looks just fine. The problem involves its tmp[]
- buffer, an automatic array. The 9th and subsequent bytes written into this
- buffer appear as the value of cmarg2 (if I make the buffer static global the
- problem disappears). Therefore cmarg2 must be pointing at a memory address 8
- bytes to the right of this automatic buffer -- but how could that happen?
- Searching through doxsend() revealed the following mistake:
- if ((x = cmtxt(m,"",&cmarg2,NULL)) < 0)
- goto xsendx;
- This dates from about July 1997 so was present in C-Kermit 6.1 and K95 1.1.14
- and later. The mistake was forgetting that the string pointer returned by any
- cm...() routine points to an ephemeral string (in fact it is the atom buffer);
- whatever string it points to must be copied to a safe place before calling any
- further cm...()'s. So of course the buffer pointed to by cmarg2 in this case
- had probably been recycled 100 times by the time we finally needed it. The
- fix is to treat "send foo bar" exactly like "send /as-name:bar foo", using the
- same data structures and buffers, etc, and then setting cmarg2 from them after
- the command has been confirmed. doxsend(): ckuusr.c, 4 Apr 99.
- Could this have caused a core dump? I don't think so. It just meant that
- cmarg2 (the "as-name" pointer) might have been pointing to a random string,
- which would result in either (a) a file being sent with the wrong name, or
- (b) C-Kermit refusing to send a file because an as-name was given when the
- source specification was wild.
- Meanwhile, I removed about 400 useless lines from ckuusr.c that were left
- behind from before all the SEND-class commands (except PSEND) were routed to
- doxsend(). Made a new addsend() routine that consolidates the ADD SEND-LIST
- code which was previously scattered all over. 4 Apr 99.
- Fixed a bug in ADD SEND-LIST: it wasn't putting the full pathname in the send
- list, so if you changed directories, it wouldn't find the files -- or worse,
- it would send the wrong ones. The code to get the full pathname was there,
- but it wasn't working right. This goes all the way back to 6.0. Fixed in
- ckuusr.c, 4 Apr 99.
- Made an improvement to ADD SEND-LIST: the file type (text or binary) is
- defaulted according to our pattern lists, rather than the prevailing file type
- if (a) PATTERNS are ON, and (b) we actually have pattern lists, (c) the
- prevailing file type is not IMAGE or LABELED, and (d) the file matches a
- pattern. ckuusr.c, 4 Apr 99.
- Fixed a bug I introduced yesterday. Don't supply default in cm...() functions
- when giving help -- only when the field is actually being entered (via field
- or command termination or by completion). Otherwise we get incomplete menus
- when the user types "?" -- in fact, the menu only contains one item if a
- default was included in the cm...() call. ckucmd.c, 4 Apr 99.
- After all these changes, made sure that SEND, MSEND, MAIL, PSEND, ADD, REMOVE
- still work. Some didn't, but now they do.
- Added IF OPEN CONNECTION (fails if remote, gets ttchk() result if local)
- and IF OPEN CX-LOG. ckuus6.c, 4 Apr 99.
- The preponderance of "output blah13" in scripts is (a) ugly, (b) confusing
- to newcomers, and (c) begs for a command to send a "line", so I added LINEOUT,
- which is just like OUTPUT, except it supplies a carriage return at the end
- (following Telnet rules, newline settings, etc). (I thought of calling it
- OUTLINE but that means something else). ckuusr.[ch], ckuus5.c, 4 Apr 99.
- Corrections from Jeff to yesterday's code: ckuus5.c, ckucmd.c, ckuusr.h,
- 5 Apr 99.
- Discovered that when sending from a SEND-LIST, the file type given in the
- ADD command was ignored if TRANSFER MODE was AUTO and PATTERNS were ON.
- Fixed sfile() to use the file type from the SEND-LIST. ckcfns.c, 5 Apr 99.
- ^C^C^C at Kermit in remote RECEIVE mode was giving an annoying hint message.
- Fixed in parser(), ckuus5.c, 5 Apr 99.
- Made CLEAR SCREEN a synonym for SCREEN CLEAR. (Yes, so now we have *four*
- commands that do the same thing.) ckuusr.[ch], 5 Apr 99.
- SCREEN { CLEAR, MOVE, CLEOL } doesn't work in IKSD. I wonder why. It knows
- the terminal type (and TERM is defined). Maybe tgetent() fails when called
- from a process that does not have a tty. Added some diagnostics. Also made
- the SCREEN command default to using ANSI sequences in UNIX if tgetent() fails.
- If this bothers anybody, I'll add SET commands or something. Otherwise, it'll
- be like K95 host mode, which uses ANSI sequences no matter what (actually we
- might be able to do better in 1.1.18 -- if it knows the client's terminal type,
- it also knows the clear-screen, cleol, and curpos sequences, right? So then
- the SCREEN command could "just work" if the ck_blah() routines were filled in
- for the 'sstelnet' case, no matter what the client's terminal type, as long
- as it was recognized & supported by K95). ckuusx.c, 5 Apr 99.
- Gerry Belanger reported compilation errors with the new tgetstr() and tputs()
- calls. Problem 1: tgetstr() was called before #include <curses.h>. The
- obvious solution would have been to move the #include higher up, but it turns
- out it is where it is for a reason, namely that it clobbers numerous other
- symbols that we depend on. So the actual solution was to extract the tgetstr()
- calls to a separate routine and put the new routine below the #include. Since
- there was no point in having it return a value, I made it VOID but then it
- wouldn't compile -- eventually I rediscovered that VOID was one of the macros
- that <curses.h> clobbers. Problem 2: tputs() wants a function pointer as its
- 3rd arg (OK) but the function must be one that takes an int as a parameter, not
- a char. I was using conoc(), of course, but that takes a char. So I installed
- a stupid interface routine that takes an int, converts it to a char and *then*
- calls conoc(). Isn't there a better language than C? ckuusx.c, 5 Apr 99.
- Corrections to new ckuusx.c after trying to compile it on FreeBSD 2.2.7
- myself. ckuusx.c, 6 Apr 99.
- Removed the old, commented-out doget() routine, about 250 lines. ckuus6.c,
- 6 Apr 99.
- Changed REMOTE HOST and REMOTE KERMIT to copy the cmtxt buffer to a safe place
- before use; not strictly necessary, but it's poor practice to take advantage
- of this special case. ckuus7.c, 6 Apr 99.
- New VOS network module from Jeff. cklnet.c, 6 Apr 99.
- Added support for Motorola Codex modems. ckuusr.h, ckudia.c, 6 Apr 99.
- Discovered that streaming transfers to C-Kermit on HP-UX 8.00, 9.00, or 10.20
- in remote mode do not work at all -- they lose characters galore; this is
- probably true, therefore, for all HP-UX versions. In each case, if I turn off
- streaming and reduce the packet-size x window-size to 500, uploads work. (But
- there's no problem with streaming downloads.) Further experimentation shows
- the problem goes away if I tell the remote C-Kermit to "set flow xon/xoff"
- prior to transfer. Evidently the HP-UX Telnet server treats "flow none" as a
- request to drop characters, just like VMS. Pretty silly! Changed default
- remote-mode flow-control for HP-UX from NONE to XON/XOFF (also tested KEEP and
- RTS/CTS and neither one works), and updated file-transfer failure hints
- accordingly. ckcmai.c, ckuus5.c, ckermit2.txt, 6 Apr 99.
- Changed fsplit() to not require an array argument, in which case it simply
- returns the word count. Also not to require that the array, if specified, be
- predeclared -- if it is not, it is created dynamically. Also to allow an
- empty array argument followed by break and/or include arguments. Also to
- work with no arguments at all, in which case it returns "0".
- ckuus4.c, 6 Apr 99.
- Changed DECLARE with initializers to accept empty subscript brackets in which
- case the array is sized according to the number of initializers (like C) --
- including none at all. Also changed DECLARE to evaluate the initializers
- rather than copy them literally -- otherwise there would be no way to
- initialize an array element to the value of a variable, rather than its name.
- This way, a literal name can still be given according to normal rules,
- e.g. "dcl &a[] = \%a ..." ckuusr.c, ckermit2.txt. 6 Apr 99.
- Auth stuff & help text from Jeff: ckcmai.c, ckuus2.c, ckuath.c, ckcssl.h,
- 7 Apr 99.
- Added date-time format info to HELP DATE and then added a reference to this
- from all other HELP texts that involve date/times. ckuus2.c, 7 Apr 99.
- Added [wk]ermit to UNIX binary patterns. ckcmai.c, 7 Apr 99.
- Increased the command buffer length from 10K to 64K for (BIGBUFOK + not NOSPL)
- builds. This allows for longer strings, macros, etc. Tested wermit10k
- against wermit64k running ckedemo.ksd (minus the interactive parts) side by
- side on the same computer under various loads (this is a compute-bound script
- with no i/o). wermit64k is 10% to 30% slower under various loads. In 21
- trials, wermit10K was faster than wermit64K 19 times and the same 2 times; on
- average the wermit10k version was 19.7% faster. Changing the buffer to 32K
- reduces the difference to a fairly constant 10%. The big hit in all cases
- comes in the evaluation of recursive user-defined functions (because we have
- to replicate the command buffers for every level of recursion). If we remove
- the recursive function from the script, there is no difference in execution
- time among the three versions. So... whereas:
- . There will always be SOME limit on string length;
- . Most people will never write or use a recursive function;
- . Other script languages like DCL have a 32K limit;
- . 64K is (more) likely to cause trouble on segmented architectures;
- . In SunOS at least the buffer size doesn't affect the executable size;
- . Kermit is a very high level language so scripts are relatively short;
- . Nobody has complained about the 10K restriction on script length;
- . Long macros can always be decomposed anyway;
- . The only complaint has been about the max length of a variable's value;
- . It would be a bad idea to add a runtime SET command for this (since it
- would pull the rug out from under the very command parser that was
- parsing it)...
- ... I changed the buffer length to (32K - 1).
- Added v(inwait) = timeout value of most recent INPUT command. ckuusr.h,
- ckuus4.c, 7 Apr 99.
- Defined a bunch of switches to the DELETE command to make it more consistent
- with DIRECTORY, PURGE, and SEND. ckuusr.h, ckuus6.c, 7 Apr 99.
- Filled in the DELETE switch definitions:
- /LIST = /LOG = /VERBOSE (These were there before but I redid them)
- /NOLIST = /NOLOG = /QUIET (ditto)
- /[NO]HEADINGS
- /[NO]DOTFILES
- /[NO]PAGE
- /EXCEPT:<exception-list>
- /BEFORE:<date>, /NOT-BEFORE:<date>, /AFTER:<date>, /NOT-AFTER:<date>.
- And added SET OPTIONS DELETE and added DELETE options to SHOW OPTIONS.
- Still needs fine tuning, help text, and maybe a few more switches, etc.
- ckuus[356].c, 7 Apr 99.
- From Jeff, IKSD fixes:
- . initialize socket for non-blocking I/O and OOB inline
- . correct handling of CKXPRINTF definitions in ckuusx.c that was
- resulting in data corruption on encrypted sessions.
- . Many corrections to data transfer and negotiations for SSL/TLS
- . Traced further data corruption on encrypted sessions to the
- output of informational messages to the socket during negotiations.
- The messages were meant for the end user but when IKSD is being
- used they should be skipped. Solves lots of miscellaneous issues.
- . Discovered that when DES is not available from K95CRYPT.DLL and
- not exported from the Kerberos DLLs we can't performed Mutual
- authentication. I'm not sure whether we care or not at the
- present time.
- . Do not initialize Telopt negotiation defaults until after sysinit()
- so that we can make responsible choices based upon installed
- libraries.
- Plus: The ckgetpid() prototype should not be #ifdef CKGETPID, corrections for
- Stratus. ckcmai.c ckuusr.h ckuus6.c ckutio.c ckuath.c ckctel.c ckcnet.c
- cklnet.c ckuusx.c, 8 Apr 99.
- Later... The Stratus version builds! (Dat Thuc Nguyen built it with TCP/IP
- and X.25 support on two architectures.)
- Parameterized fileselect() and moved it to ckclib. ckcfns.c, ckclib.[ch],
- 8 Apr 99.
- Changed DELETE to use fileselect(). ckuus6.c, 8 Apr 99.
- Added cmgkwflags() to get keyword flags after successful cmkey() parse.
- This makes it much easier to check if a switch requires an argument. Added
- appropriate calls everywhere (or at least most places) switches are parsed.
- ckucmd.[ch], 8 Apr 99.
- Today's project is to make SEND, DIRECTORY, DELETE, and PURGE use the same
- set of file-selection switches, and then use fileselect() based on them:
- DIRECTORY:
- /[NOT-]{BEFORE,AFTER},/LARGER,/SMALLER,/EXCEPT.
- DELETE:
- /[NOT-]{BEFORE,AFTER},/LARGER,/SMALLER,/EXCEPT.
- PURGE:
- /[NOT-]{BEFORE,AFTER},/LARGER,/SMALLER,/EXCEPT,/[NO]DOTFILES,/[NO]HEADING
- Also added /SIMULATE to DELETE and PURGE for testing / previewing. Also Added
- /ASK to DELETE and PURGE (like "rm -i") because people ASKed for it; this
- required adding a "quit" option to getyesno(). ckcfns.c ckclib.c ckclib.h
- ckcpro.c ckucmd.c ckucmd.h ckuus3.c ckuus5.c ckuus6.c ckuus7.c ckuusr.c
- ckuusr.h ckuusx.c ckermit2.txt. 8 Apr 99.
- From Jeff -- corrections to yesterday's work, plus pseudoimplementation of
- the Telnet LFLOW option. ckctel.c, ckcnet.c, ckuusr.h, ckuus[r36].c, ckucmd.c,
- 9 Apr 99.
- Added /QUIET /VERBOSE (and their synomyms) to COPY and RENAME, for the benefit
- of script writers who want to provide visual feedback easily. ckuus6.c,
- 9 Apr 99.
- Added SET DIAL METHOD AUTO and made it the default. This means that if Kermit
- knows your local country code, and it is on the list of countries in which
- tone dialing is universally available, tone dialing is used automatically.
- The initial list includes North America, the UK, Germany, and Sweden. There
- is also a list for countries in which pulse dialing is required (initially
- empty). Also added SET DIAL { TONE-COUNTRIES, PULSE-COUNTRIES } to modify the
- lists, and updated SHOW DIAL to show the lists. Also allow setting of dial
- method from K_DIAL_METHOD environment variable. ckuusr.h, ckuus[346].c,
- ckudia.c, ckermit2.txt, 9 Apr 99.
- IKSD login fix for AIX (and probably others) from Jeff. ckufio.c, 9 Apr 99.
- Added Finland to tone-dialing default list. ckudia.c, 11 Apr 99.
- Added prototypes for tn_sxdisploc() and tn_sndloc() to ckctel.h, 11 Apr 99.
- Added a default: break; case to a switch statement that has no cases if
- none of {AUTH,CRYPT,IKSD} are defined. ckctel.c, 11 Apr 99.
- Changed date/time parsing to allow YESTERDAY, TODAY, TOMORROW, + or - <number>
- { DAYS, WEEKS, MONTHS, YEARS }. This affects all date fields and switches (so
- you can say, for example, "delete /before:today *" or "send /since:yes *"), the
- DATE command, and also the date-related functions, particularly fcvtdate().
- ckucmd.c, ckermit2.txt, 11 Apr 99.
- Minor corrections to yesterday's date work after more testing. ckucmd.c,
- 12 Apr 99.
- Added HELP PURGE, HELP DELETE. Updated HELP DATE text to show new options.
- ckuus2.c, 12 Apr 99.
- Removed trailing blanks & tabs from just about every source file. 12 Apr 99.
- Oops, the trimming was done with the EMACS "trim" command, which has the
- unfortunate side effect of also tabifying the file, even the insides of string
- constants. Put 'em all back the way they were before, then wrote a trim
- program that trims trailing whitespace from all the files in its arglist
- without messing with tabs. Checked to make sure HELP and SHOW text is still
- formatted correctly. All modules, 12 Apr 99.
- Updated HELP text for other changes since Beta.05 that had not yet been
- reflected in the HELP command. ckuus2.c, 12 Apr 99.
- Fixed date arithmetic to handle years prior to 1000, but only back to 0.
- Negative years (or years after 9999) are not handled due to limitations of the
- fixed yyyymmdd notation. ckucmd.c, 12 Apr 99.
- Fixed parser foulups when editing back into a /SINCE, /BEFORE (etc), or
- /EXCEPT switch in domydir(), dodel(), and dopurge(). Also Fixed PURGE and
- DELETE /SIMULATE to automatically select /LIST also, since what's the point
- otherwise? Also added the PURGE and DELETE defaults to the SHOW OPTIONS
- display. ckuus[67].c, 12 Apr 99.
- Adjustments to make -DNOICP builds work. ckuus[4y].c, ckucns.c, ckcnet.c,
- 12 Apr 99.
- Fixed another problem in fsplit(), in which it wasn't dealing correctly with
- the no-array-specified case. ckuus4.c, 13 Apr 99.
- From Jeff: Kerberos ticket auto-delete/destroy: ckcnet.c ckcnet.h ckuath.h
- ckuus2.c ckuus3.c ckuus7.c ckuusr.h ckuusx.c, 13 Apr 99.
- Fixed messed-up spacing in ckcpro.c because of tabification of ckwart.c that
- was not undone yesterday. ckwart.c, 13 Apr 99.
- Increased sizes of INPUT buffer, TAKE and DO stacks, and some other stuff for
- BIGBUFOK builds. ckuusr.h, 13 Apr 99.
- When C-Kermit was in CONNECT mode and the Kermit on the far sent an I packet,
- causing the local Kermit to enter server mode automatically, and then sent a
- FINISH request, the local Kermit would return to its prompt rather than
- resuming CONNECT mode. Diagnosis: the FINISH handler never set the success
- variable, so the autodownload code thought a transfer had failed and therefore
- deliberately did not resume CONNECT mode so the user could see the error
- message. Solution: the server should set success = 1 when a FINISH has been
- executed successfully. ckcpro.w, 13 Apr 99.
- Bug: A command file makes a connection, then if success takes a command file
- and then CONNECTs. The command file defines a macro that includes an ASK
- command and assigns it to a key. User presses key, and ASK reads a linefeed
- that was "pushed" by the command parser due to its command state. Attempted
- to work around by setting a global flag, "askflag", whenever ASK, ASKQ, GETOK,
- etc, are active, to bypass the pushing (and therefore also the popping).
- Can't test in C-Kermit because no Kverbs, but at least it seems to do no harm;
- needs to be tested in K95. ckucmd.c, ckuus[56].c, 13 Apr 99.
- Eliminated a bunch of unresolved references at link time for NOICP builds
- by shuffling declarations & #ifdefs. Various modules, 13 Apr 99.
- SSL/TLS changes from Jeff. ckcnet.c, ckutio.c, ckcssl.h, 14 Apr 99.
- Jeff fixed my fix to the ASK bug. ckucmd.c, 14 Apr 99.
- Added Netherlands & Belgium to tone-countries list. ckudia.c, 14 Apr 99.
- Made NOICP imply NODIAL, since there's no way to dial if there is no
- interactive command parser. This eliminated various unresolved references
- at link time. Also made NOICP imply NOCKXYZ (no external protocols), since
- there is no way to choose them without an interactive command parser.
- ckcdeb.h, 14 Apr 99.
- Moved declaration of noprinter from ckuus3.c to ckcmai.c for NOICP. 14 Apr 99.
- Now that I can build a NOICP version, I checked command-line option processing.
- As suspected, items handled by prescan() were not being handled in the NOICP
- build. Rearranged prescan() code and calls to make everything work. ckcmai.c,
- ckuus4.c, 14 Apr 99.
- The NOICP version did not handle the "command-line personalities" business
- (e.g. act like Telnet if called Telnet). Fixed by juggling #ifdefs in
- ckcmai.c, 14 Apr 99.
- However, when a NOICP version of Kermit is called Telnet, there is no way for
- it to transfer files: no file-transfer command-line options, no command parser
- to escape back to, and autodownload doesn't work because it depends on having
- a command parser. For UNIX/NOICP only, I implemented autodownload by having
- the CONNECT module call proto() directly. ckcker.h, ckucns.c, 14 Apr 99.
- The NOICP telnet client can send files fine (via autoupload/server), but can't
- receive them. It goes into receive mode but then fails to advance its packet
- number and ACKs packet 1 with ACK(0). The sequence number in the ACK is
- winlo, which the debug log shows is set to 1 at this point. Further debugging
- shows that winlo is reset to 0 when rcvfil() calls zfnqfp(). However, adding
- debug() calls within zfnqfp() made the problem go away. Hours later, the aha
- experience: zfnqfp() itself was not the culprit -- it was the parameters
- passed to it by rcvfil(). Very non-obvious: we were writing into the fspec[]
- buffer using CKMAXPATH as the max length. However, fspec[] was sized to CMDBL
- if NOMSEND was defined, which happens when NOICP is also defined. Normally
- CMDBL is (much) longer than CKMAXPATH, but in the NOICP case, CMDBL
- (command-buffer length) is 508, whereas CKMAXPATH (on the platform in
- question, at least) is 1024. Since we were using strncpy() to write the
- results into the buffer, and since (at least this version of) strncpy()
- right-pads with NULs all the way the end of its destination buffer based on
- the given length, this wrote all over memory. Fixed by setting a variable,
- fspeclen, to the length of the fspec[] buffer, and using that in all
- references to its length, rather than CKMAXPATH. I don't think this
- particular problem would ever have occurred before today, but there were many
- other places where fspec[] was the object of a strncpy() (directly, or
- indirectly thru zfnqfp()), and any of these might have been the source of a
- memory leak, since some of them specified CMDBL as the length and others
- CKMAXPATH. Fixed in ckuus[r46x].c, ckcfn[s3].c, ckcpro.w, 14 Apr 99.
- Why does rcvfil() call zfnqfp() and then <rfile>F also calls it after calling
- rcvfil()? Changed <rfile>F to use fspec[], which rcvfil() always sets. This
- eliminates the redundant call to zfnqfp(). ckcpro.w, 14 Apr 99.
- Anyway, after all this, it is possible to build a NOICP version of Kermit
- that can upload and download files (but since it has no user interface, file
- transfer must always be initiated by the remote via autoup/download).
- More SSL changes from Jeff: ckcnet.c, ckutio.c, 14 Apr 99.
- Juggled #ifdefs & declarations to make "sunos41x" build. ckcfns.c, ckuusx.c,
- ckutio.c, 14 Apr 99.
- Did the same for some other builds on SunOS:
- sunos41gcc: 1.3MB <-- Full build for SunOS with gcc.
- ditto+NODEBUG: 1.1MB <-- Full build but no debugging.
- sunos41m: 229KB <-- Command-line only - no interactive commands.
- ditto+NOLOCAL: 212KB <-- Ditto, remote only.
- sunos41mi: 377KB <-- Minimum interactive - no script language.
- ditto+NOLOCAL: 360KB <-- Ditto, remote only.
- NOXFER: 917KB <-- Full scripting & comms but no file transfer.
- NOXFER+NOICP: 229KB <-- Communications only - no scripting or file transfer.
- Many modules affected. 14 Apr 99.
- Some fallout from the April 3rd work regarding application of defaults for
- missing command fields -- Peter E noticed that on HP-UX, "echo" by itself
- would print some garbage. Sigh, cmtxt() and some of the other functions were
- returning a pointer to an automatic array in this case, which of course is
- likely to be pointing to something else after the function exits. Fixed in
- ckucmd.c, 15 Apr 99.
- Fix from Jeff for K95 not finding its init file under certain conditions.
- ckuus5.c, 15 Apr 99.
- If VMS C-Kermit received a file whose name contained any parts that were more
- than 39 chars long, the transfer would fail because zmkdir()'s sys$parse()
- call failed with "Bad filename" (RMS$_FNM). Changed VMS zmkdir() to ignore
- this error. There is still a potential problem with an illegal name given by
- the user as an as-name, but that's easily overcome by not giving an illegal
- name (we don't run as-names thru nzrtol() on purpose, because we want the user
- to be able to have the final word). ckvfio.c, 15 Apr 99.
- Implemented PURGE the cheap way for VMS -- as a built-in macro that calls DCL
- PURGE. ckuus[r257].c, ckermit2.txt, 15 Apr 99.
- Changed v(model) in HP-UX to not run the "model" command. This was bad
- because (a) running external programs is a no-no in captive environments like
- IKSD and when nopush is in effect, and (b) because a frequent result of
- running "model" is the string "not found". Now we treat HP-UX like any other
- UNIX and have v(model) return the machine name from uname() if the model
- has not been filled in (some uname() implementations fill it in, some don't).
- ckuus4.c, 15 Apr 99.
- Verified that I can send to C-Kermit on HP-UX 8.00 on a Telnet connection with
- streaming (since we now default to Xon/Xoff in HP-UX for remote mode). This
- is to an HP-9000/385 about 3000 miles from here. As noted in the beware file,
- this kind of transfer is painfully slow. Bypassing the Telnet server with
- "set host *" gets 10 times the speed.
- Juggled some more #ifdefs in ckctel.h to make sure we don't have switch
- statements with no non-default cases. 15 Apr 99.
- Peter E reported various other problems with HP-UX 8.00. First, that Kermit
- thought it was in the background after escaping back from CONNECT. He says
- this started happening during the Beta.04+ period. But the code related to
- background testing hasn't changed in a very long time. Anyway, I was able
- to fix it by observing that the conbgt() "signal test" was finding its old
- SIGINT handler was SIGN_IGN, which it takes to be a sign of backgroundness,
- so I switched the conint() and concb() calls that are done before calling
- conbgt() after returning from CONNECT (but only for HPUX8). Not very
- satisfying, since it doesn't address the real cause -- whatever it is.
- doconect(): ckuus4.c, 15 Apr 99.
- While I was at it, I went to build an optimized version on HP-UX 8.00 and saw
- (as Peter had reported) that ckuusr.c takes forever to compile, so I went to
- the hpux80 makefile entry and did the trick to make it build this module
- without optimization -- the same trick that was already there for ckcpro.c.
- But then I noticed that not all of the CFLAGS had been copied into the ckcpro
- section -- which might very well explain numerous peculiarities in the HP-UX
- 8.00 version. So I changed the hpux80 entry to have consistent CFLAGS.
- makefile, 15 Apr 99.
- Warnings occur on HP-UX 10.20 ANSIC-C builds 10 about lines 4091, 4114, and
- 4136 in ckuusx.c: too bad. The warnings come from calls to tputs(), whose
- third argument is supposed to be a pointer to a function that (a) has a
- certain return type (such as int or void), and (b) takes a certain type of
- argument (such as int or char). "man tputs" says one thing, but the
- prototypes in curses.h and term.h each contradict the man page -- and each
- other. No combination of int/int, void/int, int/char, etc, would shut the
- warnings up. Despite the warnings, however, the code works fine, so no
- changes.
- In anticipation of lots more trouble with tputs(), made all references to
- its return type and its argument type symbolic: TPUTSFNTYPE and TPUTSARGTYPE,
- with default definitions of int and int; these can be overridden on the
- cc command line. ckuusx.c, 16 Apr 99.
- Improved SEND/RECEIVE/GET failure hints a bit. ckuus5.c, 16 Apr 99.
- "get /etc/hosts x.x" did not work if both Kermits had PATHNAMES ON. In this
- case zchko() was being called on the packet name rather than the as-name.
- Fixed in rcvfil(): ckcfns.c, 16 Apr 99.
- Dat Thuc Nguyen had problems debugging a script involving fsplit(). It soon
- became apparent that the real problem was the lack of informative error
- messages. So I changed the way SET FUNCTION DIAGNOSTICS and SET FUNCTION
- ERROR work so they stand a chance of doing some good without people having to
- know about these commands in advance:
- . FUNCTION ERROR is now ON by default, rather than OFF.
- . FUNCTION DIAGNOSTICS, rather than FUNCTION ERROR, now governs whether
- an error message is printed when a function fails.
- I also added an array-index-out-of-bounds error for fsplit() (to cover the
- case where it is called with a predeclared array).
- In checking these changes, I discovered that local arrays become global if
- there is no global copy of the same array. For example:
- define xx {
- local &a[] = one two three
- show array a
- }
- xx
- show array a
- The second "show array a" shows the local array which should have been
- destroyed when xx finished instead of saying "?Array not declared".
- Diagnosis: popclvl() had no way of knowing whether a local-array pointer was
- NULL because no array of that name had been declared at that level (in which
- case it should leave the global definition alone) or because there was no
- global definition originally (in which case it should delete the current
- definition). This was handled by pushing a "secret code" on the
- local-variable stack for this array. dolocal(), pusharray(), popclvl():
- ckuus5.c, 16 Apr 99.
- Also discovered that popping local arrays off the stack never worked at any
- level unless scalar variables were also on the stack at the same level.
- Fixed in popclvl(): ckuus5.c, 16 Apr 99.
- More authentication / encryption changes from Jeff: ckcnet.h, ckuusr.h,
- ckuus[37].c, 16 Apr 99.
- More authentication / encryption changes from Jeff: ckcnet.h, ckuusr.h,
- ckuus7.c, 17 Apr 99.
- HP-UX 8.00 adjustments to makefile, 17 Apr 99.
- Plus more HP-UX adjustments to makefile from Peter E, 17 Apr 99.
- Fixed unbalanced quotes in the sco32v4netgcc makefile entry, 17 Apr 99.
- Further improvements to GET-class command failure hints. They're obnoxious,
- but they're pretty useful. ckuus5.c, 17 Apr 99.
- For months, I've been hearing of a problem with the fullscreen file-transfer
- display in VMS but was never able to reproduce it. Finally I got the needed
- hint -- it happens only when autouploading. The problem occurs when we use
- printw() to write on the bottom screen line. For some reason, only when
- autouploading (go figure), an extra CRLF comes out and pushes all the labels
- up one line. The stupid solution was to not write on the bottom line (in VMS
- only). ckuusx.c, 17 Apr 99.
- Tried to give VMS C-Kermit the ability to send "keepalive" packets while in
- server mode executing a subprocess that takes a long time to produce output
- (as the UNIX version can -- see notes from Oct 25). I made the VMS
- get_subrc_line() routine do a timed read and then added all the appropriate
- tests, return codes, etc. It doesn't break anything; REMOTE HOST commands
- still work fine. But the timeout feature doesn't work. To test, put VMS C-K
- in server mode and then tell the client "remote host wait 00:00:30". VMS C-K
- is supposed to send back an empty data packet every second but it doesn't.
- The debug log shows that it does indeed return a timeout indication, but only
- after the subprocess exits. ckvfio.c, 17 Apr 99.
- Notes on the Beta.06 build-all...
- . After building on each platform, I transferred a 3MB binary file to the
- remote just-built version to make sure the default FLOW /REMOTE selection
- was appropriate. Some of these transfers exceeded 500000 cps -- through
- the Telnet server! (Results: only HP-UX and VMS need Xon/Xoff; all the
- others work OK with NONE.) Then I used the same new binary to make a
- Telnet connection back to here and send itself, thus testing the network
- code, file-sending code, etc, as well as the fullscreen file-transfer
- display. Also Ctrl-L or "cls" was typed at the C-Kermit> prompt to
- ensure the new SCREEN code works.
- . On HP-UX versions where I had access to a serial port, I made sure I
- could CONNECT to the port and escape back, and still have a prompt.
- The mixup with SIGINT is apparently peculiar to HP-UX 8.00. This is
- handled by adding -DCKCONINTB4CB to CFLAGS. It was not needed in
- HP-UX 5.21 or 10.20. Don't know yet about 6.x, 7.x, or 9.x.
- . Discovered that you must SET PREFIXING ALL when sending binary files
- thru the Ultrix Telnet server. Made a note in ckubwr.txt.
- . Digital UNIX (both 3.2 and 4.0) gets a segmentation fault when calling
- tgetstr() (yes, after a successful call to tgetent()). Curses works, but
- termcap calls don't. Added -DNOTERMCAP and supporting code to avoid these
- routines, and added -DNOTERMCAP to the DU entries. I guess they really
- mean it when they say in the man page that these are "old" routines and
- you should use curses instead. ckuus[5x].c, makefile, 17 Apr 99.
- . NOTE: In case anybody wants to look into a better workaround for tgetstr()
- in DU, note that DU's curses.h says "#define tgetstr _bsd_tgetstr", but
- then the latter doesn't appear in any header files or man pages I can find.
- Also the DU 3.2 and DU 4.0 man pages disagree on the calling conventions
- (even though the header files show the normal ones).
- Next day... Spent a few more hours on the OSF/1 tgetstr() problem to no
- avail. A short test program that calls tgetent(), tgetstr(), and then
- tputstr() works OK, but the exact same sequence in C-Kermit gets the
- segmentation fault. The difference is probably due to some conflict or
- confusion in the many more header files included by ckuusx.c than by the short
- test program (which includes only curses.h). There's all kinds of crazy stuff
- going on in OSF/1 curses.h that is obviously extremely sensitive to what other
- symbols have been defined, what universes we're in, etc. No amount of
- finagling helped, not #including <term.h> before <curses.h>, not calling
- _bsd_tblah() explicitly, not #undefing the tgetstr (etc) macros, etc, so I
- left the NOTERMCAP definition in place. Very unsatisfying. 18 Apr 99.
- Further build-all observations:
- . Streaming transfers into AIX 4.2 or 4.3 (through the AIX Telnet server)
- consistently failed, when exactly the same kind of transfers into AIX 4.1
- worked without incident. The error reported by AIX is "interrupted system
- call". Changing flow control, packet length, prefixing, parity, etc, makes
- no difference. Streaming transfers work perfectly, however, if the AIX
- Telnet server is removed from the picture (e.g, by using "set host * 3000"
- on AIX, or by using Rlogin instead of Telnet). They also work perfectly if
- the Telnet connection is forced into binary mode (C-Kermit command "set
- telopt requested requested"). (But oddly enough, transfers are much slower
- through the Rlogin server or the binary-mode Telnet server than through
- the same Telnet server in NVT mode.) Otherwise "set streaming off" does
- the trick.
- Finally figured out how to squelch ANSI compiler warnings from HP-UX 9 and 10
- about tputs(). makefile, ckuusx.c, 18 Apr 99.
- Added -DDCLGETCWD to sco234* entries. makefile, 18 Apr 99.
- Added prototype for pusharray() to ckuusr.h, 18 Apr 99.
- ---Beta.06---
- From Lucas Hart: Proper implementation of timed reads for pipes (mailboxes)
- in VMS, allowing REMOTE HOST keepalive. ckvfio.c, 19 Apr 99.
- Somehow in all these years I never heard of the UNIX realpath() function.
- Changed zfnqfp() to use it if CKREALPATH defined. It does what zfnqfp() does
- (including all the "../.././../" stuff) plus resolving symlinks. We'll see
- how portable it is in the next build-all. So far it's OK on Sun, HP-UX 10,
- and SCO OSR5. ckufio.c, ckcdeb.h, 22 Apr 99.
- Added -DCKCONINTB4CB to all HP-UX 7.xx makefile entries. 23 Apr 99.
- Added sys3upcgfd target, from Peter Mauzey. makefile, 23 Apr 99.
- From Jeff, 23 Apr 99:
- . Corrections to X.25-but-no-TCP builds: ckctel.c.
- . SET TELNET TRANSFER-MODE: ckuusr.h, ckuus[23].c, ckctel.c, ckcpro.w.
- . v(authstate), f(krbflags), ckuusr.h, ckuus4.c.
- . IKSD login/auth improvements: ckcmai.c.
- . Fixes to command-line/command-file botches from kerbang changes: ckcmai.c.
- . Make Telnet Option keywords not depend on #ifdefs: ckuus3.c.
- . Various other auth/crypt changes: ckuat[h2].[ch], ckuus7.c.
- From Martin Whitaker, 23 Apr 99:
- . Fixes for OS-9: ck9fio.c, ckuus5.c.
- . Bad IF stmt in doxconn(): "if (xx = ttchk() < 0) dologend();"
- Should be: "if ((xx = ttchk()) < 0) dologend();"
- . Ditto in dodial(): "if (y = conchk() > 0)" -> "if ((y = conchk()) > 0)"
- . ttnet not found at link time in no-network builds. ckcnet.c.
- (Why is #ifdef CK_LOGIN commented out around that big section in ckcmai?)
- (Maybe it should be #ifdef something else?)
- Regular and -DNONET builds on SunOS were OK.
- Fixed fsplit() not to dump core if given an empty string. ckuus4.c, 23 Apr 99.
- Changed SET LINE to not print open() failure message if QUIET ON and SET LINE
- command not given from prompt. This makes the GETLINE script run smoother.
- ckuus7.c, ckutio.c, 23 Apr 99.
- Put QUIET variable (quiet) on the command stack, so a macro or TAKE file can
- SET QUIET ON or OFF without affecting its caller. This was done differently
- from the other stackable settings (like INPUT CASE, etc) since the 'quiet'
- variable is used in so many places, even in modules that must not have any
- notion of such things as a command stack. This way the quiet variable can
- be used just as it always was; only those routines that change command level
- need to be concerned with pushing and popping it. ckuus[356].c, 23 Apr 99.
- Added IF QUIET so scripts can test SET QUIET setting when printing messages.
- ckuusr.h, ckuus6.c, 23 Apr 99.
- Changed DIAL to cancel automatic redialing if call failed because no dialtone.
- ckuus6.c, 23 Apr 99.
- Added the following dial-modifier variables:
- v(dm_lp) Long pause
- v(dm_sp) Short pause
- v(dm_pd) Pulse dial
- v(dm_td) Tone dial
- v(dm_wa) Wait for answer
- v(dm_wd) Wait for dialtone
- v(dm_rc) Return to command mode
- The modifier strings are obtained by calling getdm() in ckudia.c.
- ckuusr.h, ckuus4.c, ckudia.c, 23 Apr 99.
- Added /HEAD:n and /TAIL:n switches to TYPE. ckuus[r256].c, 23 Apr 99.
- Fixed TYPE /TAIL:n to work when n > file lines. ckuus6.c,24 Apr 99.
- Added TYPE /MATCH:pattern -- like grep (but only works for one file). And
- TYPE /WIDTH:cols, for truncating lines (e.g. to prevent wraparound). Added
- TYPE /PREFIX:string to put any desired string at the head of each line. Added
- TYPE /COUNT to only count (matching) lines, but not print them - like "wc -l".
- Added /WIDTH:n to SET/SHOW OPTIONS TYPE. ckuusr.[ch], ckuus6.c,24 Apr 99.
- Added:
- v(ty_ln) TYPE line number
- v(ty_lc) TYPE line count
- v(ty_mc) TYPE match count
- v(ty_ln), or any other variable(s), can be used with TYPE /PREFIX. Examples:
- TYPE /PREFIX:{v(time): } <-- puts time of TYPE command on each line.
- TYPE /PREFIX:{\v(time): } <-- puts current, running time on each line.
- TYPE /PREFIX:{\v(ty_ln): } <-- puts line number on each line.
- TYPE /PREFIX:{\flpad(\v(ty_ln),3): } <-- Ditto, right-adjusted.
- After a TYPE command, SHOW VAR TY gives the statistics: line count of file,
- plus count of lines that matched if a pattern was given.
- ckuusr.h, ckuus4.c, 24 Apr 99.
- Improved parsing of Windows Printer Queue name from Jeff. ckuus3.c, 24 Apr 99.
- Brought ckermit2.txt up to date. 24 Apr 99.
- From Jeff: missing default return for getdm(). ckudia.c, 26 Apr 99.
- With hints from Lucas Hart, fixed the Digital UNIX termcap problem from April
- 18th. Once again, the problem derived from referring to a termcap/terminfo
- function (in this case tgetent()) before the <curses.h> include. The solution
- was to move fxdinit() to below the #include. Verified on DU 3.2 and 4.0.
- ckuusx.c, 26 Apr 99.
- Defined NOREALPATH for HP-UX 8.00 and earlier. Verified that realpath() is OK
- in HP-UX 9 (and we already knew about 10). ckcdeb.h, 26 Apr 99.
- From Jeff, fix IKSD login to not assume anonymous if we don't know who the
- user is after authentication (mainly for TLS). ckcmai.c, 26 Apr 99.
- Using unsigned chars for buffers and pointers in dotype() caused all sorts of
- stupid mindless fascist warnings to spew forth from picky compilers, so I made
- the offending items regular (signed) char instead. Can I still TYPE 8-bit
- text files on platforms where C-Kermit can't be built with -funsignedchar?
- Seems OK on HP-UX 10.20. Time will tell about the others. Checked to see
- whether HP-UX ANSI compiler has an option to treat all chars as unsigned (it
- doesn't). ckuus6.c, 26 Apr 99.
- Fixed declaration/ifdef glitches for VOS x25-but-no-tcpip build. cklnet.c,
- ckuscr.c, ckuus4.c, 26 Apr 99.
- When executing Kerbang scripts, the console was not in cbreak mode, so
- askmore() didn't work normally. That's because concb() was called only when
- C-Kermit reached top level (e.g. after executing the init file). But now
- we're executing ASK[Q], GETOK, GETC, and askmore() without ever reaching top
- level, so I added concb() calls for all these. ckuus[56].c, 26 Apr 99.
- From Jeff: Fix for END given at top level trying to free stuff that was never
- malloc'd. ckuusr.c, 27 Apr 99.
- Changed DIAL to cancel automatic redialing if call failed because of a
- dialing directory error, access is forbidden, blacklisted, or locked.
- ckuus6.c, 27 Apr 99.
- From Lucas Hart: Fix gcc warnings in VMS gftimer(), ckvtio.c; add missing
- #define for cklongjmp() in one of the #ifdef cases in ckcsig.h. 27 Apr 99.
- In working on REVIEW 2.0 (one of our demo scripts) I discovered a subtle but
- annoying problem: although the &_[] array could be accessed at top level,
- and in an IF command, and in a FOR loop, it could not be accessed in a FOR
- loop that was inside an IF statement. Similarly, the v(argc) variable was
- clobbered inside a FOR loop. It seems the _GETARGS command was not quite
- completely implemented. Also, one critical step was lacking from addmac().
- Both fixed in ckuus[56].c, 27 Apr 99.
- Added v(maclevel), mainly for debugging. ckuusr.h, ckuus4.c, 27 Apr 99.
- The following (new) construction did not work:
- if ( condition ) { commands } else if defined %x { commands... }
- We needed an additional layer of quoting in the else part. doif(): ckuus6.c,
- 28 Apr 99. Verified that all script torture-tests still work, and added a
- long "if ... else if ... else if ... else if ... else" section to the IFTEST
- script.
- Dat Thuc Nguyen reported the following problem:
- define try_this { END 999 } ; Sets v(return) to 999
- try_this
- if FAIL echo RETURN1="v(return)" ; This displays 999
- try_this
- if FAIL { echo RETURN2="v(return)" } ; This displays nothing, why?
- This was yet another problem caused by the fact that IF ... { ... } (the
- Command Formerly Known as XIF) is implemented internally as a macro (whereas
- IF without braces is not), so it was looking in the wrong place on the stack
- for the return value. However, fixing this was not just a simple matter of
- adding mrval[] to the items handled by _GETARGS and _PUTARGS, since dodo(), as
- part of macro startup, initializes the RETURN value to NULL. To make it not
- do this for IF, FOR, WHILE, and SWITCH, while still doing for all other
- macros, I added another command-stack flag, CF_IMAC (Internal Macro), which at
- present is used only to prevent initialization of the macro's return value
- (unfortunately it is ephemeral -- if we don't reset it right after use, it is
- propogated to all lower levels -- so other applications for it are not
- practical). ckuus[56].c, 28 Apr 99.
- Rearranging the declarations in ckuus4.c yesterday for the VOS x25-but-not-tcp
- build caused tn_exit, ttnproto, tcp_incoming, autodl to come up missing on
- nonet builds. Fixed in ckuus4.c, checked by building with -DNONET, 28 Apr 99.
- fxdinit() was not being included in non-curses builds after I moved it. Fixed
- (again) by juggling #ifdefs (again). Fixed in ckuusx.c, fixed by building
- with -DNOCURSES. 28 Apr 99.
- Failure to open init file was not giving an error message. Added code to
- print a message in doinit(): ckuus5.c, 28 Apr 99.
- Some Telnet authentication changes from Jeff. ckctel.c, 30 Apr 99.
- The MINPUT command, when typed at the prompt, was not getting into the
- reparse() buffer. Another case of not calling cmcfm()... Fixed in ckuusr.c,
- 30 Apr 99.
- Changed SET BELL to be available in all versions, not just K95. ckcdeb.h,
- ckuusr.h, ckuus[r237].c, 30 Apr 99.
- Added WILDCARD-EXPANSION setting to SHOW FILE. ckuus4.c, 30 Apr 99.
- Did a little digging on realpath():
- . SVID for SVR3 does not have it.
- . SVID for SVR4 does not have it.
- . POSIX 1003.1 does not have it.
- . ISO/IEC 9945-1 does not have it.
- . Apparently it originated with SVR4.2.
- Determined the following UNIX platforms have it:
- . SunOS 4.1 and all Solaris
- . AIX 4.1 (and therefore 4.2, 4.3...)
- . Sinix 5.42
- . Digital UNIX 4.0.
- . HP-UX 9 and later.
- . SCO OSR5.0.5
- . QNX 4.25
- . Unixware 2.1.3
- . Red Hat Linux 5.2
- . IRIX 5.3 and later
- . NeXTSTEP 3.3
- . DG/UX 5.4R3.10 and later
- Determined the following UNIX platforms do not have it:
- . HP-UX versions through 8.xx (we knew this already)
- . Motorola SV/68R3
- . SCO UNIX 3.2v4.x and earlier
- . SCO XENIX
- . Digital UNIX 3.2
- . Ultrix 4.3 (and presumably all other versions).
- Expanded NOREALPATH section of ckcdeb.h to include all these. 2 May 99.
- Tentative fix to Dat Thuc Nguyen's bug report regarding numeric STOP/END value
- not being propogated up the call stack as v(return). popclvl(): ckuus5.c, 2
- May 99.
- New HP-UX 6 through 8 makefile entries from Peter E. Changing -DSVR3 to
- -DSIG_V seems to cure some performance problems in these versions, and
- eliminates the need for -DCONINTB4CB. Also it seems hardware flow control
- never worked in HP-UX 8.xx because -DSTERMIOX was missing from CFLAGS, so
- this was added to the hpux80 entry. makefile, 3 May 99.
- kermit -C "" caused an infinite loop. Fixed in ckuusy.c, 3 May 99.
- The -C "command, command, ..." list did not work if tabs were used instead
- of spaces. Fixed in ckuusy.c, 3 May 99.
- Fixed serial and CRT displays to wrap long filenames. ckuusx.c, 3 May 99.
- This did not work:
- _define abc%1 { blah blah }
- if defined m(abc%1) ... <-- should succeed but fails.
- Fixed in ckuus6.c (IF DEFINED did not handle compound macro names), 3 May 99.
- From Jeff: Fix an off-by-one error in initializing the pointer list in
- xwords(): ckuus5.c; cosmetic changes & typo fixes: ckctel.h, 4 May 99.
- Added CK_NEWTERM to openbsd target. makefile, 4 May 99.
- Moved prototype for setbell() outside of #ifdef OS2. ckuusr.h, 5 May 99.
- Revisited the xwords() problem, undid Jeff's change. xwords() itself was not
- the problem; the problem was in some of the calls. ckuus[r357].c, 5 May 99.
- Found another problem in fsplit(): given the name of an array, e.g. "a" or
- "A", we blindly compute the array base without first checking the case.
- Changed dclarray() to return the array-base index for use by the caller,
- rather than simply 0 to indicate success, and then changed the callers to use
- the returned value rather than computing it themselves. ckuus[45].c, 5 May 99.
- From Raul Kacirek <raulka@raulka.mv.com>: Fixed a mismatched quote mark in the
- is3 makefile target. 6 May 99.
- Added a bunch of symbols for new commands, etc, to ckuusr.h:
- XX_INCR _INCREMENT (like INCREMENT but evaluate LHS too)
- XX_DECR _DECREMENT (like DECREMENT but evaluate LHS too)
- XX_EVAL _EVALUATE (like _ASSIGN + feval())
- XXARRAY ARRAY (Array ops -- copy, sort, declare, destroy)
- XXHTTP HTTP (HTTP ops)
- XXPARSE PARSE (parse keyword, file, number, etc...)
- XYEVAL SET EVALUATE (old/new EVALUATE syntax, tsk tsk)
- IFXXCK IF C-KERMIT True if C-Kermit but not K-95
- IFXXK9 IF K-95 True if K-95
- IFXXMS IF MS-KERMIT True if MS-DOS Kermit
- IFXXWI IF WILD <filespec> True if filespec contains wildcard chars
- VN_XF_BC v(xfer_badpacket) (Transfer blockcheck errors)
- VN_XF_TM v(xfer_timeout) (Transfer timeouts)
- VN_XF_RX v(xfer_retransmit) (Transfer retransmissions)
- VN_M_NAM v(m_name) (Modem full name)
- FN_SEARCH fsearch() (Search for pattern in string)
- FN_XLATE fxlate() (Translate string character set)
- But did not implement any of them yet, and might not anyway, we'll see.
- 6 May 99.
- Corrected a minor error in yesterday's changes regarding dclarray() in the
- DIRECTORY /ARRAY:&a code. domydir(): ckuus6.c, 6 May 99.
- Implemented _INCREMENT and _DECREMENT. ckuus6.c, 6 May 99.
- Correction to a Kerberos #ifdef from Jeff. ckuus7.c, 7 May 99.
- Added symbols for modem-signal variables v(m_sig_xxx) to ckuusr.h, 7 May 99.
- Implemented:
- v(m_name)
- v(m_sig_cd) v(m_sig_dsr) v(m_sig_dtr)
- v(m_sig_cts) v(m_sig_rts) v(m_sig_ri)
- v(xfer_badpackets) v(xfer_timeouts) v(xfer_retrans)
- ckuus4.c, 7 May 99.
- Changed EVALUATE <expression> to EVALUATE <variable> <expression>. This is
- an incompatible change, but I doubt it will break any scripts, since the
- old EVALUATE command was pretty useless. But to be nice, I added an invisible
- SET EVAL { NEW, OLD } command to choose the new or old syntax (default = new).
- Then I added an _EVALUATE command, which is to EVALUATE as _ASSIGN is to
- ASSIGN and _INCREMENT is to INCREMENT, etc. Now we have a nice, symmetrical
- set of variable-assignment operations providing a choices of whether (and
- how, and how much) to evaluate the LHS and/or the RHS, to facilitate OOP-like
- constructions. ckuusr.c, 7 May 99.
- Examples:
- _assign Words::%1.count[%2] feval(m(Words::%1.count[%2]) + 1)
- can now be written as:
- _increment Words::%1.count[%2]
- and:
- _assign complex::%1.re feval(m(complex::%1.re) + m(complex::%2.re))
- can be:
- _evaluate complex::%1.re m(complex::%1.re) + m(complex::%2.re)
- Changed [_]{IN,DE}CREMENT, when given a variable that is not defined, to
- automatically define it with a value of 0. ckuus5.c, 7 May 99.
- Integrated Jeff's PAM code. ckuus7.c, ckufio.c, 7 May 99.
- Finished SET EVAL. ckuus3.c, 8 May 99.
- Added IF { C-KERMIT, K-95, MS-KERMIT }. ckuus6.c, 8 May 99.
- Made "!" a synonym for NOT in IF conditions. ckuus6.c, 8 May 99.
- Added IF WILD <filespec> <command>. ckuus6.c, 8 May 99.
- Added ckitoa() and ckltoa() -- the opposite of atoi() and atol().
- ckclib.[ch], 8 May 99.
- Added fsearch(pattern,string,start) and frsearch() -- just like findex()
- and rindex(), except the object to search for is a pattern rather than a
- literal string. ckuusr.h, ckuus[24].c, 8 May 99.
- Fixed Yet Another Bug in frindex(); it was misinterpreting its optional 3rd
- argument. ckuus4.c, 8 May 99.
- Shadow password support from Jeff. ckufio.c, 8 May 99.
- "make linuxc" (Linux on systems that have curses but not ncurses) didn't work
- because it had -lcrypt hardwired into it instead of using the trick of looking
- for it first. Made new "linuxc" and "linuxnc" (no curses at all) entries.
- makefile, 8 May 99.
- When adding f[r]search() I also broke up the huge switch() statement in
- fneval() into a bunch of smaller ones, but neglected to prevent them from
- falling thru to the default (error) case at the end. Fixed by Jeff in
- ckuus4.c, 10 May 99.
- From Martin Whitaker: Recursive directory traversal and built-in DIRECTORY
- command for OS-9: ck9fio.c, ckcdeb.h, 10 May 99.
- Changed ckitoa() and ckltoa() to return string pointers from a revolving 1K
- buffer pool, rather than a single buffer, so that successive calls within the
- same statement would return distinct pointers. Converted lots of crufty code
- mainly in the ckuus*.c routines to use ckitoa() when appropriate, like when
- numbers need to be passed as function parameters in string form, e.g. as
- defaults for cmnum() calls, or in calls to setgen() by client for REMOTE SET.
- Also handy for debug() when you want to put a number in both the second and
- third fields. ckclib.c, ckuus[r34567].c, 10 May 99.
- Discovered that DIRECTORY prints total garbage for permissions, size, and date
- in Unixware 7. Diagnosis: lstat() doesn't work in Unixware 7, even though it
- does work in earlier releases. Adding -DNOLSTAT to the Unixware 7 makefile
- targets fixes it. 10 May 99. (SCO evidently does not believe in lstat()
- since it also does not work in XENIX, SCO UNIX, or OSR5.)
- From Jeff: fix a typo in ckuus7.c from yesterday's changes. 11 May 99.
- Added HTTP command parser. It's completely contained in ckuusr.c within
- #ifndef NOHTTP. ckuusr.c, 11 May 99.
- Added ARRAY command to collect all array ops together: DECLARE, SORT, SHOW,
- etc. Made top-level DECLARE and SORT commands invisible. Old syntax still
- works, of course. ckuusr.h, ckuus[r5].c, 11 May 99.
- Moved the array-segment-parsing code from SHOW ARRAY to a separate routine,
- arraybounds(). SHOW ARRAY &a[12:16] still works. ckuus5.c, 11 May 99.
- Added ARRAY COPY <source> <target>. This copies an array much more quickly
- than a script FOR loop. Furthermore, either or both of the source and target
- arrays can include range specifiers, so this command can be used to copy
- pieces of arrays, or to create an array that is a piece of another array, etc.
- A few quick tests look OK, but needs more verification. ckuusr.c, 11 May 99.
- Discovered that the following:
- $ kermit + filename arg1 arg2 arg3
- would execute the file and pick up the args, as adverised, but then would say:
- "filename" - invalid command-line option, type "wermit -h" for help
- Similarly, there would be a complaint if the first arg was "=". Both fixed in
- ckuusy.c, 12 May 99.
- Finished ARRAY COPY. Added ARRAY { DESTROY, CLEAR, SET, RESIZE }. Changed
- [ ARRAY ] DECLARE to accept array-name syntax consistent with the other ARRAY
- commands. Changed [ ARRAY ] SORT to allow range specification in the array
- brackets. ckuus[r7].c, 12 May 99.
- Added farraylook(array,pattern) to search an array and return the index of
- the first matching element. ckuusr.h, ckuus[24].c, 12 May 99.
- Removed trailing whitespace from source file lines: ckuus[r345].c, 12 May 99.
- New ckuath.c from Jeff, 13 May 99.
- Removed "search" keyword from arraytab[] and fixed a type in rszarray().
- ckuusr.c, 13 May 99.
- Filled in HELP ARRAY and updated HELP EVAL. ckuus2.c, 13 May 99.
- Added v(match), which contains the string that matched the pattern most
- recently given to ckmatch(), e.g. by IF MATCH, fsearch(), farraylook(),
- wildcard comparisons, etc. But then I removed it since it turns out that most
- calls to ckmatch() internally append a "*", so the result is usually more than
- you expect. What we really need is something like SNOBOL's:
- STRING ( PATTERN . RESULT )
- I'll come back to this later... ckuusr.h, ckuus4.c, 13 May 99.
- Realized the arguments to farraylook() were in reverse order from those in
- all the other string-search functions -- findex(), fsearch(), etc -- so
- reversed them. ckuus[24].c, 13 May 99.
- Discovered that top-level &_[] array was dimensioned 1 greater than it should
- have been. Fixed in cmdini(): ckuus5.c, 13 May 99.
- Fixed Yet Another Problem with Kerbang invocation: "kermit + file arg1 arg2..."
- would pick up the args and execute the file OK, but then would say "arg1 -
- invalid command-line argument". Changed command-line parser to simply return
- if the first argument was "+". (I thought I fixed this problem yesterday, but
- in reality I only shifted it to the right.) ckuusy.c, 13 May 99.
- Added IF LOCAL <command>. ckuusr.h, ckuus6.c, 13 May 99.
- Upped MAC_MAX from 4K to 16K for BIGBUFOK builds and from 0.5K to 1K for
- other builds. ckuusr.h, 14 May 99.
- Added v(setlinemsg) to contain the error message that was generated by the
- most recent SET LINE / PORT / HOST (or TELNET or RLOGIN) command, if it failed.
- ckuusr.h, ckuus[47].c, 14 May 99.
- From Jeff: Move misplaced #ifdef in v(setlinemsg) code. ckuus7.c, 18 May 99.
- The following modems had software flow-control commands defined, but were
- missing the CKD_SW capability: Microlink, Telepath, Motorola X-Jack, Quickcomm
- Spirit II, Megahertz AT&T V.34. Fixed in ckudia.c, 18 May 99.
- Wrapping of long filenames in Serial and CRT displays did not take the length
- of the first name into account. Fixed in dpyinit(): ckuusx.c, 18 May 99.
- From Brian Tillman: Updated ckvker.com and ckcnet.h for Wollongong Pathway 3.1.
- 18 May 99.
- From Jeff: Preserve printer settings between invocations. ckuus3.c, 19 May 99.
- From Jeff: Perform reverse DNS lookup when a numeric IP address is given and
- Kerberos is available so a successful Kerberized connection can be achieved.
- (Previously we skipped the reverse lookup for numeric addresses, but for
- Kerberized connections we need the hostname to get the Kerberos realm.)
- Added #ifdef CK_KERBEROS to the new tests. ckcnet.c, 19 May 99.
- Added missing dosort() prototype. ckuusr.[ch], 19 May 99.
- Dale Dellutri reported that in the sequence "set flow keep", "set line tta0",
- "connect", the device's flow control changed when it shouldn't have. This is
- because the SET LINE code calls setflow(), and for some unknown reason the "if
- (!autoflow) return;" statement in setflow() was commented out. There's
- nothing in the notes about it, nor any comment in the code. Clearly we should
- not be switching the flow control automatically if it was set to something
- specific like KEEP or RTS/CTS. Was the commenting-out done for a reason??? I
- guess there's only one way to find out... Restored the if (autoflow) test to
- setflow(). But that didn't help -- it seems that setlin() was also setting
- the flow control directly, without going through setflow(), in the serial
- device case (there must have been some logic behind this but I don't see it
- now). Changed setlin() to call setflow() like everybody else. ckuus[7x].c,
- 19 May 99.
- changed cmkey() to not print "?No keywords match" if QUIET is ON. Changed
- command-file reader not to print "Command file: filename, line number" when
- QUIET ON. And when it does print "Command file:", now it also prints the
- name of the active macro, if any. ckucmd.c, ckuus5.c, 19 May 99.
- Added /opt to the list of UNIX directories to search for Kermit text files.
- ckuus5.c, 19 May 99.
- Several weeks ago when writing a script, I wanted to send an ATI6 command to
- a USR modem and the parse the results (about 20 lines of text that end with
- "OK") on fly like so:
- set flag off
- set input echo on
- while not flag {
- minput 10 Blers Retrains Speed OK
- switch v(minput) {
- :1, clear input, input 2 10, .blers := fword(v(input),1), break
- :2, clear input, input 2 10, .retrains := fword(v(input),5), break
- :3, clear input, input 2 10, .speed := fword(v(input),1), break
- :4, set flag on, break
- }
- }
- I was discouraged to find that this didn't work at all (on Windows 95). Huge
- chunks of the modem's report were lost. I looked closely at the INPUT/MINPUT
- code but found nothing to explain it: Reads are not buffered -- we do ttinc()
- or coninc() to get each character and deposit it in inpbuf[] one at a time.
- Therefore, reading stops as soon as we have a full match, so we have not read
- ahead at all. CLEAR INPUT simply clears inpbuf[], which contains only the
- chars that INPUT read, and resets inpbp to the beginning of the buffer.
- Therefore "input 2 10" should read to the next linefeed, and there should be
- no wraparound since we just cleared the inpbuf[] buffer. But lots of stuff
- (many lines at once) were being lost anyway.
- So instead I did it like this (get the whole report in one gulp and then parse
- it afterwards):
- output ATI613
- input 20 OK
- if fail end 1
- .%x := findex(Retrains Granted,v(input))
- if %x .retrains := fword(fsubstr(v(input),%x),3)
- .%x := findex(Blers,v(input),%x+16)
- if %x .blers := fword(fsubstr(v(input),%x),2)
- .%x := findex(Speed,v(input),%x+16)
- if %x .ospeed := fword(fsubstr(v(input),%x),2,,/)
- which worked fine (so no, it wasn't a flow control problem).
- Today I went back to investigate, but this time on an HP workstation with
- HP-UX, and the first method worked perfectly. I tried it on Windows with an
- external USR modem and it worked perfectly too. So either some fix that we
- made in the last couple weeks cleared up the problem, or else it's something
- to do with the Compaq (TAPI) Winmodem, so who cares. So this clears away
- a big item from the list.
- Changed UNDEF <name> to parse but ignore text after the <name>. This provides
- a clean way to comment out a macro definition without removing it or putting
- semicolons in front of each line. ckuus6.c, 19 May 99.
- Fixed a typo in yesterday's flow-control changes (comment-close typed as
- *? rather than */). setflow(): ckuusx.c, 20 May 99.
- From Jeff: /NOPOSTSCRIPT switch for SET PRINTER to under previous /POSTSCRIPT
- switch. ckuusr.h, ckuus3.c, 20 May 99.
- From Jeff: Updated HELP text for SET TCP REVERSE-DNS-LOOKUP for Kerberos.
- ckuus2.c, 20 May 99.
- From Jeff: new security.txt and telnet.txt, updated iksd.txt. 20 May 99.
- Fixed some mistakes in the Compaq modem definition, and raised the max speed
- parameter for Compaq and USR to 115200. Made the maximum speed warning a
- hint. ckudia.c, 20 May 99.
- Added SIG_V and SIG_I to SHOW FEATURES. ckuus5.c, 20 May 99.
- Made SET LINE messages in UNIX about access to lock or device a hint.
- ckuus7.c, 20 May 99.
- Added v(textdir), the directory where the C-Kermit/K-95 text files are kept.
- ckuusr.h, ckuus4.c, 20 May 99.
- Added ftablelook(), just like farraylook() except it assumes the table is
- sorted, allows array elements to have fields, requires a nonambiguous match,
- and returns -2 on an ambiguous match. ckuusr.h, ckuus[24].c, 20 May 99.
- From Jeff: move a mispaced brace in setlin(): ckuus7.c, 21 May 99.
- Merged copyright text into VERSION command except in K95 where it wouldn't
- fit. ckuusr.c, 21 May 99.
- Made the HTTP command (not filled in yet) invisible. ckuusr.c, 21 May 99.
- Fixed a glitch in filename completion that affected UNIX but not K95:
- "send ./foo<ESC>" would lose the next two name characters after "foo" in the
- expansion. cmifi2(): ckucmd.c, 21 May 99.
- Moved XYB_xxx definitions from ckuusr.h to ckcker.h for NOSPL/NOICP builds.
- 21 May 99.
- Moved all cmdlvl declarations outside of NOSPL sections. ckuus*.c, 21 May 99.
- Fixed Solaris 2.3 and 2.4 banners. ckuver.h, 21 May 99.
- Fixed TCPware "show net" display to say TCPware instead of UCX. ckuus4.c,
- 21 May 99.
- Fixed linux entry to accept KFLAGS from other Linux entries. makefile,
- 21 May 99.
- Multinet 4.2 on VMS 7.1 with DECC 6.0 needed <if.h>. ckcdeb.h, 22 May 99.
- Shuffled some #ifdefs and version numbers and redid the overlay structure to
- enable building on 2.11BSD (first time in 3 years). ckcker.h, ckcfns.c,
- ckustr.c, ckustr.sed, ckubs2.mak, 23 May 99.
- ---Beta.07---
- Added Base64 conversion routines. ckclib.[ch], 26 May 99.
- Updates from Jeff, 26 May 99.
- . Some misplaced case statements fixed in ckcnet.c.
- . Initial work on HTTP routines: ckuusr.c, ckcnet.[ch].
- . Additional PRINT switch work -- decoupling port parameter setting
- from bidirectional mode: ckuus3.c.
- Added -DNOREALPATH to AT&T 3Bx and System III entries, and to all AIX entries
- prior to 4.0. makefile, 26 May 99.
- Added include for inet.h to Wollongong section of ckcnet.h. 26 May 99.
- Fixed a typo in the Wollongong section of the VMS build procedure. ckvker.com,
- 26 May 99.
- Changed PA-RISC level indicator for HP-UX 10.20; John Bigg of HP says 10.20
- and up do not support PA-RISC 1.0. makefile, 26 May 99.
- Changed optimization flag for SNI 5.44 from -F to -K. makefile, 26 May 99.
- The Base-64 functions did not null-terminate their results, thus forcing the
- caller to do it. Changed them to deposit a NUL after the result (if the
- buffer had room for it). ckclib.c, 27 May 99.
- Added fb64encode() and fb64decode(). ckuusr.h, ckuus4.c, ckclib.c,
- 27 May 99.
- Fixed funhexify() to return an appropriate error if called with a non-hex
- string. ckuus4.c, 27 May 99.
- Fixed solaris25x25 makefile target -- it had unbalanced quotes. However the
- make doesn't work at all -- the SunLink X.25 9.x header files are broken.
- makefile, 28 May 99.
- In gtword() (the "token getter" of the command parser), there were a couple
- places where we compared the user's keystroke with NL (== whatever 'n' is
- defined to be) when we meant to be checking for LF (linefeed). This needed
- fixing for OS-9, where 'n' is CR. This fix also applies to the Macintosh
- in case C-Kermit is ever built there again. ckucmd.c, 28 May 99.
- Added a NOTTGWSIZ symbol to allow builds without CK_TTGWSIZ to test for
- spurious dependencies. In UNIX this must be used with -DNORLOGIN, since
- Rlogin requires ttgwsiz(). ckcdeb.h, 28 May 99.
- In the NOTTGWSIZ version, the DIRECTORY command did not list anything, and the
- TYPE command referenced an initialized variable. Fixed in ckuusr.c, ckuus6.c,
- 28 May 99.
- A bunch of similar fixes: ckuus[r67x].c, 28 May 99.
- Modernized HELP SET FILE (TYPE). Kermit had changed so much out from
- underneath it that it was positively misleading. ckuus2.c, 28 May 99.
- With the help of DJ Hagberg at Global Atmospherics, Inc, got past some of the
- initial difficulties with SunLink X.25 9.xx header files. ckcnet.h, 28 May 99.
- In ckucmd.c, #include "ckcnet.h" was after the includes for ckucmd.h and
- ckuusr.h, and this caused some conflicts with the SunLink header files. Moved
- it up to after ckcdeb.h and ckcnet.h, and before ckucmd.h and ckuusr.h.
- Now the X.25 version builds OK on Solaris 2.6. ckucmd.c, 28 May 99.
- Added #ifndef NOCOTFMC around the code in tthang() that closes and reopens
- the device, so we can disable when necessary (or not needed). This is to see
- if it helps with a problem in Unixware 2.0.3, where the TCSETAW ioctl returns
- an "invalid argument" after the close/open. ckutio.c, 1 Jun 99.
- Adjusted HELP SET FILE TYPE text again. ckuus2.c, 1 Jun 99.
- Removed the spurious "?Directory already exists" message that MKDIR always
- printed. ckuusr.c, 1 Jun 99.
- From Jeff, 1 Jun 99:
- . Add missing cmdate2tm prototype to ckucmd.h.
- . Adjust http prototypes in ckcnet.h.
- . Adjust some prototypes in ckuath.h.
- Moved cmdate2tm() from ckucmd.c to ckutio.c, since it is highly unportable.
- Made a symbol CMDATE2TM that must be defined before we can use this routine,
- and defined it by default for UNIX. Made another symbol NOCMDATE2TM to
- override the default definition. If this routine is to be used on non-UNIX
- platforms, it must be copied to their ck*tio.c modules and adapted, but this
- can work only when struct tm is supported. Therefore, to make it more widely
- useful, we need to define a portable abstraction.
- . Some Kerberos-realm-getting changes in ckuus7.c
- . HTTP code fleshed out ckcnet.c.
- The HTTP code in ckcnet.c is not going to be easily portable. It includes
- <time.h>, which is not portable to all platforms. Even in UNIX, there are
- many varieties where it is <sys/time.h>, or has an entirely different name.
- That's why I moved cmdate2tm() to ckutio.c, which already has #ifdefs to take
- care of this. This will need some serious sorting out before we go public.
- Also, you refer to _timezone in http_date() but it's not defined anywhere
- (at least not in SunOS).
- Also, there are calls to nonportable routines like memset(), etc.
- Fixed the call to http_index() in ckuusr.c to have the right number of args.
- From Jeff, IKSD and Kerberos fixes:
- . syslog'ing was not being performed since the syslog flag was saved
- before the syslog was opened and then restored after it was opened.
- . syslog'ing was not being performed during login because the syslog was
- purposely turned off during login. I assume to hide passwords. This
- is a legitimate concern and I specificly turned off the syslog in the
- readpass() and in ckxlogin() around the password reading code.
- . When iksd was compiled with CK_PAM anonymous users would not be
- prompted for a password and would be summarily rejected.
- . corrections to yesterday's kerberos autoget ticketing.
- . Defined CMDATE2TM for K95.
- ckufio.c ckuusr.c ckuus7.c ckuath.c ckucmd.c ckcdeb.h ckcmai.c, 2 Jun 99.
- Changed HTTP code in ckcnet.c to check SYSTIMEH symbol (which is defined in
- ckcdeb.h) before deciding which time.h file to include. Also added some
- comments and #ifdefs to HTTP code in ckcnet.c, but it will never be truly
- portable in its present form. It does, however, build OK on at least Solaris,
- SunOS, HP-UX, and Linux, and presumably also in Win32 and OS/2, so it's worth
- keeping. 2 Jun 99.
- Added /ARRAY: switch to the HTTP command parser for INDEX. dohttp() gets
- the array letter as a new 9th parameter (NUL if none). The action (actually
- assigning stuff to the array) is filled in, but not used, in http_mkarray()
- in ckcnet.c. I guess http_index() needs to call http_mkarray()? 2 Jun 99.
- Still more #ifdefs added to the SCREEN support code to allow for the case
- where tputs() requires a pointer to a void function. ckuusx.c, 3 Jun 99.
- tthang() for some reason stopped working on Unixware 2.0.3. It used to work
- OK in C-Kermit 6.0, and line-by-line comparison of the tthang() code showed
- no change since then. It was following the System V path, first trying to
- manipulate the modem signals (because TIOCMBIS, TIOCMBIC, and TIOCM_DTR were
- defined) and failing because these ioctl's were not actually implemented
- (errno 22), so then falling through to the section that gets the current
- speed, saves it, sets it to 0, waits a bit, and then restores the speed.
- The speed-restoring part was failing (ioctl(ttyfd,TCSETA,...)) with errno 22.
- I have no idea why. Tried "make unixware2 KFLAGS=-DPOSIX", failed miserably.
- So I duplicated the BSD44POSIX speed setting code in #ifdef HUP_POSIX, which
- is defined internally for non-POSIX builds (e.g. Unixware prior to 7.0) that
- need to do POSIX-style hangup. Later, the fix was verified to work on UW2.0.3
- but who knows what effect it will have on 1.x or 2.1. ckutio.c, 3 Jun 99.
- Added -DNOREALPATH to Plan 9 makefile. ckpker.mk, 3 Jun 99.
- From Michal Jaegermann:
- With a separate 'libcrypt' in glibc there is also a header file
- <crypt.h> which provides a prototype for 'crypt()'. Without including
- it a return value from crypt is losing a half of its significant bits
- with 64-bit pointers as crypt() type defaults to int. To work around
- required "frugal" preprocessors (comments in ckcdeb.h) I added
- HAVE_CRYPT_H define in makefile flags where -lcrypt is used with Linux
- and a corresponding conditional include in ckcdeb.h
- time_t type on Linux/Alpha is long but 'tv_sec' field in 'struct timeval'
- is int. I heard that is a POSIX requirement. Looks to me more like a
- bug but quite likely is both. The net effect is that using an address
- of tv.tv_sec (ckufio.c via macro, ckutio.c) where an address of time_t
- is needed results in a unaligned trap. I bracketed these changes with
- LINUX as 64-bit apps on Sparc and on the future ia64 **may** have the
- same problem. In any case an overhead is totally negligible so why
- not be safe. In case ckufio.c 'ut.ut_time = time(NULL);' would likely
- work equally well but I wanted to a keep a consistent style.
- There is a bunch of unused variables (quite likely some are used with
- other defines active) but 'static char lockname[DEVNAMLEN+1]' is
- needed only with USETTYLOCK defined. 'static suftab' in ckuus3.c is
- not used by anything at all.
- Wrong format in sprintf resurfaced in some new place (ckuus4.c) and
- ckussx.c requires a bunch of prototypes from <term.h>. Undeclared
- functions always make me nervous on Alpha. :-)
- Michal's patches installed in makefile, cku[ft]io.c, ckuus[34x].c, 3 Jun 99.
- Added an HTTP feature-selection section to ckcdeb.h. Since the HTTP code is
- not portable, it is disabled by default except for SunOS, Solaris, Linux, and
- HP-UX 10 (the places where I've built it successfully so far), and K-95, and
- disabled by default elsewhere unless -DCKHTTP is given on the CC command line
- or in the makefile target. ckcdeb.h, 3 Jun 99.
- Redid HTTP parser so /ARRAY switch applies to all subcommands and INDEX has
- same filename operands as GET and HEAD:
- HTTP [ /AGENT:<string> ] [ /HEADER:<list of strings> ] -
- [ /PASSWORD:<string> ] [ /USER:<string> ] [ /ARRAY:<array> ] -
- { { GET, HEAD, INDEX } <remote> <local> }, -
- { PUT, POST } /MIME:<string> <local> <remote> }
- ckuusr.c, 3 Jun 99.
- Cast all string args to ttol() to (CHAR *) in the http_blah() routines.
- ckcnet.c, 3 Jun 99.
- Tried building with -DCKHTTP in AIX 4.1. Found that "struct tm" was not
- defined. Why not? There was a clause in ckutio.c specifically to avoid
- including <time.h> if AIXRS was defined. I can't remember why, so I assume it
- must be some peculiarity of AIX 3.x, so I included it after all for AIX41.
- That makes ckutio.c compile. ckcnet.c had the same complaint. In this case
- it was deliberately including <sys/time.h> rather than <time.h> if AIXRS was
- defined. Adding an escape clause for AIX41 here too fixed it, and now we can
- build for AIX 4.1 with HTTP. ckutio.c, ckcnet.c, 3 Jun 99.
- Added -DCKHTTP for AIX41 and Unixware. ckcdeb.h, 3 Jun 99.
- Changes for COHERENT 4.2 from Fred Smith: ckcdeb.h, ckcnet.h, ckctel.c,
- cku[tf]io.c, 4 Jun 99.
- From Jeff: Renaming of ck_krb_ functions to make sense since they are no
- longer tied specifically to Kerberos. ck_krb_* were renamed to ck_tn_* when
- Telnet-related or to ck_auth_* when used for authentication. Fixed prototypes
- in headers to be in the right place and not duplicated. Many modules,
- 4 Jun 99.
- A command like "take xxx" (where xxx does not exist) could give a message like:
- "?Error in TAKE command file: Line too long or contains NUL characters".
- That's because TAKE searches an internal "TAKE path" if the filename is not
- absolute and it can't find the file in the current directory, and a file "xxx"
- that is a directory happens to exist in the TAKE path. TAKE tries to execute
- the directory. Fixed in ckuusr.c, 4 Jun 99.
- If an error occured in a macro that was invoked from a command file, the
- error message would erroneously identify the macro name as the command file
- name. Fixed (I think) in ckuus5.c, 4 Jun 99.
- Implemented SHOW STACK for non-Macintosh platforms (it shows the Kermit
- command stack -- macros & command files). ckuus5.c, 4 Jun 99.
- The stack display was a lot more informative than the previous error message,
- so now we show it every time there's an error in a command file or macro,
- unless QUIET is ON. ckuus5.c, 4 Jun 99.
- New Coherent 4.2 makefile entry from Fred Smith. 7 Jun 99.
- Changed parsing of "help function" to allow "help func substr" or "help func
- fsubstr" or "help func fsubstr". Also fixed "help func" to always go into
- the recall buffer. ckuus2.c, 8 Jun 99.
- Moved rdigits() and chknum() from ckucmd.c to ckclib.c. ckucmd.[ch],
- ckclib.[ch], 8 Jun 99.
- Added isfloat(). ckclib.[ch], 8 Jun 99.
- Added a selection of floating-point functions: ffpadd(), ffpsubtract(),
- ffpsqrt(), etc. Each has one or two floating-point args, and then an
- optional "decimal places" (d) arg. These functions are included if FNFLOAT is
- defined at a compile time. In UNIX at least, it is also necessary to add
- "-lm" to LINKFLAGS, since the math functions are not included in the regular C
- library. Enabled this stuff in SunOS and Linux. So far so good. Will have
- to add them in to others as we go along -- too dangerous to enable by default.
- ckuusr.h, ckuus4.c, 8 Jun 99.
- Added fabsolute(). ckuusr.h, ckuus4.c, 8 Jun 99.
- Peter Eichhorn verified that -DFNFLOAT works on all HP-UX releases 6.5 thru
- 10.20 and updated the makefile targets. 9 Jun 99.
- Discovered that C-Kermit's expression evaluator did not accept '+' as a
- unary operator, so added it. ckuus5.c, 9 Jun 99.
- Fixed a bug in evaluating signed "d" arg in fp functions. ckuus4.c, 9 Jun 99.
- Added rounding for fp results when d > 0. ckuus4.c, 9 Jun 99.
- Added ffpround(), ffpmin(), ffpmax(), ffpsin(), ffpcos(), ffptan().
- ckuusr.h, ckuus4.c, 9 Jun 99.
- Fixed fmod(), fmin(), and fmax(), which were all broken by "goto fnend"s
- that were inserted before they had a chance to write their results to the
- result buffer. ckuus4.c, 9 Jun 99.
- Changed IF <, <=, =, !=, >=, and > to take floating-point operands and to
- allow the <number> in "IF <number> <command>" to be a floating-point number.
- ckuus6.c, 9 Jun 99.
- Verified that FP builds OK on Unixware 2 and 7; updated the makefile targets
- accordingly. makefile, 9 Jun 99.
- Added v(math_pi), v(math_e), and v(cmdbufsize). ckuusr.h, ckuus4.c,
- 9 Jun 99.
- Added HELP FUNC text for all new functions. ckuus2.c, 9 Jun 99.
- A report of an infinite loop during INPUT seemed to indicate that a hack that
- had been added to boost efficiency by preventing extraneous calls to gtimer()
- was, in fact, having the opposite effect. Removed the hack. Also, if INPUT
- got a NUL, it went straight back to the top of the loop, skipping the
- termination checks, thus allowing the burst count to go negative; I fixed this
- by having jump ahead to the termination checks in that case. But the log
- revealed that the NULs were not data, but in fact were being returned by
- coninc() when read(0,&ch,1) failed with errno 19, "No such device" -- not your
- normal kind of error when reading from standard input. Changed coninc() to
- return -1 rather than 0 if read() returns 0 and sets errno to nonzero. I
- don't know how to test this, since I have no idea how the guy got read() from
- stdin to get error 19. At least the changes don't seem to break anything --
- login scripts still work, INPUT from the controlling terminal still works.
- ckuus4.c, ckutio.c, 9 Jun 99.
- Fixed bsdi2, 3, and 4, plus assorted Solaris makefile targets to pass along
- KFLAGS. makefile, 9 Jun 99.
- More FNFLOAT verifying:
- . VMS/Alpha: OK (so updated ckcdeb.h).
- . BSDI 3.1: OK (so updated makefile targets).
- . AIX 4.3: OK (ditto)
- . DU 3.2: OK (ditto)
- . DU 4.0: OK (ditto)
- . SINIX 5.42 OK (ditto)
- . Solaris 2.4: OK (ditto, for all Solaris versions).
- Made sure we can still build without FNFLOAT defined, then added -DFNFLOAT
- and -lm to all (non-Test) SunOS entries. 9 Jun 99.
- Updated ckcdeb.h to not allow FNFLOAT if CKFLOAT not defined or if NOFLOAT
- is defined. 9 Jun 99.
- The CONINTB4CB business was done in only one of two places that needed it.
- Added it to the other place (but more work needed here for SV/68 R3V6).
- ckuus4.c, 10 Jun 99.
- Changed some -FNFLOAT's to -DFNFLOAT. makefile, 10 Jun 99.
- Changes from Jeff: prototype for ck_krb_rlogin() needed #ifdefs; additional
- support for SRP; new blah-export makefile targets for building with Kerberos
- or SRP but without forbidden modules, etc. ckcnet.[ch], ckuus4.c, ckufio.c,
- ckuath.c, makefile, 10 Jun 99.
- Added prototypes for readpass() and readtext() to ckcdeb.h, 10 Jun 99.
- Defined NOHTTP automatically if OS2ORUNIX is not defined. Now we can build
- a network version again on VMS. ckcdeb.h, 10 Jun 99.
- Fixed a printf() in showstk() that had a %d with no int to print. 10 Jun 99.
- Jeff noticed that packet recognition at the command prompt sometimes doesn't
- work when packets contain spaces, which cause gtword() to return. Mostly they
- work anyway, because the piece of the packet before the space usually does not
- correspond to a top-level command keyword or token, and so we continue
- absorbing packet characters until the CR or LF is reached. It's awkward,
- however, since the command parser is beeping and spewing out error messages
- all the while, and packet detection probably *could* fail if a piece of
- ("word" in) a packet corresponded to something legal in a command at that
- point. I made an initial stab at fixing this problem by setting a global
- variable, kstartactive, whenever kstart() thinks it's in a packet, and
- unsetting it whenever it gets any control character besides SOP (since control
- characters can't appear within an S or I packet). This seems to work OK. You
- can get in trouble by typing ^A at the prompt, but you get out of it again as
- soon as you type another control char. Needs testing and maybe some
- refinement. ckcnf2.c, ckucmd.c, 10 Jun 99.
- Installed a new initfloat() routine to be called at startup when FNFLOAT is
- defined, which determines by inspection (a) the precision of floating-point
- numbers, and (b) whether printf("%f",x) does rounding. This way we don't need
- any #ifdefs or system/hardware-dependent code. On a Sparc, we get 16 decimal
- digits of precision (more like 16.25). As a reality check, assuming 3.3219282
- bits per decimal digit, that gives us 54 bits for the mantissa, allowing 10
- bits for the exponent and sign, which seems about right. ckuusr.h, ckcmai.c,
- ckuus[45].c, 11 Jun 99.
- Changed floating-point output code to (a) create an sprintf() format string
- for the desired number of decimals; (b) let sprintf() do the rounding if
- initfloat() says it can; (c) set all digits beyond the precision to 0 rather
- than return random digits. ckuus4.c, 11 Jun 99.
- Made v(math_e) and v(math_pi) return the number of digits appropriate to
- the machine precision. ckuus4.c, 11 Jun 99.
- From Jeff:
- . Define FNFLOAT for K95.
- . Protect refs to fp_digits in v(math_*) functions with #ifdef FNFLOAT.
- . Changes for compatibility with new Kerberos credential cache APIs.
- . Kerberos 4 realm was not being evaluated when the credentials cache is
- not a file.
- . Fixes for the IKSD packet problems (bad code).
- . When entering CONNECT mode iks_wait() must request a response.
- Otherwise, the receipt of an initial START can result in a premature
- exit to command mode. This is not a change in the TKO protocol.
- ckuath.c, ckctel.c, ckcpro.w, ckuusr.c, ckuus4.c, ckcdeb.h, 13 Jun 99.
- Fix from Jeff for fprintf(stderr,...) front end for WRITE ERROR, which has
- been writing to stdout instead of stderr ever since ckxprintf() was added for
- IKSD. ckutio.c, 13 Jun 99.
- Fixed WRITE and WRITELN { SCREEN, ERROR } to handle EOL as requested.
- ckuusr.c, 13 Jun 99.
- Put the finishing touches on floating-point functions: handle the case where
- the d arg is a variable with an empty value; fix HELP FUNC to handle ambiguous
- keywords better, etc. ckuus[245].c, 13 Jun 99.
- Checked to make sure that gtword() was calling kstart() only if COMMAND
- AUTODOWNLOAD was ON. It was. ckucmd.c, 13 Jun 99.
- Minor code rearrangement in zvuser() to squelch "statement not reached"
- warnings in non-Kerberos builds. ckufio.c, 13 Jun 99.
- Added -DFNFLOAT to NeXTSTEP targets; -lm was not needed in this case.
- makefile, 13 Jun 99.
- Added a status indication to SHOW CONNECTION (active, closed, or unknown),
- which is obtained from calling ttchk(). ckuus3.c, 13 Jun 99.
- Started Adding new general-purpose file i/o commands:
- FILE { OPEN, CLOSE, READ, WRITE, REWIND, LIST } [ switches ] <channel> ...
- These are parsed and executed if CKCHANNELIO is defined (it isn't defined yet
- except if you "make blah KFLAGS=-DCKCHANNELIO). Non-UNIX platforms need
- z_xxx() routines filled in. The idea is to allow multiple open files at once,
- in any combination of read/write/append mode, referred to by their channel
- number, which is assigned by FILE OPEN. It works, but is not finished --
- still need to:
- . Add more robustness to parser.
- . Make execution (esp. of READs) more efficient.
- . Pass error codes / messages back upon failure.
- . Put prototypes in header files.
- . Hook into IF OPEN command.
- . Document the API.
- . Document the commands.
- . Find out how to reasonably set Z_MAXCHAN in UNIX & elsewhere.
- . Add HELP text.
- . Test test test.
- For now I'm leaving CKCHANNELIO undefined so people can build the current
- sources normally without noticing it. ckuusr.h, ckcker.h, ckuusr.c, ckuus7.c,
- ckufio.c, 13 Jun 99.
- Fixed v(math_pi) and v(math_e) to NUL-terminate themselves; when will I
- learn to remember that strncpy() can't be trusted to do this... ckuus4.c,
- 14 Jun 99.
- From Jeff: IKSD should not request the client to stop processing Kermit
- packets simply because it is entering server mode. ckcpro.w, 14 Jun 99.
- From Jeff:
- . make v(authstate) work for the client side connection
- . added v(authtype) so a script can determine which method is being
- used to authenticate with the host.
- ckuusr.h ckuus4.c ckuath.c, 14 Jun 99.
- More work on the FILE command:
- . Added more robustness to parser.
- . Passed error codes / messages back upon failure.
- . Put prototypes in header files.
- . Documented the commands in ckermit2.txt.
- So far only on SunOS. ckcker.h, ckuusr.h, ckuus7.c, ckufio.c, 14 Jun 99.
- Added "fi" as abbreviation for "finish", since "file" introduced a conflict.
- ckuusr.c, 15 Jun 99.
- Added #include <time.h> for SV68R3V6. ckutio.c, 15 Jun 99.
- Added some preprocessor tests for maximum number of open files: OPEN_MAX,
- FOPEN_MAX, etc. ckufio.c, 15 Jun 99.
- Got z_getpos() working and improved the FILE STATUS display.
- ckufio.c, 15 Jun 99.
- Changed sv68r3v6 target to use wermit rather than xermit, since the xermit
- built lost its mind when escaping back from CONNECT. makefile, 16 Jun 99.
- Added FOPEN, FREAD, FWRITE, FCLOSE, etc, as shortcuts for FILE OPEN, etc.
- ckuusr.[ch], 16 Jun 99.
- Added v(filemax) and v(fileerror). ckuusr.h, ckuus4.c, ckufio.c, 16 Jun 99.
- Straightened out parsing of read and write filenames. ckuus7.c, 16 Jun 99.
- Got READ/WRITE mode working. ckufio.c, 16 Jun 99.
- Made it possible for FREAD /CHAR and FWRITE /CHAR to handle NUL bytes.
- ckuus7.c, ckufio.c, 16 Jun 99.
- Fixed unguarded references to VN_FERR and VN_FMAX in ckuus4.c, 17 Jun 99.
- Added EXEC command for UNIX only under #ifdef CKEXEC. Like RUN, but overlays
- C-Kermit with the given program. Might be useful for who knows what -- PPP
- dialing maybe? ckcdeb.h, ckuusr.[ch], ckuus[25].c, ckufio.c, ckcplm.txt,
- ckermit2.txt, 17 Jun 99.
- Added "(R)" "(W)" "(RW)" "[EOF]" etc to FLIST display. ckuus7.c, 17 Jun 99.
- Added file functions:
- f_status(channel) = 0 if not open; OPEN flags (1-7) if open.
- f_pos(channel) = File pointer.
- f_handle(channel) = File descriptor (UNIX).
- f_eof(channel) = 1 if at EOF, 0 if not at EOF.
- f_getchar(channel) = FREAD /CHAR.
- f_getline(channel) = FREAD /LINE.
- f_getblock(channel,n) = FREAD /SIZE:n.
- f_putchar(channel) = FWRITE /CHAR.
- f_putline(channel) = FWRITE /LINE.
- f_putblock(channel,n) = FWRITE /STRING.
- Removed all vestiges of BINREAD from code. ckuus[r6].c, 17 Jun 99.
- Changed FILE READ to allow variable name to be omitted, in which case it
- just prints what it reads. ckuus7.c, 17 Jun 99.
- Added another arg to z_in() so allow length of buffer to be specified
- separately from number of bytes to read. ckcker.h, ckufio.c, ckuus[47].c,
- 17 Jun 99.
- Documented the new file i/o API, plus the new z_exec() function. ckcplm.txt,
- 17 June 99.
- Made sure the code builds OK without CKCHANNELIO on HP-UX 10.20 and Linux.
- Then tried building with CKCHANNELIO on HP-UX (non-ANSI compiler) and Linux
- (ANSI). It does, a good sign...
- File i/o code verified on HP-UX 8.00, NeXT, ... Since it uses <stdio.h>
- features like fopen()/fread()/fwrite()/fclose()/etc, which have been used in
- the mainline code since Day One for opening and reading command files, I'm
- assuming it will be portable to all UNIXes, and so enabled it by default (i.e.
- unless NOCHANNELIO is defined) for UNIX in ckcdeb.h. Also moved the code to
- ckvfio.c for VMS, where it built with no modifications (except I had to define
- Z_MAXCHAN "by hand" since DECC defines OPEN_MAX as 5 (!). Meanwhile, Jeff
- copied the code to ckofio.c, where it built with no changes, suggesting we
- should put it in a non-system-specific module... So I moved the z_blah()
- material from ckufio.c to ckuus7.c, and removed it from ckvfio.c and ckofio.c,
- and took care of any difference in ckcdeb.h, and enabled the code for UNIX,
- K95, VMS, and VOS. 18 Jun 99.
- Added HELP text for FILE commands and functions. ckuus2.c, 18 Jun 99.
- Added v(math_precision). ckuusr.h, ckuus4.c, 20 Jun 99.
- OPEN !READ, READ ... was broken on VMS. I don't see how it ever could have
- worked -- the code to handle it was missing from rinfill(). Fixed in
- ckvfio.c, 20 Jun 99.
- Disallowed FILE OPEN 0 foo.bar, which worked and assigned the channel number
- for foo.bar to the macro called "0". Too confusing. No numbers allowed here
- from now on. ckuus7.c, 20 Jun 99.
- Added support for Multitech MT5634ZPX modem. ckuusr.h, ckudia.c, 21 Jun 99.
- Fixed a typo in the FREAD/FWRITE parser that could result in an infinite loop.
- Also fixed a mistake in FREAD parsing that could make it ignore the target
- variable. ckuus7.c, 21 Jun 99.
- Added FILE OPEN /BINARY. ckcker.h, ckuus[27].c, 21 Jun 99.
- On some platforms OPEN_MAX or FOPEN_MAX (from which we derive CKMAXOPEN) is
- defined as a ridiculously small number so dimensioning our file array to
- (CKMAXOPEN-ZNFILS-5) fails at compile time because the result is negative.
- However, this tends to be a meaningless definition. For example, DECC 6.0 for
- VMS defines FOPEN_MAX to be the "minimum number of files that the DEC C
- compiler for your system guarantees can be open simultaneously", which turns
- out to be something like 5 when we all know that VMS will let you open
- hundreds of files. HP-UX 7.05 also has a very small number for this. Since
- we can't use relops in proprocessor directives (not portable), I changed the
- code to allocate the file array dynamically to a minimum length of 16. Let
- the code fail at runtime if no more files can be opened. ckcdeb.h, ckuus7.c,
- 21 Jun 99.
- Updated k95 Windows startup flags help text from Jeff. ckuusy.c, 22 Jun 99.
- Changed z_in() section that reads lines to do its own buffering. z_in() now
- contains three alternative methods for reading lines, chosen by #ifdef. Ran
- exhaustive trials and found no significant difference among the three, so I
- went back the original and simplest one: fgets(). ckuus7.c, 22 Jun 99.
- Installed a fix for Tru64 UNIX 5.0 from Farrel Woods at DEC; the utmp struct
- used 64-bit times, but time() expected a 32-bit one. ckufio.c, 22 Jun 99.
- Added code to UNIX sysinit() to try getting the system configured open
- file limit from sysconf(_SC_OPEN_MAX), called only if _SC_OPEN_MAX is defined.
- Seems harmless enough, and works on at least SunOS and HP-UX 10. ckutio.c,
- ckuus[57].c, 22 Jun 99.
- Added a cast to the malloc() for the array of file structs in z_open(),
- plus assorted minor cleanups. ckuus7.c, 23 Jun 99.
- Peter E convinced me that the d=0 format for ffpxxx() functions was pretty
- useless -- who cares what the "default precision" of the underlying C libary
- "%f" printf format is? So I changed it to give the maximum precision of the
- hardware. So, for example, when the precision is 16 digits, ffpdiv(10,3)
- gives 3.333333333333333 instead of 3.333333. But in making this change I
- found that rounding is not done in many cases when d=0. But it wasn't done
- before either. ckuus4.c, 23 Jun 99.
- Kerberos changes from Jeff: ckuath.[ch], ckuus7.c, 23 Jun 99.
- Peter E pointed out that server returns full pathname in ACK to F packet
- when DISABLE CD is in effect. Fixed in ckcpro.w, 24 Jun 99.
- Fixed a typo in the new MT5634 modem support. ckudia.c, 24 Jun 99.
- Detlev Knorpp discovered that the sequence: "log packets" and then "log
- connections" and then file transfer (in that order) makes C-Kermit dump core.
- This was because of a typo in diaopn(), in which we closed the packet log
- instead of the connection log, prior to opening the new one. It seems that
- logpkt() calls zsoutx() to write a packet-log record, but neither one of these
- routines calls chkfn() to make sure the log file is actually open -- they just
- assume it is. Fixed the typo and had logpkt() call chkfn(). ckuus4.c,
- ckcfn2.c, 24 Jun 99.
- Added FCLOSE ALL to close all open files and FSEEK <channel> EOF to move the
- file pointer to the end of the file. ckuus7.c, 24 Jun 99.
- Peter E has been reporting a bug in which FREAD would get an error the first
- time it's called on an open file, but then works on all subsequent calls until
- EOF. This was because, for some reason on his HP-UX 6.5 and 7.05 systems, the
- following sequence:
- errno = 0;
- x = fgets(buf,len,file);
- if (errno) ...
- sets errno to something bizarre like ENOTTY, and z_in() was returning a
- failure code in all cases if errno was nonzero after the fgets() or fread().
- I changed the code to return an error only if fgets() or fread() actually
- failed to return any characters. Also added debugging statements to catch
- when this happens. ckuus7.c, 24 Jun 99.
- Looked into getting ffpxxx() functions to round when d=0. Not a chance.
- The reason: The digit after the last significant digit is garbage, so it can't
- be used to round the last significant digit. ckuus7.c (comments only),
- 24 Jun 99.
- From Jeff:
- . Changes to allow K95 to be built with NO_ENCRYPTION
- . Correction to ckuus7.c. ckferror() was being called with the wrong
- variable.
- . Fixes for SRP authentication problems.
- ckcdeb.h ckuath.c, ckctel.c, ckuus7.c, 25 Jun 99.
- The SRP business is as follows:
- Several years ago it was discovered that there was an operating system whose
- telnet server did not properly follow the telnet protocol. In particular,
- this OS vendor did not terminate its subnegotiations properly. Instead of
- IAC SB <option> <data> IAC SE
- the vendor sent
- IAC SB <option> <data> SE
- Now, prior to implementing authentication and encryption there were no
- subnegotiations that would send 8-bit high data. So adding a check to enable
- Kermit to work with this broken server was not a problem. As it turns out,
- when encryption or authentication is being used the chance for the <data> to
- contain an SE byte is very likely. Hence, the string that was supposed to be
- 128 bytes was truncated at 45 bytes and the rest of the string was treated as
- terminal data. SRP didn't work and you got garbage. This check had already
- been removed for builds with encryption. I have no removed this check for all
- builds. (End quote)
- FILE OPEN channels were not being recycled. Fixed in z_open(): ckuus7.c,
- 25 Jun 99.
- The SHOW STACK command, which is now also implicitly invoked any time we get a
- command error, was not handling the FOR, WHILE, [X]IF, and SWITCH commands as
- expected, since these are implemented as 2-level internal macros, in which we
- stuff the %0..9 values from 2 levels up. The stuffing can not change without
- breaking existing scripts, so I added a hack to shostack() to test for these
- four cases and make the appropriate substitutions in the display. ckuus5.c,
- 25 Jun 99.
- Changed ?-help for switches to put a colon at the end of any switch that takes
- an arg. kwdhlp(): ckuus7,c, 25 Jun 99.
- VMS C-Kermit 7.0 Beta.07 in server mode would crash if given a REMOTE HOST
- command. It doesn't crash any more, and responds correctly -- I must have
- fixed it on June 20th when I fixed the broken OPEN !READ / READ sequence.
- Made DELETE /QUIET not print error messages if file doesn't exist. dodel():
- ckuus6.c, 25 Jun 99.
- Fixed HELP FUNC parsing once and for all. Now you can type "help func" by
- itself, or (e.g. for fsubstring()) "help func" followed by "sub", "fsub",
- "sub()", "fsub()", "fsub", "fsub()", "\fsub()", "\fsub", etc etc, without
- getting spurious error messages or having to confirm more than once, and a