ckc197.txt
资源名称:cku197.tar.Z [点击查看]
上传用户:dufan58
上传日期:2007-01-05
资源大小:3407k
文件大小:866k
源码类别:
通讯/手机编程
开发平台:
Windows_Unix
- Removed voluminous debug() statements from x[gp]nbyte(). ckcfns.c, 18 Oct 99.
- As an experiment, added a global flag wasclosed, which is set to 1 by any code
- that closes a connection (and sets ttyfd to -1), and is tested and reset at
- the top of the parse loop. ckcmai.c (definition); ckuus5.c (test and reset);
- ck[uv]tio.c, ck[cl]net.c (set). For this to work in other platforms requires
- similar additions to ck?tio.c. A closed connection is noticed only in the
- command loop, because that's the only place that any user-defined actions can
- be executed. If the user gives a SET LINE/PORT/HOST/etc command while another
- connection is still open, there is also a check in hupok(), so if they have
- SET EXIT WARNING ON it will work here too. Otherwise it won't since both the
- close and the new open happen within the same call to ttopen(). A second
- variable, whyclosed, tells why the connection was closed: 0 is the catch-all
- "closed by remote"; 1 = HANGUP or CLOSE by user, 2 = auth failure. At the top
- of the parse loop, if wasclosed is set and a macro called ON_CLOSE is defined,
- we set it up and execute it. The close reason (0, 1, or 2) is passed to the
- macro as %1. 18 Oct 99.
- Spiffed up ON_CLOSE a bit by calling it in clsconnx(), which is our new
- all-purpose ckuus*.c connection-closing routine, and in the exit sequence,
- just before ON_EXIT. This SEEMS to catch all the places where we need it.
- ckuus[57x].c, ckermit2.txt, 18 Oct 99.
- Fixed SET FILE CHARACTER-SET to not use the same chained FDBs as REMOTE
- SET FILE CHARACTER-SET. ckuus7.c, 19 Oct 99.
- From Jeff: ckcmai.c: the login functionality has to take place in the first
- thread on NT. ckcfns.c: fix pnbyte() call in reof() to reference appropriate
- output function pointer. ckcmai.c ckuus3.c: minor change to allow SET SYSLOG
- to only work on IKSD during the processing of IKSDCONF. 19 Oct 99.
- Next project: SEND /ARRAY:<arrayref>. When done, this command lets Kermit
- send the contents of any array. The major goal is to link file transfer and
- scripting. With this, for example, a Kermit script can read selected lines
- from a file into an array, manipulate the lines or the array in any desired
- way, and send the result without intermediate files or filters. Added parsing
- to ckuusr.[ch], plus a preliminary test routine that I'll finish & move
- tomorrow. 19 Oct 99.
- Finished SEND /ARRAY. Removed test code from ckuusr.c, moved the dummy
- agnbyte() routine (get next byte from array) to ckcfns.c, changed zminchar()
- macro definition to call agnbyte() when sending from an array. Faked the
- filename as "_array_a_" (or b, etc). Made sure we can still build with
- -DNOSPL. ckcker.h, ckuus[r2].c, ckcfn[s3].c, ckermit2.txt, 20 Oct 99.
- Merged in Jeff's changes mainly for Kerberos and ON_CLOSE reasons for Telnet
- protocol-based closure. Many modules. 20 Oct 99.
- Removed the -DMAINISVOID's that were added to the makefile recently and
- changed the default type for main() from void to int, and simplified the
- hideous #ifdefs around it. NOW let's see who hollers... ckcmai.c, 20 Oct 99.
- Shuffled some lines in TRANSLATE to avoid "statement not reached" errors in
- HP-UX. ckuus4.c, 21 Oct 99.
- Fixed a debug() call in ckcfn3.c, 21 Oct 99.
- Peter E reports that when using a Telnet modem server, after the following
- sequence of commands:
- dial xxxx <-- does not exist in dialing directory
- dial yyyy <-- does exist in dialing directory
- the redial number is xxxx and not yyyy. It doesn't happen when dialing with a
- serial port. The variable is dialnum. I don't have a Telnet modem server and
- can't reproduce it, and inspection of the code shows that from between the
- time the number is fetched and it is stored, there is no different path
- through the code for serial and network dialing. Will have to dummy it up
- with a fake modem server:
- set host /connect * 3000
- set terminal newline on ; (So Enter sends CRLF)
- Client does the regular sequence to use it:
- set host 0 3000
- set modem type hayes
- set dial display on
- set dial directory foo ; File that has entry for yyyy but not xxxx
- dial xxxx
- In the server window I type OK<Enter> to each setup command and then
- NO CARRIER<Enter> to the ATDTxxxx comand. Then I tell client to "dial yyyy"
- and go thru the same sequence at the server. Now SHOW DIAL on the client
- shows the correct redial number: yyyy (not xxxx).
- Changed character-set associations for incoming files when transfer character
- set is UCS-2 or UTF-8 to be UCS-2 in Windows, UTF-8 elsewhere. ckuxla.c,
- 22 Oct 99.
- In testing the previous change noticed that SEND /TEXT did not work any more,
- i.e. it did not force a text-mode transfer. Refer to previous notes
- throughout 1998 about automatic mode-switching versus SET TRANSFER MODE, etc.
- The notes make sense but the code in whoarewe() did not agree with the prose.
- Removed a mistaken test on the saved transfer mode. ckcfns.c, 22 Oct 99.
- A minor command-parsing improvement. Suppose you type "te" and then Esc at
- top level. It beeps because more than one command starts with "te", so then
- you type "?" to see what they are but Kermit shows "telnet" as the only
- possibility. So why the beep? Because of invisible keywords like "telopt",
- "terminal", and "text". But there is no way for the user to discover them.
- The improvement is: if ? is typed AFTER the beginning of a keyword field, then
- invisible keywords are shown too, but if it is typed at the beginning of a
- field, only visible keywords are shown, as before. ckucmd.c, 22 Oct 99.
- Since we have the Base64 conversion routines anyway, added /FROMB64 and
- /TOB64 switches to the COPY command. ckclib.[ch], ckuus[26].c, 22 Oct 99.
- From Jeff: Correction to TAPI dialing setup: ckuus6.c; minor Win9x
- authentication changes: ckcmai.c. 23 Oct 99.
- Added some debugging and commentary to makestr(). ckclib.c, 23 Oct 99.
- Put a malloc-failure error check after setting redial number to help catch
- Peter E's problem. Ran the big demo script with debug log to see if any
- malloc entries appeared; none did. ckuus6.c, 23 Oct 99.
- There was an inconsistency in macro invocations. If xx is macro name, it can
- be invoked as "xx" or "do xx". An "immediate" macro can be invoked as
- "{ command, command, ... }". But "DO { command, command, ... }" gave a syntax
- error. Fixed in ckuusr.c, 23 Oct 99. Restriction: immediate macros can not
- take args (this would have been a big deal to program in the non-DO case but
- actually pretty easy in the DO case). The big demo script still works.
- Rob Seace <rob@wordstock.com> reported that the getline script did not work
- in QNX. Of course it doesn't, QNX has no UUCP lockfiles or any other method
- for locking dialout devices. But Rob pointed out that QNX has a dev_info()
- call that returns the open count. But we can't really use it as a lock since
- we don't necessarily know its full set of behaviors, nor do we know to what
- degree users depend on the current behavior. So I added a new command, which
- is visible only in QNX (but which can be given anywhere, but does nothing):
- SET QNX-PORT-LOCK { ON, OFF }. It is OFF by default. When ON, it allows the
- open count to serve as a port lock. In the meantime (until the next Beta),
- added a note to getline. Then made a new getline that works right with QNX,
- which can be installed when Beta.11 is released. In ckutio.c, I added
- a qnxopencount() routine, which gives the device open count. ttlock() calls
- this and fails if the count is > 1 and QNX-PORT-LOCK is ON. SHOW COMM (fo
- QNX only) displays the QNX-PORT-LOCK setting and, if a device is open, the
- current open count.
- In building on QNX I found some #ifdefs had slipped out of their places as
- they are wont to do, and so fixed them. ckutio.c,
- Found that the old bug of curses working only once in QNX seems to be fixed,
- whether by Kermit or a newer QNX version I don't know.
- Tried resurrecting the 16-bit QNX version, this time with -DNOSPL and
- -DNOFLOAT. It built fine, starts OK, but it beeps when you type a space, CR,
- etc, after the top-level keyword. But aside from that it seems to work OK, so
- apparently the problems I've been having till how have to do with the new
- floating-point support (plus the large size of ckuus4.c). The compiler is
- Watcom 10.6. Extensive debugging shows the bell is not being run by Kermit
- calling bleep(). Tried building again with TCP/IP and found it would make the
- connection, complete the Telnet negotiations, show the login prompt, but
- apparently would not send keystrokes. Comparing logs from the 16 and 32 bit
- versions showed that the qnx32 version had FIONREAD defined, but qnx16 did
- not. Fiddled the #includes to force the 16-bit to include <ioctl.h>, and now
- it does use the FIONREAD ioctl, which works, but we still get the same
- symptom, and I really can not see the difference in the log. This was all
- with ckucns.c. Switched back to ckucon.c. No difference. The debug log
- of the 16-bit version looks just like the debug log of the 32-bit version...
- Well, to make a very much longer story short, it turns out a piece of
- buffer-filling code was lost in the #ifdefs for NOCSETS builds when Unicode
- support was added to ckucns.c, and the mistake was copied to ckucon.c.
- Fixed in both, 23 Oct 99. (But we still get the mysterious beep.)
- Makefile updated to rehabilitate qnx16. 23 Oct 99.
- Fixed a misplaced last-minute #ifdef in yesterday's code that prevented
- ckcuni.c from compiling. 24 Oct 99.
- Propogated #indef NOCSETS correction to ckvcon.c, 24 Oct 99.
- There has always been a confusing lack of symmetry between OPEN and CLOSE.
- Also, SET LINE and SET HOST are misnamed because SET is not supposed to be
- an action command. So...
- . Uncoupled the OPEN command from file disposition symbols as keyword
- values, and defined a new set of OPN_xxx symbols for it. ckcker.h,
- ckuusr.h, 24 Oct 99.
- . Made OPEN HOST, OPEN LINE (PORT) be synonyms for SET HOST, SET LINE
- (PORT). ckuus[36].c, 24 Oct 99.
- . Made CLOSE !READ and CLOSE !WRITE acceptable synonyms for CLOSE READ
- and WRITE, and CLOSE HOST, LINE, and PORT synonyms for CLOSE
- CONNECTION. ckuusr.c, 24 Oct 99.
- Some corrections to typos un_to_sj() noticed by Jeff. ckcuni.c, 24 Oct 99.
- Another longstanding item on the to-do list: INPUT pattern matching. Expect
- can do it, Kermit can't. I thought of a way to add this that does not involve
- huge amounts of redesign or breaking existing scripts. Since the pattern is
- always passed through xxstring at parse time anyway, I added a new function
- fpattern(), which simply returns its argument (after evaluation) and sets a
- flag saying it's a pattern. Then a parallel array of flags is passed to
- doinput() along with the regular array of MINPUT search strings. This allows
- both patterns and literal strings to be used with INPUT and lets MINPUT be
- given any mixture of patterns and literal strings. In the matching loop, if
- the current search string is a pattern, we call ckmatch() on the pattern and
- all right substrings of the string we have input so far. Crude but effective
- (and necessary, since we also want to set a variable to the piece that
- matched, and this could not be done otherwise). ckuusr.h, ckuus[r24].c,
- ckermit2.txt, 24 Oct 99.
- Updated REINPUT to also accept a pattern. ckuus4.c, 24 Oct 99.
- Protected a comparison of type KEY with > 255 by #ifdefs on platforms where
- KEY is CHAR or char. showkeycode(): ckuus5.c, 25 Oct 99.
- Added debugging to dodial() and ckdial() to catch Peter E's bug. ckuus6.c,
- ckudia.c, 25 Oct 99.
- Some minor syntax corrections for VMS. ckvfio.c, ckuus6.c, 25 Oct 99.
- Built on VMS with runtime checking of array bounds, pointer values, and
- for references to uninitialized variables -- let's hear it for DECC!. Tested
- CONNECT mode, file transfer, and script execution -- no problems were reported.
- 25 Oct 99.
- Added ON_OPEN. It gets ttname[] as its only argument; probably most other
- items are available as v(things). More open/close symmetry... ckuus[7y].c,
- 25 Oct 99.
- Peter's REDIAL problem solved. It's not Kermit, it's his modem. The modem is
- told to "ATDsomestring" and replies "OK" because "somestring" contains an "s",
- which triggers some unknown function in the modem. To Kermit, "OK" means
- "partial dialing successful" and so sets the partial flag, which in turn
- inhibits storage of the REDIAL number. Changed so when the modem replies "OK"
- to an ATD command and the Kermit command was not PDIAL and the dial number did
- not end with ';', it is now considered an error. ckudia.c, 26 Oct 99.
- Corrections from Jeff to dofast(). ckcfn3.c, 26 Oct 99.
- Lots of minor changes from Jeff, plus the beginning of an IKSD command (what
- is it?). ckcdeb.h ckcfn3.c ckcker.h ckuath.c ckucns.c ckutio.c ckuus2.c
- ckuus4.c ckuusr.c ckuusr.h ckuusx.c ckwart.c, 27 Oct 99.
- Changed UNIX CONNECT-mode Ctrl-? menu to be clearer and to only list
- options that make sense on the current kind of connection. ckucns.c,
- 27 Oct 99.
- In trying to chase down a report that K95 reported backwards file types
- when receiving files from TSO Kermit, which, unlike most other Kermits,
- includes the Format of Records within Packets attribute (/), changed gattr()
- to handle this attribute in incoming packets (previously it ignored it
- except in VOS, and the VOS code was bogus). This made no difference. So then
- I dummied up C-Kermit to send A-packets with the same fields as TSO Kermit.
- This made no difference either -- I still can't see anything wrong. ckcfn3.c,
- 27 Oct 99.
- Found a couple places in ttinl() where wasclosed wasn't being set, which
- prevented ON_CLOSE from running if the connection dropped during a file
- transfer. As a by-product, fixed this case so ttclos() was called, thus
- ensuring that subsequent calls to ttchk() would behave as expected, rather
- than indicating the connection was still open. ckutio.c, 27 Oct 99.
- Added "iso2022jp" as a synonym for JIS-7. They aren't exactly the same, but
- they're close enough (ISO 2022-JP is specified in RFC1463 and seems to be the
- same as DEC Kanji, which we also support as if it were JIS-7, different only
- in that JIS-7 includes SO/SI access to halfwidth Katakana and the other two
- don't). ckuxla.c, 27 Oct 99.
- Rewrote UNIX ttclos() to handle the case better where close() doesn't return
- and we time out. Now we set O_NDELAY first (if available) we also re-set the
- alarm before trying any operation that might hang, such as tthang(), ttres(),
- close(), etc, to avoid being stuck for a really long time (or forever), and
- in fact, since any or all of these might time out, the new implementation is
- a state machine that remembers how far it it got so it doesn't repeat any
- previous steps (which has been its mistake up till now). ckutio.c, 28 Oct 99.
- Discovered that mdmhup() (the routine that hangs up a modem by sending +++ATH0
- or whatever to it) didn't work right if no prior DIAL command had been given,
- since the modem-command response-reading function pointer had not yet been set
- up. Fixed in ckudia.c, 28 Oct 99.
- Added more error-checking and debugging to the POSIX section of tthang().
- ckutio.c, 29 Oct 99.
- Added Rockwell V.90 modem. ckuusr.h, ckudia.c, 29 Oct 99.
- Assorted changes from Jeff: ckuath.c ckuusy.c ckuus5.c ckcnet.c ckuusr.h
- ckuusr.c, 29 Oct 99.
- From Jeff: ckcmai.c - iksdcfg flag in the wrong place; ckudia.c - typo in new
- modem def's; ckuusr.c - correction for OS2; ckuath.c - SSL/TLS improvements.
- 30 Oct 99.
- Dave Sneddon noticed when C-Kermit was in the middle between a terminal and a
- VMS system, that SET TERM/INQ on VMS caused errors if SET TERM APC is ON. The
- same thing happens with the VMS and UNIX versions. I seem to have broken this
- when adding the Transparent Print code. The problem is that escape sequences
- from the keyboard are being treated just like escape sequences from the host
- -- buffered up and then sent to the "printer" when complete. Oops. In fact,
- this reveals a HUGE whole that opened up when I converted the UNIX CONNECT
- module from two forks to one. In the 2-fork version, each fork had its
- separate data space, thus variables like "inesc" were separate for the
- incoming and outbound data streams. In the single-fork version, the same
- state machine and variables were used simultaneously for the host-to-screen
- and keyboard-to-host streams, resulting in no end of confusion -- I'm
- astounded nobody noticed it till now. This was fixed by making the state
- variables (inesc and oldesc) into 2-element arrays, indexed by 0 = char from
- host, 1 = char from keyboard. Works well without breaking APC and transparent
- printing. ckucns.c, 30 Oct 99.
- Same changes for VMS. Built & tested OK. ckvcon.c, 30 Oct 99.
- From Jeff: some debugging changes for the network modules. ckctel.c,
- ckcnet.c, 31 Oct 99.
- Fixed trailing blanks & long lines. ck[cuw]*.[cwh], 31 Oct 99.
- Got rid of startup message "Default file-transfer mode is ...", since it
- doesn't give the user any clues about how to change it. Changed SHOW FILE to
- enunciate the relevant info a bit more clearly. ckuus[45].c, 31 Oct 99.
- Fixed Linux ncurses target to allow for ncurses.h being in either /usr/include/
- or /usr/include/ncurses/. From Thomas Dickey <dickey@clark.net>, 2 Nov 99.
- Fixed typos Rockwell V.90 modem entry. ckudia.c, 2 Nov 99.
- Changed command module not to print "?Timed out" if ASK-TIMEOUT expires if
- QUIET is ON. ckucmd.c, ckuus6.c, 2 Nov 99.
- The notation fsubstring(m(name),n1,n2) was annoying me, so I added a
- shorthand: s(name[n1:n2]). Works like m(name) except the substring notation
- is allowed; the separate letter is to prevent collisions with do-it-yourself
- data structures like the ones in the script library. ckuus4.c, ckermit2.txt
- Section 7.24, 2 Nov 99.
- Added fhex2n(), the inverse of fn2hex(), for converting a hex number to
- a decimal one. Also fhex2ip() to convert a hex IP address into a dotted
- decimal one, and fip2hex() to do the inverse. ckuusr.h, ckuus[24].c, 2 Nov 99.
- SSL/TLS stuff from Jeff: ckuus3.c ckuus7.c ckudia.c ck_crp.c ckctel.c
- ckutio.c ckcnet.c ckuath.c ckuusr.c ckuus2.c makefile, 2 Nov 99.
- Fixed trailing blanks & longlines in Jeff's files.
- Added foct2n() for symmetry with fn2oct(). ckuusr.h, ckuus[24].c, 3 Nov 99.
- Nested s(blah[n:m])'s didn't work, e.g.
- s(block[1025:fhex2n(s(block[101:4]))])
- Problem: zzstring()'s ?(name) parser didn't allow for nested parentheses.
- Therefore some other stuff that should have worked even prior to the
- introduction of s() wouldn't have worked either, e.g. m(fxxx(..)).
- Fixed in ckuus4.c, 3 Nov 99.
- Changed arraybounds() not to fail on negative numbers (because I cheat and
- use arraybounds() to parse the range specifier in s(blah[m:n]) and there
- is no reason not to allow negative numbers). ckuus5.c, 3 Nov 99.
- SSL/TLS stuff from Jeff: ckuus7.c ckutio.c ckuath.c, 4 Nov 99.
- Peter E discovered an awful bug from the Oct 9-11 [ck]strncpy() work, namely
- that, under certain circumstances, after a command file or macro was executed,
- top-level commands could no longer be parsed. It seems that the atom buffer
- (atmbuf[]) was the one place where we really did need strncpy()'s property of
- zero-filling to the given length, rather than depositing just one terminating
- NUL as ckstrncpy() does. So changed all ckstrncpy(atmbuf,blah,ATMBL) back
- to strncpy(atmbuf,blah,ATMBL); atmbuf[ATMBL] = NUL. I also make cmini()
- zero the atom buffer in addition to the command buffer (and in the process
- let it use memset() for this rather than a look if USE_MEMCPY is defined --
- a significant speedup now that these buffers are so big). ckucmd.c, 4 Nov 99.
- From Jeff: A fix for the annoying problem of Kermits A->B->C, with A and B
- both having autodownload enabled. Since B has it enabled, it should not also
- pass the packet on to A, so at the moment when it detects it has a valid
- packet, it purposely alters the last few chacters so A will not detect it too.
- ckucns.c, 4 Nov 99.
- From Jeff: preliminary changes to enable Telnet option debugging in command
- mode. ckctel.c, 4 Nov 99.
- From Jeff: Rest of SET TELNET DEBUG, plus propogation of autodownload change
- to ckucon.c, plus casts to stifle complaints from yesterday's changes. Many
- modules, 5 Nov 99.
- From Joel Soete <JSO@EUROPAY.COM>, changes to support "Trusted HP-UX".
- makefile, ckufio.c, 5 Nov 99.
- Propogated autodownload change to ckvcon.c. 5 Nov 99.
- Added another compact substring notation: :(variable[start:length]). This
- differs from s(macro[start:length]) in that the result of expanding the
- variable is NOT looked up in the macro table. So now we have compact
- substring notation for all kinds of variables. ckuus4.c, 5 Nov 99.
- Over the past week, I prototyped an IKSD active-sessions database offline,
- using fopen, fseek, fread, fwrite, ftruncate, and fflush, which we know to be
- highly portable since they've been in C-Kermit 7.0 since the general file i/o
- package was added in Beta.08 back in July.
- A prototype display module was developed as a Kermit script, iksdpy, which is
- what prompted the recent changes to the script language -- hex and IP address
- conversion functions, compact substring notation for extracting database
- fields, etc. Unfortunately, however, fread() doesn't work well for the
- display module. Reading the records sequentially poses no problem (and works
- well), but suppose we want to read the same record repeatedly by fseek()ing
- and fread()ing in a loop. In this case the C library tends not to refresh its
- buffer from the disk so we never see any updates. The only remedy seems to be
- to close and reopen the file each time thru the loop to force a fresh disk
- read. The script does this and it doesn't seem to slow it down much (this is
- done only when focussing on a single session).
- Preliminary documentation for the database is in the new file iksdb.txt, which
- will be merged with iksd.txt shortly.
- Now that the prototype seems to be in good shape, I merged the code into
- C-Kermit:
- . Data and struct definitions: ckcker.h.
- . Selection (IKSDB) and operating parameters: ckcdeb.h.
- . General-purpose routines (lset, rset, long/hex conversion): ckclib.[ch].
- . Database code: ckuusx.c.
- ckuusx.c was chosen for the database code because that was the least bad
- existing module to put it in, from the standpoint of size and appropriateness.
- I didn't want to create a new module since the amount of new code is not that
- large (about 500 lines), and adding a new module is a big pain. With these
- changes, the code compiles and links OK both with IKSDB defined and not
- defined (when it's defined it adds only 8K to the image size). 5 Nov 99.
- I also built with Kerberos IV and OpenSSL (sunos41gcc+krb4+openssl): builds OK
- except for a bunch of warnings from ck_crp.c ("comparison is always 1..."),
- but then it acts very strange when started -- can't parse command files, beeps
- after every top-level keyword (hmmmm -- the same symptoms as the qnx16 build;
- see notes from 23 Oct...) I don't think this has anything to do with IKSDB --
- it smells more like one of those ckstrncpy() things... Nope, that's not it
- (I added code to turn ckstrncpy() back into real strncpy() and rebuilt but it
- made no difference: "touch ckclib.c; make blah KFLAGS=-DNOCKSTRNCPY"). I also
- built again with -DNOIKSDB: same thing, so it's something else. 5 Nov 99.
- Some minor adjustments to top-level command parsing; some of the error
- conditions were not giving error messages promptly. The possibilities are:
- 1. Top-level keyword (cmdtab[])
- 2. Token (!, etc)
- 3. Macro name
- 4. Immediate macro (e.g. "{ echo foo, echo bar }").
- (1) includes the DO command, which can itself take a macro name or an
- immediate macro. Allowing for all this created a situation in which typing
- something invalid as the first word in a command gave no error message (of
- course the error was still caught later). Also "DO { commmand, ... }" seems
- to have been broken somewhere along the line. Fixed in docmd(): ckuusr.c,
- 6 Nov 99.
- Added fradix(number,r1,r2), general-purpose radix conversion between any two
- radices 2-36. Made all the silly "hex2n, n2oct", etc, functions invisible.
- Hurray, finally we have binary numbers, not to mention base 36, etc. Also
- replaced custom code in fhex2n() and foct2n() to just the use general radix
- code. ckuusr.h, ckuus[24].c, 6 Nov 99.
- Back to IKSDB... Added --database:{on,off} and --dbfile:<filename>.
- ckuusr.h, ckuus[5y].c, 6 Nov 99.
- Added dbinit() to initialize database name, my IP address, pid, etc. Changed
- getlocalipaddress() to store not only the string form but also the unsigned
- long form in the new var myxipaddr. ckcnet.c, ckuusx.c, ckcmai.c, 6 Nov 99.
- Added call to dbinit() at startup and a call to freeslot() in doexit().
- ckcmai.c, ckuusx.c, 6 Nov 99.
- Added code to zvpass() to fill in user info. I didn't check the auth stuff.
- ckufio.c, 6 Nov 99.
- Tested with IKSD. Init is good -- PID, IP, peer IP, times, etc. Login as
- real user is good; username is picked up, and then record is freed when user
- logs out or exits. Ditto anonymous.
- Filled in state-change updates simply by calling slotstate() from within
- cksyslog(). ckufio.c, 6 Nov 99.
- Initialized current directory in zvpass() and updated in zchdir(). ckufio.c,
- 6 Nov 99.
- Compiles OK, but it doesn't totally work: the user's initial directory is
- not filled in for some reason. The state changes are not always recorded,
- probably something to do with tying it to syslog.
- From Jeff: OS/2 adaptations and minor corrections to yesterday's work, plus
- more auth changes. ckuath.c ckufio.c ckuusx.c ckuus7.c ckcdeb.h ckcnet.c
- ckclib.c, 7 Nov 99.
- Moved ckxlogging & ckxsyslog definitions from ckufio.c to ckcmai.c.
- Moved dbopen def from ckuusx to ckcmai. Put externs for all these in ckcdeb.h.
- Then I tried to unify syslogging and the IKSD database with:
- #define LOGSACTIVE(a) ((ckxsyslog>=(a)&&ckxlogging)||dbopen)
- and then using:
- if (LOGSACTIVE(SYSLG_PR))
- cksyslog(SYSLG_PR, ...)
- But it was a world of trouble. First of all, it blew up the compiler (gcc
- 2.7.2) on ckcpro.c. In cases where it didn't blow up, I still didn't get the
- required results. So then I removed the macro and added separate calls to
- slotstate() when I wanted to update the database, which actually gives more
- control and therefore better results, at the cost of an extra function call
- (but not always). But now ckcpro.c blows up the compiler again unless I build
- it without -O. Will come back to this... First:
- 1. Moved dbinit() so a record shows up as soon as session starts,
- rather than waiting for login. ckcmai.c.
- 2. Updated state for command mode. ckuus5.c.
- 3. Changed locking method from link() to rename(). ckuusx.c.
- 4. Fixed fractured anonymous username. ckuus7.c.
- 5. In Dir field, prepended anonroot for guest. ckufio.c.
- 6. Made username for anonymous be "anonymous:<passwd>". ckufio.c.
- 7. #ifdef'd ftruncate() and kill() calls away for K95.
- Now it all works pretty well, and should build and run for K95 too, except
- there is no stale-pid detection (this can be fixed if the APIs have an "Is
- this pid active?" call). 7 Nov 99.
- Back to ckcpro.w. We've been having trouble with it for some time -- more and
- more platforms are needing to build it without optimization because -O blows
- it up. I think the problem is that the wart-generated switch() statement has
- become too big. We know there is nothing wrong about having many cases in a
- switch() because in the charset modules we have some with hundreds or
- thousands of cases, whereas the protocol module only has 73. So the touchy
- item seems to be either the amount of code in the largest case, or the total
- amount of code in the switch.
- Experiment 1: Build on watsol, which also has gcc 2.7.2, to see if it's
- something with watsun (swap space filled up or something). Success.
- Experiment 2: Build on watsun with regular cc. Success.
- Well, these are inconclusive, but we know we have problems elsewhere, so:
- Experiment 3: Move the code out of the "received an S packet" case into a
- separate routine and rebuild. gcc still blows up, but cc builds it OK, and
- the result works OK -- that is, it receives files normally.
- Continuing in this vein I moved the eight longest cases to their own routines,
- handled the compilation glitches, added appropriate return values, rebuilt
- with gcc (this time with no complaint), and tested each routine successfully.
- Nevertheless, this was radical surgery and the patient should be watched
- carefully for a few weeks. ckcpro.w, 7 Nov 99.
- Fixed some minor glitches in fradix(). ckuus4.c, 7 Nov 99.
- Built the Kerberized version and tested it OK (the trouble I had last time was
- probably because I didn't move the latest ck_*.[ch] files into the build
- directory). Worked fine, authentication and all. 7 Nov 99.
- Yesterday's code shuffling in ckcpro.w had the nasty side effect that IKSD
- would never issue an interactive login prompt. The problem was that I
- overlooked the QUIT macro, which is used in some of the new routines. QUIT
- can return 0 or 1, whereas RESUME always returns 1. I was using 0 to mean
- "stay in state machine". Now the new routines return -1 for this, and 0 or
- 1 are passed up the call stack. ckcpro.w, 8 Nov 99.
- Gerry Belanger reported some compilation errors revealing that IKSD was
- not disabled if NOLOGIN was defined, so I fixed that in ckcdeb.h, 8 Nov 99.
- Added a missing #endif in ckucon.c, 8 Nov 99.
- Ran the code through gcc with:
- -Wreturn-type -Wcomment -Wformat -Wuninitialized
- -Wpointer-arith -Wredundant-decls
- and removed various redundant declarations & prototypes, etc.
- "-Wwrite-strings" is useless because is produces tens of thousands of
- warnings about "discards 'const' from...". Nothing especially serious was
- found, except one printf referencing a long with "%d" and a couple "returns
- without a value", which is what I was looking for. Pretty much all modules
- were changed. 8 Nov 99.
- Added zchkpid() to ckufio.c, and changed all references to "kill(xxx,0);" in
- non UNIX-specific modules to zchkpid(). (This needs to be filled in for K95
- and VMS.) ckcplm.txt, ckcdeb.h, ckufio.c, 8 Nov 99.
- As an experiment, I removed the "pop back to command mode after each protocol
- operation" feature from IKSD by #ifdef'ing out the "justone = 1;" commands in
- ckcmai.c (search for IKSDPOPBACK). This seems to do absolutely no harm, and
- we no longer get the jarring state changes every time we do something (which
- are obvious now in IKSDPY); client/server mode stays put, but CONNECT from the
- client always forces IKSD back into command mode, and SERVER at the IKSD
- prompt still puts it in server mode and makes the client pop back. FINISH
- works right, BYE works right, etc. 8 Nov 99.
- Spiffed up IKSDPY a bit; gave it consistent commands in each screen and
- a unified "command parser" and help screen rather than 2 different ones.
- 8 Nov 99.
- Revisiting the question of the LOGIN and LOGOUT commands from 20 Aug 98...
- Presently LOGIN is not a command. LOGOUT is a command, but acts only locally;
- that is, it works only when given at the IKSD prompt. To log in and out from
- the client requires REMOTE LOGIN and REMOTE LOGOUT. Why can't these be just
- LOGIN and LOGOUT? Let's see...
- Client Server
- LOGIN Sends REMOTE LOGIN to server Says "?Already logged in"
- LOGOUT Sends REMOTE LOGOUT to client Logs out (as now).
- Made it so. Seems fine. If these commands are given to the client when it
- has no connection, an error message is printed and the command fails.
- Otherwise it acts as shown above. Why didn't I like it before? Probably
- because I thought that LOGIN could be given at the IKSD prompt to actually
- log in. But it can't, so good, another wart removed. ckuusr.c, 8 Nov 99.
- Updated & incorporated iksdb.txt into iksd.txt. 8 Nov 99.
- From Jeff:
- . SRP encryption key generation was broken.
- . Infinite loop in ckuusx.c in K95 only.
- . Extra ENCRYPT messages when encryption can't possibly be used.
- . NTLM AUTH not working on Win2K.
- . IKSD now compatible with Win2K.
- ckuusx.c ckctel.c ckuath.c ck_crp.c, 9 Nov 99.
- Changed wart to never output lines with trailing blanks. ckwart.c, 9 Nov 99.
- Fixed long lines & trailing blanks in all source files. 9 Nov 99.
- Shuffled a couple return()s and #ifdefs in the new routines in the protocol
- module to stifle "statement not reached" warnings. ckcpro.w, 9 Nov 99.
- Added -DNOGETUSERSHELL and -DNOSYSLOG to the Unixware 1.x and 2.0 entries.
- makefile, 9 Nov 99.
- Discovered the DATE command was truncating the last character of the result.
- Another ckstrncpy() foulup (subtle difference in the meaning of the 3rd arg:
- the number of bytes to copy to strncpy, but to ckstrncpy it's the size of the
- buffer, which must be NUL-terminated; thus changing strncpy(dest,date,17)
- (which copies a 17-byte date string) to ckstrncpy(dest,date,17) won't work
- since the latter will chop off the last byte and replace it with a NUL,
- thinking the dest buffer is only 17 bytes long. ckuus6.c, 9 Nov 99.
- A long time ago, before chained FDBs, code was added to allow the SLEEP (WAIT,
- INPUT, etc) time interval to be either a number of seconds or else a time of
- day (like MS-DOS Kermit), using a gross hack. I changed this code -- at least
- in dopaus() (the routine that handles SLEEP/PAUSE, MSLEEP, and WAIT) -- to use
- chained FDBs instead. ckuus6.c, 9 Nov 99.
- Now to the point of all this: I extended the WAIT command to wait for file
- events:
- WAIT <time> { MODEM-SIGNALS <signal-list>, FILE <event> <filename> }
- The previous syntax is still accepted and works the same way; however, the
- modem-signal names are now invisible in the keyword list shown by ? after
- the time field; instead you see the two new keywords above (but you can
- still put a modem signal name in this field). If you choose FILE, then
- you can choose an event: CREATION, DELETION, or MODIFICATION, and then the
- filename and then Kermit waits up to the timeout for the given event to occur
- with the given file and succeeds or fails accordingly. ckuus6.c, 9 Nov 99.
- Fixed radix() (and therefore function()s that call it, such as fhex2n()) to
- use unsigned long internally, so args with high bit on won't go negative.
- ckuus4.c, 10 Nov 99.
- Fixed trailing blanks and long lines in ckuat*.[ch] and ck_*.[ch]. 10 Nov 99.
- Compact substring notation was not being careful enough about exceeding
- boundaries. Fixed in zzstring(), ckuus4.c, 10 Nov 99.
- Added a little robustness to iksdpy, checking that each record is exactly 4096
- bytes long. Before the previous fix this would cause Kermit to crash; now
- this check should not be necessary except to allow a more appropriate recovery
- (i.e. quit with a message that the database is corrupt). Also added clauses
- from Jeff to pick up the database in Windows. iksdpy, 10 Nov 99.
- Added a prototype for ttyname() in the Sys V/68 R3V6 case. ckutio.c, 10 Nov 99.
- Removed some dangling return()'s from the new routines in ckcpro.w, again
- (the same ones I removed yesterday, but somehow the changes were lost).
- ckcpro.w, 10 Nov 99.
- Took 'extern int inserver' declaration out of #ifdef IKSD..#endif in ckcfns.c,
- since this variable should be available in all builds, but with a value of 0
- when IKSD is not available (and therefore not active). ckcfns.c, 10 Nov 99.
- Similarly for the 'network' definition in ckuusr.c. 10 Nov 99.
- Changed IKSD database-opening code to use "r+b" rather than "r+" in K95 and
- VMS. ckuusx.c, 10 Nov 99.
- More work on Unixware 1.x-2.0 makefile entries. Removed the UNIXWARE
- definition and reverted to vanilla SVR4, but with OLD_UNIXWARE defined just
- for herald purposes. This fixes the problem with close() of serial device
- hanging. makefile, 10 Nov 99.
- On SunOS: Built OK with NOIKSD. Built with NOSPL; this required some
- corrections to ckuus4.c and ckclib.c (NOSPL removes 300K from Sparc binary).
- Built with NONET OK.
- On HP-UX 10.20: Built with non-ANSI compiler OK. 10 Nov 99.
- On VMS 7.1: Built OK with DECC after supplying a missing exter for ksbuf[].
- ckvcon.c, 10 Nov 99.
- On SunOS: Built with NOICP (fixes needed to ckuus4.c) but lots of unresolved
- references show up at link time but the stupid linker doesn't show which
- modules the references occurred in. Built again on VMS with NOICP to get
- better diagnostics. Results:
- . Moved prototypes for doconect() and setflow() from ckuusr.h to ckcker.h.
- . Adjusted #ifdefs in ckvcon.c and ckuusx.c.
- . #ifdef'd slrestor() references NOICP in ckcnet.c.
- . Moved 'hints' declaration to ckcmai.c.
- It still didn't work but the remaining problems were all VMS-specific and
- we'll never really build a NOICP for VMS (or if we do they're easily fixed).
- Back to SunOS... After a more shuffling, which is too boring to describe,
- the NOICP version built again. The full version is 1.8MB on Sparc; the
- NOICP version is 0.5MB. 10 Nov 99.
- Added -lresolv to unixwarenetc target. makefile, 11 Nov 99.
- Fixed trailing blanks & long lines in ckuath.c. Gave up on ck_crp.c.
- 11 Nov 99.
- Fixed ckradix() (again) to ignore leading 0's (and whitespace) for overflow
- detection purposes (another previous fix that was lost). Also moved ckradix()
- to ckclib.c. ckuus4.c, ckclib.[ch], 11 Nov 99.
- A couple corrections to the ISO-8859-7 / Unicode mappings from updated
- official UCS maps at unicode.org. ckcuni.c, 11 Nov 99.
- Added definitions, parsing, tables, and routines for KOI8-R and KOI8-U
- character sets, ckcuni.[ch], ckuxla.[ch], 11 Nov 99.
- Fixed xls[] and xlr[] charset-conversion function-pointer tables from
- yesterday's (and earlier) changes (one problem went all the way back to July
- 1998). ckuxla.c, 12 Nov 99.
- Fixed fcsinfo[] table -- it too has skewed (during the Japanese changes of
- a few weeks ago). ckuxla.c, 12 Nov 99.
- While tracking down yesterday's problems, I discovered that something was
- amiss with any character-set translation involving Unicode. When translating
- from anything to (say) UTF-8, the non-ASCII characters were translated to
- simple, seemingly random, ASCII characters instead of to UTF-8 sequences.
- Somehow a temporary variable in xgnbyte() that had been a USHORT had become a
- CHAR, thus discarding the high byte of the UCS-2 result (you can't turn your
- back for a minute...) So now translations *to* Unicode work again. (This
- affected all translations, including file transfer.) ckcfns.c, 13 Nov 99.
- But in the TRANSLATE command, translations *from* Unicode always gave a result
- in UCS-2 intstead of the target set. Why? Because setxlatype() was setting
- up the translation from the source set to UCS-2, period. In all the testing
- of the new Japanese/Unicode interface, I must have overlooked the others.
- What was needed for TRANSLATE was a special routine to set up translation from
- any file character-set to any other file character-set with UCS-2 in the
- middle. This seems to work well and it's a big improvement over the previous
- arrangement, in which the "most appropriate" transfer character-set was picked
- as the intermediate set, which resulted in loss when the source and
- destination sets had characters in common that were lacking from the TCS (this
- is especially noticeable with KOI8-R and -U, which are full of line-and-box
- drawing characters that are not in ISO 8859-5). Several dozen tests with
- random pairs of charsets, including Japanese, check out fine, and file
- transfers seem fine too, as they should be after the previous fix. So I
- changed TRANSLATE to always go through Unicode as long as Unicode support is
- built in. ckuxla.c, ckuus4.c, ckermit2.txt, 13 Nov 99.
- Made KOI8-R and KOI8-U tables for ~kermit/charsets/. koi8[ru].{c,txt},
- 13 Nov 99.
- From Jeff: "Was this one hard to pin down. (All the encryption bugs are.)
- Noticed Sunday night that encryption was breaking with SRP on yclept but not
- on other platforms. Tracked this down to a change in the headers in the newer
- SRP distributions. The old headers were installed in /usr/local/include and
- were being read by Kermit instead of the newer ones in
- /usr/src/srp/srp..../include/. Fixed. While trying to find the above problem
- I discovered that encryption didn't work at all with any authentication method
- if there the connection was made with SET HOST *. This bug was caused by two
- things. First, a couple of 'inserver' tests were instead 'sstelnet' which
- meant we were encrypting/decrypting when we shouldn't have been. Second, at
- some point the ckcgetc() functions were modified to make calls to ttxin().
- But the data returned from ttxin() was never decrypted. So the state machine
- on incoming data was corrupted." ckucon.c ckucns.c ckutio.c ck_crp.c
- ckuath.c, 14 Nov 99.
- Changed setting of local and peer IP addresses (the ones used for reporting
- and in the IKSD log) to use network format (htonl()). ckcnet.c, 14 Nov 99.
- Tested KOI8-R and KOI8-U terminal charsets in new build of K95 GUI -- both
- work fine. 14 Nov 99.
- Some syntax improvements for the FOR command:
- . Allow parens around the condition list for consistency with IF and WHILE.
- . If parens included allow increment to be omitted & default appropriately.
- . If command list lacks enclosing braces, supply them.
- Allow parens around SWITCH variable too. Aside from improving consistency and
- robustness, these changes pave the way for future extensions, like
- "for ( %i in ck*.[ch] ) ..." (but exercising massive self-control, I deferred
- implementation of that til after 7.0). ckuus6.c, ckermit2.txt, 14 Nov 99.
- In preparation for wrapping up Beta.11, did a bunch of builds with various
- -DNOxxxx's defined, on various platforms. NOCYRILLIC (ok), NOAPC (ok),
- NOBIGBUF (ok)... The latter only makes about 12K difference; hardly worth it
- any more in these days 2-3MB executables... (but yes, it's still needed at
- least for the PDP-11).
- NOLOCAL (ok) -- this took a fair amount of #ifdef shuffling, plus I managed
- to cut out a lot of additional stuff (e.g. all the file-transfer display
- code), reducing the executable size (on Sparc) by 400K. This one is handy
- for building IKSD. [Note: at the moment NOLOCAL also renders the SCREEN
- command useless, but I'll worry about that if anyone complains.]
- Also:
- . NOXFER (ok) -- This one also took a lot of shuffling. Saves 420K.
- . NODISPLAY (ok) -- New; this one disables the file-transfer display.
- . NOSHOW (ok)
- . NOSERVER (ok) -- This one was a big deal.
- . NOREDIRECT (ok)
- . NOPUSH (ok)
- . NOPIPESEND (ok)
- . NOMSEND (ok)
- . NOLOGIN (ok)
- . NOIKSD (ok)
- . NOHELP (ok)
- . NODIAL (ok)
- . MINIDIAL (ok)
- . NOUNICODE (ok)
- . NOCSETS (ok)
- . NOSPL (ok) <-- Builds OK but has the beeping bug (*)
- . NOICP (ok)
- Also built on some other platforms:
- . HP-UX 10.20 non-ANSI (ok)
- . HP-UX 10.20 ANSI (ok) (optimizer complains about ckuus[r34].c, ckcpro.c)
- . HP-UX 9.05 non-ANSI (ok)
- . HP-UX 9.05 ANSI (ok) (optimizer complans about various files)
- . HP-UX 8.00 non-ANSI (ok)
- . Linux RH 5.2 gcc 2.7.2.3 (ok)
- . VMS 5.5/VAX VAXC 3.2 UCX (ok) and NONET (??)
- . VMS 7.1/Alpha DECC 6.0 UCX (ok) and NONET (ok)
- . AIX 4.1 (ok)
- . Digital UNIX 3.2 (ok) (DU has 8-byte longs)
- . BSDI 4.0.1 (ok) (Updated makefile target for tputs() complaints)
- . Unixware 7 (ok)
- . Unixware 2.1 ("libelf error: Request error: no string table elf_strptr"???)
- Many modules touched in many ways, some of them a lot. 14 Nov 99.
- Tracked down the beeping problem first noted on Oct 23rd: when built with
- NOSPL, there was a putchar(' 7') in docmd() that was not inside any 'if'
- clause, and therefore was always executed. ckuus5.c, 15 Nov 99.
- Added the following new CHECK items: FILE-TRANSFER, MAKING-CONNECTIONS,
- UNICODE, IKSD, CX-LOG. ckuus3.c, 15 Nov 99.
- Fixed a trailing non-comment after an #endif, ckcfns.c, 15 Nov 99.
- Replaced a lost comment-end after an #endif, ckcuni.h, 15 Nov 99.
- Fixed a bad mistake I made yesterday, when shuffling declarations around for
- NOXFER: I put the extern declaration for feol among the ints, when it should
- have been a CHAR. This completely messed up end-of-line processing during
- file i/o. ckcfns.c, 15 Nov 99.
- Checking out Dave Sneddon's renewed complaint about C-Kermit swallowing or
- mangling escape sequences while in CONNECT mode, which I thought I fixed a
- couple weeks ago. Detailed analysis of the traffic shows VMS sends:
- <ESC>[c<ESC>7<ESC>[255;255H<ESC>[6n<ESC>8<ESC>[62"p<ESC> F<ESC><RB>
- (where <ESC> is Escape and <RB> is right angle bracket).
- The CONNECT module passes <ESC>[c through OK to the terminal, and the terminal
- sends back the right response: <ESC>[?63;1;2;6;8;9;15;44c. But when C-Kermit
- goes to read the next character from the host, it is '7' -- so it missed the
- escape between the 'c' and the '7'. And in fact, the logs show several other
- escapes were missed too. Let's compare with the UNIX version... Hmmm, no
- problem there. Next, compare VMS version with TERM APC OFF (which works) with
- same version with TERM APC ON (which doesn't). Difference: chkaes() is never
- called if APC is OFF so the problem is obviously in chkaes(). It turned out
- to be a misplaced #ifdef XPRINT in one of the switch cases (which dates from
- when I added transparent printing a year ago), the one that handles escape
- sequences like <ESC>7. The state-changing statement was inside #ifdef XPRINT,
- but XPRINT is not defined in VMS, so the state remained unchanged and the code
- to write out the saved-up Escape was never executed. The same #ifdef was
- misplaced in the UNIX version, but it didn't matter there since XPRINT is
- defined in UNIX. ckvcon.c, ckucns.c, 15 Nov 99.
- A new set of consistent HP-UX 10.xx and 11.xx makefile targets from Peter E,
- which now include regular and Trusted versions for each variation. makefile,
- 16 Nov 99.
- From Jeff: Beginnings of PTY support. ckutio.c ckuus7.c ckcdeb.h ckucon.c
- ckuus4.c ckucns.c ckuusr.c ckuusr.h, 16 Nov 99.
- Added top-level PTY command (not tested), similar to PIPE. Created PTYORPIPE
- macro, which is defined if either NETCMD or NETPTY (or both) are defined.
- ckcdeb.h, ckucns.c, ckuus[r7].c, 16 Nov 99.
- Realized that it would be useful to know what character the user might have
- typed to interrupt a PAUSE, WAIT, INPUT, or similar command from the keyboard,
- so added a new variable v(kbchar) for this. It is set by any command that
- times out and can be interrupted from the keyboard. If it was interrupted,
- this variable is set to the (first) character the user typed. If it was not
- interrupted, it is set to the empty string (thus "sleep 0" can reset it).
- v(kbchar) can be used in applications that need to wait for some event OR a
- keystroke, whichever comes first. For example, iksdpy, which would rather not
- mindlessly refresh the screen if the database hasn't changed and the user
- hasn't touched a key. Now instead of being driven by getc and timeout, it's
- driven by WAIT 60 FILE MOD <databasefile> -- if user presses a key, it's in
- the variable and it's our command. ckuusr.h, ckuus[46].c, 16 Nov 99.
- From Jeff: the new pty modules, ckupty.[ch], plus fixes to Telnet debugging
- and BREAK-sending. ckctel.c, ckcnet.c, 17 Nov 99.
- Added ckupty.c production to the xermit target. makefile, 17 Nov 99.
- Converted ckupty.[ch] to Kermit coding conventions (there were still some
- #if's and preprocessor logical ops, unguarded ANSIisms, etc); cleaned up
- formatting, added copyright & author notices, removed unused HAVE_blah
- definitions. Got it to build OK on SunOS with the non-ANSI compiler, and it
- works too. 17 Nov 99.
- On to Solaris... This one was hopeless. But then I realized that all the
- problems were in the utmp/wtmp code. But we don't need that code. So I
- #ifdef'd it out and poof, it builds and works on Solaris, and still builds
- and works on SunOS. ckupty.[ch], 17 Nov 99.
- On to HP-UX. After more twiddling of #ifdefs, got it to compile with no
- complaints, but at runtime it says:
- ?Unable to open slave
- ?Slave failed to initialize
- debug log says:
- ttopen PTY[telnet watsun]
- do_pty() Xline[/dev/ptyp3]
- do_pty()[Slave starts]
- getptyslave()
- pty_open_slave()[pty_open_ctty() failed]=44806916 = PTY_OPEN_SLAVE_OPENFAIL
- getptyslave()[Unable to open slave]=44806916
- do_pty()[Slave fails to initialize]
- set host line, errno[]=2
- In other words, there is "No such device or directory" as /dev/ptyp3. But:
- bash-2.00$ ls -l /dev/ptyp3
- crw-rw-rw- 2 root root 16 0x000003 Jun 10 1996 /dev/ptyp3
- The errno=2 indication is a red herring. I changed the code to print a
- better message, now it says:
- /dev/ptyp3: Device busy
- Why it's busy, I don't know. Also we don't want to put words like "slave" in
- user messages -- they are upsetting to some people. Also there is no need for
- the "?Slave failed to initialize" message if we already just printed a more
- informative message; fixed all this in ckupty.c, 17 Nov 99.
- From Jeff: Additional debugging in pty code, add pty modules to other Unix
- build targets. makefile, ckutio.c, ckupty.c, 18 Nov 99.
- Fixed PTY command to actually use ptys, not pipes. ckuusr.c, 18 Nov 99.
- Built with pty support on Unixware 7.1.0 and BSDI. makefile, ckcdeb.h,
- 18 Nov 99.
- Added KTARGET clauses to all UNIX targets except those in the Antiquities
- section. makefile, 18 Nov 99.
- Problem: "remote host blah" crashes the client if "blah" is longer than 84
- bytes. This problem exposed many mistakes, each of which needed fixing.
- First, conol() was being called with a NULL pointer. It should defend against
- this. Second, the caller was not setting an error string it should have set.
- Third, the caller of the caller was not checking to see if the string was set.
- All this fixed in ckcpro.w, ckcfn2.c, ckutio.c, 18 Nov 99.
- But why should the limit be 84 when we had just negotiated 4000? Because...
- we call tinit() after the I/Y exchange and it resets the packet length we just
- negotiated, tsk tsk... This is another long-standing problem: tinit() is
- overloaded -- it was originally intended to be called before a transaction
- starts, i.e. before the S/I/Y exchange, but then we started calling it just
- after as well, because of the unfortunately fuzzy definition of "transaction"
- in the protocol. So I changed tinit() to take an argument: 1 to reset
- EVERYTHING, 0 to reset only those things that are not set in the negotiations.
- Now you can send long REMOTE HOST commands. ckcpro.w, ckcker.h, 18 Nov 99.
- Problem: Typing "mail" by itself causes a core dump. Cause: a pair of
- statements was out of order in doxsend(). Fixed in ckuusr.c, 18 Nov 99.
- Built on IRIX 6.5 -- pty code compiles OK but doesn't work:
- /dev/ttyp5: No such file or directory... 18 Nov 99.
- Added code to ttinc(): if the read fails, and we were reading from a pty,
- call ttclos(). But it didn't prevent the annoying "A connection seems to
- be open... OK to close?" message, since the upper level code doesn't know
- the connection was closed except by calling ttchk(), and ttchk() was not
- doing the right thing. ttchk() was being called to "test the connection",
- but it was testing ttyfd only if xlocal != 0, which is silly -- xlocal
- might have been reset by ttclos(), but if ttyfd == -1, we can definitely
- say we do not have an active connection, no matter what the value of
- xlocal! ckutio.c, 18 Nov 99.
- Pty changes, plus more debugging, from Jeff for HP-UX. ckupty.c, ckutio.c,
- 19 Nov 99.
- Built on FreeBSD 3.3. Ptys work OK. But with or without them, it dumps core
- when trying to initialize curses. Tried building it with ncurses rather than
- curses; that fixed it. Also discovered it did not have BIGBUFOK set, so set
- it. makefile, ckcdeb.h, 19 Nov 99.
- Tried building on FreeBSD 2.2.7. Hmmm, same thing -- it dumps core in
- fxdinit(). Why and when did this start happening??? Converted the freebsd2
- target to ncurses too. Works fine -- curses, ptys, everything. Also, added
- -funsigned-char to FreeBSD entries, since cc is gcc there.
- Dave Sneddon's bug, cont'd... zkermini() was lopping off the final character
- of the init file name obtained from the CKERMIT_INI logical, thanks to global
- substitution of cknstrncpy() for strncpy(). In this case, the length of the
- source string was specified, rather than the length of the buffer. Fixed in
- zkermini(), ckvfio.c, 19 Nov 99.
- Fixes from Jeff for ptys on HP-UX 10 and also to add IRIX 6.x to the list of
- pty-cabable builds: ckcdeb.h, ckupty.c, ckucns.c. 22 Nov 99.
- Tried building on DU 4.0E and 3.2 -- both OK, ptys work fine; added to list.
- ckcdeb.h, 22 Nov 99.
- Tried building on HP-UX 9.05. Compiles and links OK, but doesn't work. Once
- a connection is make (as in "pty telnet localhost") the program seems to hang;
- no chars appear on the screen, and you can't escape back. Tried building on
- HP-UX 8.00. Compiles OK but doesn't link: _vhangup and _ptsname unresolved.
- Changed ckupty.c to not define CK_VHANGUP for HPUX8; then it compiles OK, but
- hangs when run, just like HP-UX 9.05. Rebuilt on HP-UX 9.05 without the
- ioctl() trap that Jeff added for HP-UX 10. No change, except now it actually
- reads "Connection closed by foreign host." from the pty but remains totally
- impervious to keystrokes. Juggled #ifdefs to include ptys only for HP-UX
- 10.00 and above. ckcdeb.h, ckupty.c
- Tred building on SINIX 5.42. Compiles and links OK but:
- ttopen PTY[telnet 128.59.39.2]
- do_pty()[pty_getpty() fails]=44806914
- set host line, errno[]=2
- Since there was a /dev/ptmx, I tried defining HAVE_STREAMS; this was an
- improvement; now we get:
- ttopen PTY[telnet 128.59.39.2]
- pty_getpty()[open(/dev/ptmx) success]
- pty_getpty() ttyname()[(NULL)]
- pty_getpty() slavebuf[/dev/ttyp4]
- do_pty() Xline[/dev/ttyp4]
- do_pty()[Slave starts]
- getptyslave()
- ptyint_void_association()[setsid()]
- ptyint_void_association()[open("/dev/tty", O_RDWR)]=-1
- pty_open_ctty() slave[/dev/ttyp4]
- ptyint_void_association()[setsid()]
- ptyint_void_association()[open("/dev/tty", O_RDWR)]=-1
- pty_open_ctty() open failure[/dev/ttyp4]=2
- pty_open_slave()[pty_open_ctty() failed]=44806916
- getptyslave()[Unable to open slave]=44806916
- do_pty()[getptyslave() fails - exiting]
- do_pty()[Slave fails to initialize]
- set host line, errno[]=22 <-- "Invalid Argument"
- The user sees:
- /dev/ttyp4: No such file or directory
- Added #define HAVE_STREAMS for SINIX to ckupty.h, but won't define NETPTY
- for it unless we figure out how to make it work. 22 Nov 99.
- Built for DG/UX 5.4 -- ptys work ok, added DG/UX to the pty list.
- ckcdeb.h, 22 Nov 99.
- Futzed with "show features" paging. ckuus5.c, 22 Nov 99.
- Installed missing pieces of developer tools on local DU 4.0E system. Added a
- cast to an arg of bzero() to shut up DECC. With that, latest code builds
- without complaint, and ptys work fine. ckcnet.c, 22 Nov 99.
- Changes from Jeff for HAVE_STREAMS; now it works on SINIX. ckcpty.c, etc;
- 23 Nov 99.
- Consolidated {Free,Net,Open}BSD pty support under BSD44. ckcdeb.h, 23 Nov 99.
- Fixed ttopen() to set "ttnmsv" (saved ttname) for ptys too; otherwise, it
- when proto() calls ttopen(), it closes the connection. ckutio.c, 23 Nov 99.
- Checked file transfer over pty connections:
- . ssh connections work fine with default FAST settings, streaming, reliable
- ON, etc, but SET PREFIXING ALL is needed because bare control characters
- can make trouble on PTYs -- tab expansion, CR->CRLF, who knows what else.
- 8-bit files are sent OK too. Obviously the transfer rate isn't great.
- . Same deal for rsh / rlogin.
- . For telnet, "set parity space" is also needed to transfer 8-bit data. But
- the transfer rate is about 10 times faster. Obviously SET PREFIXING ALL
- is needed here too for the Telnet escape character and probably also the
- interrupt character, etc.
- Nothing special needs to be done about tilde on ssh/rsh connections since it
- is significant only at the "beginning of a line", and this never happens with
- Kermit packets.
- Changed SET NETWORK TYPE COMMAND to SET NETWORK TYPE PIPE (but kept COMMAND
- as an invisible keyword). Ditto for switches, etc. Because now we run
- commands on ptys too. ckuus[r47].c, 23 Nov 99.
- Built on NetBSD 1.4.1. Dumps core in fxdinit(), just like FreeBSD did before
- I switched it to ncurses. Rather than just switch to ncurses again this time,
- let's find out what's wrong... (Important because ncurses is an optional
- item, so many people won't have it.)
- First, installed NetBSD Project patches from Herbert Peyerl -- BIGBUFOK,
- assorted casts, plus support for 7200 bps serial speed which I seem to have
- overlooked. ckcdeb.h, ckuusx, 24 Nov 99.
- Back to fxdinit() in BSD44... The man page for tgetent() says you have to
- #include <termcap.h>. That didn't help. OK, it also said you had to declare
- some variables, like "char *UP, *BC, ..." but that only gave syntax errors.
- Tried linking with -ltermcap instead of -ltermlib. Shuffling order of libs
- made no difference. Tried linking with only -lcurses and neither -ltermcap
- nor -ltermlib. Links OK but still crashes. Tried casting 2nd tgetent() arg
- to (const char *) like it says in <termcap.h>. Still crashes. Tried using a
- static, rather than malloc'd tgetent buffer (16K!); it still crashes. But a
- newly-built 6.0 still works fine, and it calls the tgetent() exactly the same
- way. What's the difference?
- EVENTUALLY... I found it: tgetent() internally calls cgetent(), which in
- turn calls dbopen(), which turns out to be "the library interface to database
- files". But dbopon is also the name of a new variable in Kermit, an int flag
- meaning the IKSD database is open. Unfortunately it is referenced in about
- 1000 places... I changed them all to "ikdbopen" and poof, all better. Many
- files, 24 Nov 99.
- While on NetBSD, checked UUCP lockfile conventions against cu: OK. Tried
- dialing (with a Multitech modem) -- didn't work at all. Why? The modem
- responses seem to end with <LF> only, rather than <CRLF>. Added code to
- dook() to allow for this and dialing works again. But why did it break in the
- first place? If I CONNECT with SET TERM DEBUG ON, I see CRLFs, so it's not
- the modem's fault. Should I worry about this? The debug log shows ttpkt() is
- being called normally and succeeding, so I wonder why DIAL is not seeing the
- CR's... Instead, it looks like each CR is being converted to a LF, so
- responses look like "OK<LF><LF>". ckudia.c, 24 Nov 99.
- Back to FreeBSD... Built it with regular curses, now it's fine of course.
- Tried dialing out, that's fine too -- unlike NetBSD, it sees the CRLFs, so the
- previous trouble must have been NetBSD-specific. Checked uucp lockfile
- against cu; it's OK. Access to lockfile & port are thru the dialer group.
- 24 Nov 99.
- Added support for uu_lock() for FreeBSD 3.0 and later. This is almost just
- like AIX ttylock(), but with different names and return values. It's the
- preferred method of line locking on FreeBSD 2.2.2 and later (but no point
- making a new makefile entry to differentiate 2.0 from 2.2.2, so it's only in
- the 3.0 target -- anyway, the effect is the same either way). ckcdeb.h,
- ckutio.c, makefile, 24 Nov 99.
- Fixes to HTTP PUT from Jeff: ckcnet.c, 24 Nov 99.
- Changed TRANSMIT /COMMAND to XMIT /PIPE (and left /COMMAND invisible). Added
- TRANSMIT /NOWAIT, which means don't wait for a "prompt" after each line in
- text mode. ckuusr.c, 24 Nov 99.
- Testing TRANSMIT... Various failures were not producing error messages.
- Certain successes were not setting SUCCESS. Also, now that the default file
- type is binary, TRANSMIT does not work as expected -- changed TRANSMIT to use
- text mode by default, no matter what the FILE TYPE is; therefore TRANSMIT
- /BINARY *must* be used to transmit in binary mode, which is, after all, a
- rather odd thing to do. ckuus[r4].c, ckermit2.txt, 24 Nov 99.
- Corrected some type mismatches in the IKSD database code. ckuusx.c,
- ckufio.c, 26 Nov 99.
- For QNX ptys, added #include <fcntl.h> and #define O_NDELAY O_NONBLOCK, etc,
- to make it compile OK, but it fails to initialize the pty at runtime.
- ckupty.[ch], 26 Nov 99.
- Added prototypes for ttyname() for HPUX 6 and 7. ckutio.c, 26 Nov 99.
- Eliminated a spurious error message from fsplit() when it was asked to
- fill an array with more words than the array could hold. ckuus4.c, 26 Nov 99.
- Fix from Lucas Hart for UNIX nzltor(), in which the last period is kept only
- if it is in a filename, not in a directory path segment, since VMS doesn't
- allow dots in directory names. ckufio.c, 26 Nov 99.
- SSL/TLS stuff from Jeff, mostly more separation of this from other modules.
- ck_ssl.c ck_ssl.h ckuath.c ckuus3.c ckuus7.c ckuusr.h, 27 Nov 99.
- The change to ttchk() on November 18th broke remote-mode file transfer on QNX.
- Fixed, again. ckutio.c, 27 Nov 99.
- Noticed that CKMAXOPEN was -2 on QNX. There is no definition for this in the
- header files; wrote a little test program and found I could open 390 files
- at once; changed ckcdeb.h accordingly. 27 Nov 99.
- Fixes from Jeff for QNX ptys. It all works except for noticing when the
- pty process terminates. ckupty.c, 27 Nov 99.
- Added QNX to pty list. ckcdeb.h, 27 Nov 99.
- Added pseudoterminal control to the list of major features included or not
- in SHOW FEATURES. ckuus5.c, 27 Nov 99.
- Tested Pty feature on SCO OSR5.0.5 -- it's ok. Added it to the list.
- ckcdeb.h, 27 Nov 99.
- Tried building with ptys on SCO 3.2v4.2, but compilation dies with a syntax
- error in <memory.h>. Not worth pursuing. Added prototype for ttyname().
- ckutio.c, 27 Nov 99.
- Moved the code to get the name of the controlling terminal in UNIX from
- ttopen() to sysinit(), since we only need to get it once, and generalized the
- test for local mode in ttopen() to include both the hardwired name (/dev/tty)
- and the actual name (such as /dev/ttyp5), and made the name available in a
- global string buffer, cttnam[], in case it's useful in the pty routines.
- ckutio.c, 27 Nov 99.
- Added a new variable v(ctty) to show the name of the controlling terminal,
- which is simply the contents of cttnam[]. For UNIX and VMS. For the others
- it's just CTTNAM (e.g. "CON", "@output", etc). ckuusr.h, ckcdeb.h, ckuus4.c,
- ck[uv]tio.c, 27 Nov 99.
- Changed QNX pty code to use cttnam[] instead of "/dev/tty" and removed
- NO_DEVTTY definition. Works OK, ptyint_void_association() opens controlling
- terminal, all is OK. But it doesn't make any difference in close detection.
- After logging out from a "pty telnet 0" connection, it reads Telnet's
- "Connection closed by foreign host" message, but select() never notices that
- the pty process died. There must be some special API as in HPUX, but our QNX
- host doesn't have any man pages and none of my QNX manuals says a word about
- pseudoterminals, nor does the QNX website have any technical info. I suppose
- we could check just before select() if the slave pid was still alive but (a)
- that could be pretty expensive, and (b) I'm not sure what to do if it isn't --
- some cleanup code in ckupty.c probably needs to run.
- Changed connection log to replace any spaces in the phone number with
- underscores. ckudia.c, 27 Nov 99.
- Fixed misinterpretation of CARRIER message from Rockwell modems as equivalent
- to CONNECT. This one was lost since last May, oops. ckudia.c, 27 Nov 99.
- Somebody pointed out a while back that "?Not valid in this position" was not
- a very good error message for "type blah", where "blah" was the name of a
- nonexistent or inaccessible file. A byproduct of chained FDBs. The problem
- is that the message is not issued until after we go through all of the FDBs
- and none of them succeeds. By that time, the real cause for any error is long
- gone. But at least we can construct a better message like "?Does not match
- switch or filename", so I made this change in cmfdb(): ckucmd.c, 27 Nov 99.
- There was an odd case not caught by the command-file reader. If command
- file's final line was a closing brace (e.g. of a loop or block) but lacked a
- terminator, the block would not be completed or executed. Fixed in getnct():
- ckuus5.c, 27 Nov 99.
- The MANUAL command was not restoring the console terminal modes before
- escaping to the system; thus in VMS (for example) keystrokes didn't echo.
- Fixed in docmd(): ckuusr.c, 27 Nov 99.
- Went to check out a complaint about UUCP lockfiles on Digital UNIX, but UUCP
- wasn't installed, so I installed it. Couldn't figure out how to use cu (it
- would just exit immediately with no message), but the man pages weren't
- installed either. Installed the man pages and read them. Configured a
- "direct" serial device by running uucpsetup -- nothing works unless you do
- this first; the original serial devices are useless. Made a connection with
- cu and then checked the lockfile. Everything is fine: location
- (/usr/spool/Locks), name (LCK..ttyxx), and contents (4-byte binary int PID).
- But I added -DNOCOTFMC since the original person said it was necessary to keep
- SET LINE from hanging -- I tested it here and it's fine (but it was also fine
- before). ckutio.c, 27 Nov 99.
- Added a short HTTP section (2.15) to ckermit2.txt, 27 Nov 99.
- From Jeff... ckuusr.c: Fixes the LOGIN/LOGOUT problem on VMS. This code
- should not have been #define CK_LOGIN (since it's for the client). ckupty.c:
- More changes for QNX. Still can't determine when the slave is invalid. I am
- concerned that write()ing to the pty after the slave is closed does not report
- an error. That leaves me with the impression that the device is still open.
- ckcmai.c ckcnet.c ck_ssl.c ck_ssl.h: More removal of SSL code from the main
- code. ckuus3.c: Modifications to getyesno() to support K95. 28 Nov 99.
- Checked new stuff on VMS: v(ctty) OK, LOGIN/OUT fixes OK. TTY modes around
- MANUAL command OK. 28 Nov 99.
- Lucas Hart reports that recursive transfers of large directory trees stops
- prematurely. Test case: openssl-0.9.4. Using the same file set on SunOS I
- see even worse than that -- "dir /recursive openssl-0.9.4" doesn't even parse.
- Added some debugging to addresult()... Everything proceeds normally until
- after the 166th file is added to the list. From that point on, we never see
- another regular file -- only directories. Why? segisdir is set to 1 when it
- should be 0 -- a mystery since there is no way this can happen; there are
- comments about this in the traverse() code already -- it's been a mystery for
- some time. But this code is so delicate I really can't risk touching it, so
- let's see if we can find a workaround... If I "cd openssl-0.9.4", then "dir
- /recursive" works perfectly. So therefore we can rule out anything special
- about the directory tree itself (its size, depth, number of files, order of
- files and directories, etc). It must be something about the initial setup in
- splitpath... Another experiment: "dir /recursive openssl-0.9.4/*" works too.
- So maybe the workaround is to simply tack "/*" onto the end if it's a
- directory. No, that's not it -- I already do that. Anyway, most of this was
- a wild goose chase since there was another error in cmifi() that was obscuring
- everything: the '&wild' return value was not being set on recursive file
- parses in which the filespec did not actually contain wildcards, which
- prevented any command that operated on multiple files from working right.
- Fixed in cmifi(): ckucmd.c, 28 Nov 99.
- OK, back to traverse(), my least favorite place to be... When we say "dir
- openssl-0.9.4" (or "dir openssl-0.9.4/*") we still stop short of listing the
- full directory, but when we cd to the directory and don't give a filespec, we
- do get the full listing. So what's the difference?
- In the working case (A), a "*" is supplied as the filename, so the initial
- isdir() fails since "*" isn't a directory, whereas in the failing case (B)
- "openssl-0.9.4" is a directory. That shouldn't matter, since in the latter
- case we append "/*" to make it wild.
- So fgen() in case A gets "*" but in case B it gets "openssl-0.9.4/*". And
- therefore splitpath() makes one segment in case A and two in B. Well,
- everything goes along OK for 85 files or so until we get to a certain
- directory (one among many). For some reason, when we retrieve the first file
- from it, we call ckmatch() with the original filespec ("openssl-0.9.4/*")
- rather than the current name part ("*"). Aha, once again the culprit is
- segisdir...
- OK, what is segisdir anyway? As I recall it was a hack to cut down on the
- number of calls to isdir(), which are quite expensive, at least in UNIX. I
- think the idea was that if the current segment had a forward link, then it was
- guaranteed to be a directory, thus obviating the isdir() call. OK, let's
- see... segisdir is set up above, but if we open a new directory after setting
- it, that pretty much invalidates its meaning, so what good is it in this
- context? Finally I commented out the offending segisdir-based test, which
- decides which string to match and this fixes the problem. But what does it
- break?
- Dug up my old full-page checklist of directory-traversal tests... Out of
- fifty-some tests, the new version flunks only one that the old one passed:
- "dir /recursive */*.txt" (or */*/*.txt, etc). Hmmm, it's all coming back to
- me now, vaguely -- this was the problem that the code I just removed was
- intended to fix. So what's the difference between the two cases?
- A. dir /recursive openssl-0.9.4 --> "openssl-0.9.4/*"
- B. dir /recursive */*.txt --> "*/*.txt"
- The difference, obviously, is left and right *'s. The only way to keep them
- both happy is to carry around the full relative pathame of each file, rather
- than just the current segment. To be continued... ckufio.c, 28 Nov 99.
- Some more SSL changes from Jeff. ckcmai.c, 29 Nov 99.
- Changed traverse() to compare full paths (rooted at starting position), rather
- than all the clever stuff with segments. This fixes B without breaking A;
- however it breaks "dir */*.txt", "dir */*/*.txt", etc; any nonrecursive lookup
- in which there is a wildcard in a directory path. Everything else is fine
- (except for one thing, which has always been broken, more about this later).
- ckufio.c, 29 Nov 99.
- The problem is that "subdir" does not match "*/*.txt" and so the subdirectory
- is being skipped rather than opened. Removing the clever trick to avoid
- calling isdir() if listing is not recursive fixes this problem, but of course
- slows us down. But worse, it fails to fix "*/*/*.txt". In this case,
- ckmatch() is actually being called correctly:
- ckmatch string[subdir/thisdir/oofa.txt]
- ckmatch pattern[*/*/*.txt]
- and fails to match. Why? Because it's an unstructured string match; it
- doesn't treat filespec field separators differently from any other character,
- whereas in UNIX filename globbing, directory separators are fences and can't
- be gobbled up by "*", etc. A simple change to ckmatch() to make "*" treat
- "/" as a fence fixes the problem, but of course will break a thousand other
- things. So I changed the "matchdot" parameter to ckmatch() to be an "options"
- parameter, bitmapped. Bit 0 = match leading dot. Bit 1 = filename globbing
- so don't let * span field separators. Set bit 1 in the appropriate calls,
- mainly the ones from traverse(). Purposely did not set it in some other
- places like SET FILE {TEXT-,BINARY-}PATTERNS because in that case we really
- don't want to treat "/" specially.
- Now in truth, "*/*/*.txt" should match "a/b/c.txt" whether it's a filespec or
- not. The above fix address filenames, but "if match a/b/c.txt */*/*.txt"
- still does not succeed. It seems we have two contradictory goals:
- Pattern String
- A. */*/*.txt a/b/c.txt
- B. a*bc, abcbc
- If A matches, B doesn't, and vice versa. Yet both should match. Currently
- it's a matter of whether the "*" matcher searches for the rightmost or the
- leftmost occurrence of the thing that follows it. Until now, the strategy has
- been rightmost, in which B worked. Changing it to leftmost fixes A and breaks
- B. How can we make both work? It appears to be a matter of whether the thing
- that follows the thing that follows the "*" is another "*". I added this
- distinction and now both work, and "match.ksc" still passes. Now I commented
- out the previous filename-globbing change and ran the traverse() test again.
- It worked fine, except one thing broke ("../.*"). Restoring the globbing code
- fixed that. But it broke "dir /recursive subdirname" so I removed it again.
- So where are we now? Everything works except:
- a. "directory ../.*" matches too much.
- b. Other unrelated problems involving symlinks are still there.
- ckmatch() is being called with "../subdir" and ".*". Well, clearly without
- treating "/" as a fence, ".*" is going to match "../subdir". But now for some
- reason the fence business also breaks recursion. This code is exactly like a
- Whack-O-Mole -- you can't knock one down without making another one pop up. So
- let's leave it like this (no fence) for now; it's not perfect but it's a big
- improvement. The remaining problems are as above.
- The symlink problem has several facets. First, suppose the current directory
- contains directory d1 and a symlink, d2, to d1. Then "dir */*.txt" shows each
- file in d1 twice, e.g. "d1/foo.bar" and "d2/foo.bar". But "dir /recurs" is
- smart enough to avoid this. Oddly enough, UNIX "ls" and "ls -R" behave
- exactly like Kermit.
- Second, "dir /recursive /tmp/fdc/" says "empty directory" (when it's not).
- Why? In this case "/tmp" is a link to "/usr/tmp". Here we are opening the
- directory 0 times instead of 2 times (as in the previous case), or 1 time
- (as we should). (ls -R does NOT have this problem.)
- Third, "dir /recursive /tmp" (same /tmp) just shows the symlink instead of
- following it. (ls -R does NOT have this problem.)
- None of these symlink-related problems is new; they've been with us all along.
- I'll see what I can about them tomorrow.
- From Jeff: changes to the HTTP commands. The DELETE command is now supported.
- Like PUT it is almost never supported due to security concerns but we include
- it for symetry. Fixed several buffer over write errors in the allocation of
- memory for the http request buffer. Changed the local-file for GET and INDEX
- to be optional. If the file is not specified the output goes to the display.
- (if we don't like it then we can simply modify the code in ckuusr.c (cx ==
- XXHTTP) to ensure that a local file name is specified.) Added checks to the
- dohttp() function to insure that the command will not be attempted when there
- is no connection or when Kermit is being used as IKSD. Finished relocating
- SSL/TLS code: Removed lots of variables that either wre not being used or
- simply complicated the configuration of SSL/TLS. With these changes I am now
- confortable including SSL/TLS as a feature without any qualifications.
- ck_ssl.c security.txt ck_ssl.h ckuath.c ckuus3.c ckctel.c ckuus7.c ckcnet.c
- ckcmai.c ckuusr.c ckermit2.txt ckcnet.h, 29 Nov 99.
- Fixed long lines & trailing blanks in ck_ssl.c. 29 Nov 99.
- Never satisfied, went back to traverse() / ckmatch() problems. Restored the
- pathname fence changes to find out what the problem was with recursion, namely
- that "dir /recursive subdir" does not recurse. Why? Obviously because
- "subdir/*" does not match "subdir/a/b/c..." when "/" is a fence. But since
- the search is recursive, there should be no fences so I changed traverse() to
- enable fences only in nonrecursive searches. This change works, fixes the
- "../.*" problem, but breaks two things:
- a. dir */*/*.txt <-- no match
- b. dir /etc <-- doesn't show subdirectories
- These might actually be the same problem, namely that in nonrecursive
- searches, we don't descend far enough. The solution here is to open
- directories not only on recursive searches, but also on nonrecursive ones
- when the current search depth is less than the pattern depth. This fixes
- (a) but not (b). In the latter case we are matching "/etc/blah" with "*"
- (because blah is a directory), but the /'s preclude a match. So one more
- adjustment: turn off fences if the match object is a directory. This
- fixes (b). Now let's run through the big list again to see what we broke:
- a. dir ./.* (shows all files)
- b. dir ../.* (shows dot files plus directories)
- Everything else works except for the symlink problems.
- The problem with (a) is that, even though (say) "READ.ME" does not match ".*",
- it is still being added because it is the end of a path segment. Changed the
- ELSE part of the big match-result IF statement to apply only if the current
- item is a directory (rather than just ASSUMING it's a directory) AND it
- matches the pattern OR the search is recursive, This fixes (a) but not (b).
- Why? Because we're matching "../blah" against ".*" without fences because of
- the previous adjustment. OK, but in this case we should be matching with
- "../.*", not ".*". I added a disgusting hack to handle this.
- Ran the tests again. Now we have a problem with "dir /recursive .*". It
- matches (for example) .xxx/oofa.txt. Should it? It didn't before... But
- worse, it misses some that it should match. The problem in both cases is that
- it is matching the whole path rather than the current segment, which is how we
- got started on this tangent to begin with. OK, how should it know when to
- match only the current segment rather than the entire path? When the search
- is recursive? OK, that fixes this problem, but breaks "dir /recursive
- */*.txt". OK, so when the search is recursive AND the pattern does not
- contain slashes... Good, this fixes "dir /recu .*". Everything else works
- now except:
- a. dir /recursive .. (or anything that starts with ..)
- b. dir /recursive ./ (anything that starts with ./)
- These were fixed by moving the stripping of any leading "./"'s from fgen() to
- traverse(), and changing the "if" for stripping to a "while". Now we pass ALL
- tests except for symlink problems. Let's look at these now:
- a. "dir */*.txt", where the current directory contains a "foo" directory and
- a symlink, "bar", to foo. In this case, the contents of the bar directory
- are shown as if it was a separate directory. But as noted before, ls
- does the same thing. So does "ls -R */*.txt". But Kermit's "dir /recurs
- */*.txt" does not -- Is Kermit being too clever?
- b. "dir /recursive /tmp", where /tmp is a symlink, just displays the symlink
- rather than entering the directory. This is no doubt related to the
- cleverness in (a). "ls -R /tmp" does NOT have this problem.
- c. "dir /recursive /tmp/fdc", where /tmp is a symlink, says the directory is
- empty when it's not. "ls -R /tmp" does NOT have this problem.
- Conclusion: C-Kermit is being too clever. How can it possibly know that some
- symlink might be redundant when others are not? It can't. The clever bit was
- located in isdir(). Commenting it out fixes a thru c and makes Kermit behave
- like ls and ls -R. But we'd better run the 60 tests again just to make sure...
- Hmmm, they're all OK.
- Well, a couple minor problems turned up, but they were there before too:
- "dir /recursive ./.*" and "dir /recursive ../.*" are slightly off. In case
- anybody ever notices these, they can be easily worked around.
- Finally, one more problem was introduced recently. In the CD command,
- completion no longer works on a directory name (absolute or relative) if the
- part entered so far contains a path separator. Example:
- cd subd<Esc> works (subdir is a subdirectory of the current dir)
- cd subdir/ano<Esc> doesn't (ano -> another)
- cd et<Esc> works (from /) (for /etc)
- cd /et<Esc> doesn't
- Why? ckmatch is being called with "ano*" and "subdir/another", which don't
- match. Fixing this in the obvious way would, of course, break everything I
- fixed already. So let's try something devious, a hideous disgusting hack
- designed to catch exactly this case without disturbing any of the others.
- This seems to work, in that it fixes the problem, and we get through almost
- all of our test suite without difficulty, until reaching "dir /recursive /etc",
- at which point we just hang (I bailed out after 2 minutes). But removing the
- hideous hack didn't change this. Well, ls -R works, CK Beta.10 works. Aha,
- /etc contains a symlink to the NFS-mounted Columbia University mail spool,
- which contains 40,000 directories... OK, false alarm. But why does ls -R not
- stumble into the same hole? Because if you give it the -R (Recursive) option,
- it doesn't follow symlinks at all unless you include the -L option. OK, back
- to the test suite... And now for the first time, C-Kermit passes every single
- test. ckufio.c, 30 Nov 99.
- So what to do about the /etc problem? Three choices:
- 1. Nothing (keep following symlinks in recursive searches).
- 2. Don't follow symlinks in recursive searches.
- 3. Add a command or switch.
- Option (3) is not practical since it would need to go on every command that
- allows recursion, but even then we still have functions like frfiles(). If I
- choose (2), then users won't have any way to defeat it. So let's stick with
- (1); if they get in trouble like I did, they can use circumlocutions. Added
- some notes about this to ckermit2.txt, 30 Nov 99.
- So there you have it, another three long days on traverse(). If this ever
- comes up again, remind me to throw the whole thing out and start over. I'd do
- it now, but it's working and we have to move on.
- From Jeff: Plug some IKSD holes; more SSL/TLS shuffling.
- ck_ssl.[ch] ckctel.c ckufio.c ckuus5.c, 30 Nov 99.
- Changed DIR error message to more intelligently differentiate a bad switch
- from a bad file or directory name. ckuus6.c, 30 Nov 99.
- Tried "pty tn3270 <ibm-mainframe>". Works fine. Added a section on this to
- the doc. ckermit2.txt, 30 Nov 99.
- From Jeff: corrections to filename-matching code in ckmatch() for non-UNIX
- builds: ckclib.c, 1 Dec 99.
- From Jeff: The SET LOGIN PASSWORD password is now used for automated Kerberos
- logins if the TGT was triggered by an Auto-GET and if the principal and realm
- are known. Otherwise, it is ignored and the user is prompted. Now the dialer
- can be configured with a user's password and it can trigger and auto login.
- The same is true for SET HOST /PASSWORD:<pwd> <host>. ckuath.c, ckuus[37].c,
- 1 Dec 99.
- Discovered that telling the client to "set transaction-log brief", "log
- transactions", and then "remote pwd" produced a core dump. The
- transaction-log writing routines were not protecting against null pointers.
- Fixed in ckuusx.c, 1 Dec 99.
- Lucas Hart reported that "get /recursive" from VMS client to UNIX server
- resulted in all files arriving in binary mode. Sure enough. The same thing
- happens UNIX-to-UNIX so it's not a matter of peer recognition. On the
- Whack-A-Mole theory, tried backing out of the SEND /TEXT change from Oct 22,
- but it made no difference (so I backed out of the backing out). Turns out
- the problem was in the GET command parser, introduced on 24 Feb 99 with the
- change to make GET /RECOVER imply /BINARY; the problem was a fall-through
- from one switch case to the next that was valid before this change, but not
- after. Strange nobody noticed the problem for 9 months. Let's hear it for
- long Betas! Fixed in doxget(), ckuus6.c, 1 Dec 99.
- Built & tested on VMS:
- . get *
- . get /recursive *
- . get /text *
- . get /binary *
- . get blah, get /text blah, get blah (to make sure global mode restored).
- All work fine.
- Added --privid:{ok,no,...} command-line option for IKSD. Sets ckxpriv, which
- is defined in ckufio.c (so also needs to be defined in other ck*fio.c);
- initial value 1 for compatibility with current behavior, but maybe it should
- be 0. Does nothing at the moment, but if 0 should prevent login to IKSD as
- a privileged user. ckuusr.h, ckuus[5y].c, ckufio.c, 1 Dec 99.
- From Jeff: "if not iksd" checks added for many top-level commands. Many
- modules, 1 Dec 99.
- Added PURGE /RECURSIVE. (DELETE /RECURSIVE would be easy to add too, except
- it would only affect files; we don't have a good way of deleting a directory
- tree, or knowing when to delete a particular directory and when not to).
- ckuus[27].c, 1 Dec 99.
- Suppose I'm in a directory that contains a bunch of files and backup files and
- I "send *" with filenames literal. All the files, including the backup files,
- are sent with their own names, like "foo.c.~3~". OK, fine. But now suppose I
- "send *" again, to the same directory. Now the backup files get double backup
- suffixes, like "foo.c.~3~.~1~". Changed znewn() to automatically trim backup
- suffixes from incoming files before assigning new ones. ckufio.c, 1 Dec 99.
- Peter E pointed out that constructions like:
- define foo {,-
- blah blah
- }
- didn't work ("?Macros nested too deeply"). But there's no good reason they
- shouldn't. The rule is that a braced section begins with a line ending with
- an open brace. But ",-" also indicates a line break, so the construction
- above should be exactly equivalent to the same construction without the ",-".
- Added code to getnct() to account for this situation. And while looking at
- getnct(), I saw an opportunity for a big speedup (or, rather, to undo a major
- stupidity): this routine allocated a new read buffer every time it was called.
- I changed the code to allocate a new buffer only the first time called, or if
- called later requesting a larger size. I don't have a good benchmark, but a
- rough measurement indicates a 100% speedup in the reading of command files and
- dialing directories (but only when the command file doesn't actually do any
- computation; in most cases the difference is imperceptible). ckuus5.c,
- 2 Dec 99.
- Another GET command improvement: in GET [ switches ] <remote> <local>,
- if <local> has the syntax of a directory name we try to CD to it, but if it
- does not exist, GET fails. Now if it does not exist, we try to create it
- before trying to CD to it, but only if it seems to have directory syntax;
- for example in UNIX if it ends with "/", or in VMS if it ends with "]"
- or ">". doxget(): ckuus6.c, 2 Dec 99.
- Fixed a minor problem in VMS: Suppose your current directory has a
- subdirectory [.TMP]. You tell Kermit to "cd tm<Esc>"; Kermit correctly
- expands this to (say) DKA0:[MYNAME]TMP.DIR;1, but when you press Return, it
- says "Invalid argument". Yet if you type "cd dka0:[myname]tmp.dir;1" it
- works fine. Too hard to explain. Fixed in docd(): ckuus5.c, 2 Dec 99.
- Fixed another problem reported by Lucas: if you tell Kermit to "set transfer
- mode manual" (or whatever), then put it in server mode, then transfer some
- files with a client whose transfer mode is auto (different from the server),
- then finish the server, its transfer mode has changed to the client's. Fixed
- by making SET TRANSFER MODE set the global transfer mode as well as the
- effective one. ckuus3.c, 2 Dec 99.
- Checked out Lucas's report from a while back about the VMS Kermit server's
- response to REMOTE DIR being history-dependent. As far as I can tell, it
- doesn't happen any more. 2 Dec 99.
- Lots o' changes from Jeff, mainly for checking in each command whether it may
- be given to IKSD. Mostly ckuus*.c, 2 Dec 99.
- Changes from Jeff: minor corrections to stuff from yesterday, conversion of
- many (more) sprintf's to ckstrncpy's. ckcnet.c ckuus4.c ck_ssl.c ckuus2.c
- ckuus6.c ckuus3.c, 3 Dec 99.
- More c.f.j: ordered authentication type list: ck_ssl.c ckuath.c ckuath.h
- ckuus3.c ckuus7.c, 3 Dec 99.
- Made SET RECV a synonym for SET RECEIVE so we can write a lot SET SEND and
- SET RECV commands and have them line up. ckuusr.c, 4 Dec 99.
- A final touchup to traverse(). There were still some small problems involving
- ".." in UNIX, but removing one of the special cases I inserted in traverse()
- for ".." a couple days ago cleared it up. Also, the test in fgen() for
- automically setting "matchdot" for a given match if the given filespec began
- with "." was overlooking the "../blah" case, which also was responsible for
- some of the ".." problems. Fixed in ckufio.c, 4 Dec 99.
- Suppose you want to use a version of C-Kermit that is stored on the host as
- "wermit" or "ckermit". If you change your local Kermit's autoupload strings
- to to use this name, C-Kermit would still only recognize "kermit" at its
- prompt. Added "wermit" and "ckermit" as synonyms. ckuusr.c, 4 Dec 99.
- New security.txt and telnet.txt from Jeff plus a couple minor source
- corrections. 4 Dec 99.
- Added a new feature for VMS: SET { SEND, RECEIVE } VERSION-NUMBERS { ON, OFF }.
- Normally both are OFF. If SEND VER ON, the VMS version number is kept on the
- outbound filename; if OFF it is stripped. If REC VER OFF, any VMS version
- number on the incoming filename is stripped; if ON, it is kept. This setting
- is independent of FILE NAMES { LITERAL, CONVERTED }. ckuus[247].c, ckvfio.c,
- 4 Dec 99.
- Noticed that CD command in VMS doesn't work any more -- i.e. instead of
- returning to your login directory, it does nothing at all. It's because of
- the seemingly innocent change I made to docd() a couple days ago. Fixed by
- focusing the change a little better. ckuus5.c, 4 Dec 99.
- Noticed that when uploading a file to VMS with specifying a path, it always
- went in the home directory rather than the current directory. Cause: a typo
- in the GET-command-improvement code from 2 Dec. Fixed in doxget(): ckuus6.c,
- 4 Dec 99.
- Noticed that when VMS C-Kermit sends back the full filespec to the sender, it
- always ends in ";" without the version number. Ditto for the transaction log,
- etc. It's been like that forever; it has nothing to do with recent changes.
- After some investigation, it turns out that this is howsys$parse() works -- it
- doesn't actually go to disk; it only parses the given string. Added a new
- routine, getvnum(), that gets the version number using lib$find_file()
- (suggested by Hunter G), and it works, but when the zfnqfp() result includes
- the version number, this breaks all sorts of commands, notably LOG. For
- example, if DEBUG.LOG;2 exists and you tell C-Kermit to "log debug debug.log",
- zfnqfp() finds DEBUG.LOG;2 and then when we go to open for output we get an
- error. So I backed out of all this and left it as it was. 4 Dec 99.
- Updated NEWS text. ckuus2.c, 4 Dec 99.
- Did some preliminary builds to catch major foulups before starting the
- build-all: HP-UX 10 (with and without ANSI features, optimization), VMS
- (UCX and nonet), FreeBSD, SINIX, ...
- Built with various features deselected on FreeBSD: NONET, NOCSETS, NODEBUG,
- NOUNICODE, NOHELP, NOSPL, NOIKSD, NOXFER, NOSHOW, NOSERVER, NOPUSH,
- NOPIPESEND, NOPTY, NOMSEND, NOLOGIN -- various minor #ifdef adjustment were
- needed. ckuus3.c, etc, 4 Dec 99.
- Changed default IKSD database directory from /tmp to /var/log. ckcdeb.h,
- 5 Dec 99.
- Installed new "Open-Source-Friendly" copyright notice and changed VERSION
- command to get the paging right. ckcmai.c, ckuusr.c, 5 Dec 99.
- Changed source-file copyright text to refer to main notice; all modules,
- 5 Dec 99.
- Adapted pty code to NeXTSTEP. ckupty.c, 5 Dec 99.
- Excluded 4.4 BSD #include for <termcap.h> from BSDI, since it doesn't
- have it. ckuusx.c, 5 Dec 99.
- Big trouble with Ultrix 4.3 -- first of all it barfs on the new makefile's
- KTARGET clauses. Makefile, 5 Dec 99.
- After removing the KTARGET phrases from the Ultrix entries, I get:
- ... -c ckcmai.c
- cpp: error /usr/include/netdb.h:94: Can't find include file sys/bitypes.h
- cpp: error /usr/include/netdb.h:96: Can't find include file sys/cdefs.h
- Some header files have disappeared from this computer -- I verified this
- by trying to rebuild Beta.10 (which built OK there before) and it gets the
- same error. So I could only build a nonet version for Ultrix.
- The SET DIAL TEST { ON, OFF } case was nested inside another case.
- Fixed in ckuus3.c, 5 Dec 99 (after most of the binaries were built).
- Protected an unguarded "extern int ucsorder" declaration with #ifdef UNICODE
- in ckcfns.c (the DG AOS/VS link step will fails if extern declarations are not
- resolved, even though they are never referenced), 5 Dec 99.
- Something was very wrong in VMS 7.2-1; the SMG-based fullscreen file transfer
- display gets: "?refresh: smg$begin_pasteboard_update: %SMG-F-INVPAS_ID,
- invalid pasteboard-id". But this doesn't happen in VMS 7.1 or earlier.
- Eventually I concluded, correctly I hope, that the problem was just a
- misconfiguration of the terminal database on that machine (because the debug
- log said "initscr: smg$create_pasteboard: %SMG-F-UNDTERNOS, undefined terminal
- - couldn't access system terminal table". However, Kermit was handling this
- error very badly, spewing thousands of error messages to the screen. I added
- code to the VMS curses-simulation routines to check for this and to switch
- automatically to the CRT display when it happens. ckuusx.c, 5 Dec 99.
- On one of the Linux systems I have access to, which (last time I heard) was
- Slackware 3.5.0 (how do you tell?) now complains when ckupty.c tries to
- include <sys/select.h>. There is no <sys/select.h> or <select.h>. I had to
- make a new Linux target, linuxns, to handle this case. There must be a better
- fix, since the problem happens only in ckupty.c and not in other modules that
- use select(), but the better solution will have to wait till after Beta.11.
- Hmmm, on second thought, it seems that <[sys/]select.h> is included by ckupty.c
- only in Linux, but no version of Linux I have access to needs it. So I simply
- commented out the #include. (NOTE: according to RH 5.2 "man select", the
- needed header files for select() are <sys/time.h>, <sys/types.h>, and
- <unistd.h>, but we don't call select() in ckupty.c so it appears we never
- needed any of this. makefile, 5 Dec 99.
- Peter E discovered that if you log in to IKSD with REMOTE LOGIN (rather than
- by hand), that IKSD accepts only 91-byte packets, and does not respond to
- file interruption (X) requests. The problem seems to be confined to IKSD,
- since if you run an ordinary server and REMOTE LOGIN to it, this does not
- happen. Comparison of the debug logs shows that in spar(), urpsiz is 4000
- in the normal case, 90 in the problem case. It turns out that dofast()
- (which sets up fast file-transfer parameters) was not being called if there
- was no init file. Moved the dofast() call to the mainline initialization
- sequence in main(): ckcmai.c, 6 Dec 99.
- Due to a typo, the LOGOUT command was dispatching to the LOGIN routine.
- Fixed in ckuusr.c, 6 Dec 99.
- The LOGIN and LOGOUT commands, if given with no connection, printed an error
- message but did not advance to the next line. Fixed in ckuus7.c, 6 Dec 99.
- William Bader noticed that the SCO OSR5 version did not display a herald when
- started. The same in Unixware 2 (but not 7). Diagnosis: the SCO compiler was
- generating bad code for:
- if (noherald || bgset > 0 || (bgset != 0 && backgrd != 0)) x = 1;
- x was 0 before this, all conditions are false, and afterwards x is -32.
- Fixed by rephrasing in herald(): ckuus5.c, 6 Dec 99. (Note: the bug does not
- occur in a small test program; i.e. it is not easily reproducible.)
- New HELP text from Jeff for SSL and HTTP, plus a minor correction to an
- SRP-related ?-help string. ckuus[23].c, 6 Dec 99.
- Added new tru64-40g target. makefile, 6 Dec 99.
- Minor changes to the copyright and permissions notice based on text from
- CU counsel. COPYING.TXT, 6 Dec 99.
- Tried building on SCO 3.2v4.2 with PTY support -- no go; we get a syntax
- error in a system header file (memory.h). 6 Dec 99.
- Fixed an unguarded reference to zmkdir() in the GET parser and generalized the
- #ifdefs around z_exec() to allow disabling from the cc command line with
- -DNOZEXEC. ckuus6.c, ckufio.c, 7 Dec 99.
- Added #ifndef OPENBSD..#endif around #include <termcap.h>. ckuusx.c, 7 Dec 99.
- Trimmed trailing blanks, fixed long lines. All modules, 7 Dec 99.
- ---Beta.10---
- From Jeff: Added missing TLS and NTLM keywords, plus some minor syntax
- adjustments. ckuus[367].c, 8 Dec 99.
- Removed RD as an invisible synonym for RMDIR, now that we also have an
- RDIR command. ckuusr.c, 8 Dec 99.
- Restored KTARGET clauses to Ultrix entries with new substitution syntax
- from Peter E. Makefile, 8 Dec 99.
- Changes to #ifdefs around #include <termcap.h> for Mac OSX. ckuusx.c,
- 8 Dec 99.
- From Jeff: Added version string for SSL/TLS; created a hook to identify the
- Crypto Dll version number; Fixed a typo "|" should have been "&" that was
- resulting in the server responding to ONE_WAY Kerberos authentication
- incorrectly. ckuath.c, ck_ssl.c, ck_crp.c, ckuus5.c, 8 Dec 99.
- From Jeff: Many SSL changes and a syntax fix in rset(). ck_ssl.c ckctel.c
- ckcmai.c ckctel.h ckuath.c ckclib.c ck_ssl.h ckuus5.c, 9 Dec 99.
- Looked into the core dumping problem on SCO 505 when sending a file. It
- happens in the fullscreen display at F-packet time. The core file is total
- garbage. The debug log shows we crash in zfnqfp(). In OSR5, zfnqfp() simply
- hands off to realpath(), which, when called, scribbles all over memory and
- dumps core. Tried adding -DNOREALPATH to CFLAGS and poof, it works. Fixed in
- ckcdeb.h by defining NOREALPATH if CK_SCOV5 is defined. 9 Dec 99.
- Added solaris26gnc target for use when libtermlib is missing. makefile,
- 10 Dec 99.
- A fix from Jeff to my change of Nov 8 in which I "...removed the 'pop back to
- command mode after each protocol operation' feature from IKSD by #ifdef'ing
- out the 'justone = 1;' commands in ckcmai.c (search for IKSDPOPBACK)..." This
- change prevented the init file from being executed and the server idle time
- limit from being set. Fixed by setting justone = 1 during the authentication /
- login phase. ckcmai.c, ckcpro.w, 10 Dec 99.
- Changes from Fred Smith for Coherent 4.2. ckcdeb.h, cku[tf]io.c, ckupty.c,
- ckuusx.c, 10 Dec 99.
- Fixed a mixup with #ifdefs in z_exec() -- #ifndef should have been #ifdef.
- This affects all Beta.11 builds; the "PPP dialer" feature (EXEC /REDIRECT)
- won't work. Let's see if anybody (besides Peter M) notices... ckufio.c,
- 10 Dec 99.
- From Jeff: Updated help text for SET AUTH and AUTH commands. Changed name of
- a command to better match common practice. Decided not to support Tim
- Hudson's /etc/ssl.users file. We will only support the much safer ~/.tlslogin
- file for authenticated login with certificates. ck_ssl.c ckctel.c ckuus2.c
- ckuus3.c, 10 Dec 99.
- Fixed custom banner for SCO ODT 3.0. ckuver.h, 18 Dec 99.
- A block in zvpass() had a variable p, which causes compiler warnings since
- zvpass also has a parameter p. Changed the former to p2. ckufio.c, 18 Dec 99.
- Changes from Jeff:
- . Increase username/password length for IKSD.
- . Various authentication changes.
- . UNIX CONNECT fix vs IKSD disconnect and local-echo buffer.
- . Some fixes to the weighted running CPS calculation.
- . New code for K95 IKSD to find its configuration file.
- . Enable SHOW at IKSD prompt
- . Enable SSL/TLS is OS/2
- Many files. 18 Dec 99.
- More SSL stuff from Jeff. ckutio.c, ck_ssl.c, ckuath.c, ckcnet.c, 19 Dec 99.
- Peter E complained that building file lists was a lot slower after the changes
- of 28 Nov - 4 Dec. That's true, but it's because the optimizations and tricks
- that were used prior to that to achieve speed gave bad results in many cases.
- The whole problem centers around calling isdir() on each file to find out if
- it is a directory; this turns out to be quite expensive. The traverse() code
- uses all kinds of scary tricks to avoid this, which is what makes it so
- delicate. It occurred to me that the struct returned by readdir() might
- contain some kind of bit saying whether this was a directory; I can't imagine
- why it wouldn't, but if it does I can't find it. Anyway, I got a 5-10%
- speedup by making an xisdir() macro and calling it within ckufio.c instead of
- isdir(), to avoid the function call. Then I simplified the conditions under
- which xisdir() is called and the places from which it is called. This speeds
- up nonrecursive searches about 100% and recursive ones by about 60%. But
- always remember: you can't fix anything in traverse() without breaking
- something else. The simplification breaks the nice feature of putting a "/"
- at the end of directory names in file lists, so I backed off, leaving us
- with the 5-10% improvement. ckufio.c, 19 Dec 99.
- Comparing ls -l * with Kermit's ffiles(*) shows that traverse() is about as
- fast and therefore not the bottleneck. The real bottleneck is the DIRECTORY
- command. Not because it sorts the results (the sort phase is negligible using
- the current simple shellsort; substituting the way-more-complicated quicksort
- gives no measurable speedup), but because it calls stat() AGAIN on each file to
- get the size, permissions, etc. The only remedy here would involve the
- classic space-time tradeoff: we could make traverse() save the stat info for
- each file. But this could be quite big and furthermore would not be used
- except in the DIRECTORY command anyway. It could be done but I don't think
- it's worth it since slowness is not noticed unless thousands of files are
- involved. So yes, in UNIX ls -l is faster than Kermit DIRECTORY because ls -l
- only calls stat() once on each file. No changes. (Except a quicksort routine
- was added to ckclib.c but #ifdef'd out.)
- Ran traverse() tests, all OK.
- Jeff noticed some spurious file transfer failures with "Error 0" since the
- previous round of traverse() changes. He caught C-Kermit in the act with a
- 68MB debug.log file. At the end of the last file in the list Kermit sends the
- Z packet, gets the ACK, calls gnfile(), which calls znext(), which returns 0
- with an empty file name when it reaches the end of the list, as it should.
- But for some reason we go back to ssfile state rather than sseot. Turns out
- that when the final file returned by znext() is not selected by fileselect(),
- gnfile() returns an empty filename but a positive value. This bug has been
- there since adding the fileselect() code more than 2 years ago. Fixed in
- gnfile(): ckcfns.c, 19 Dec 99.
- Added code to ignore PROTOCOL and COMPRESSION messages from modem while
- dialing. ckudia.c, 19 Dec 99.
- Added support for Diamond Supra Express V.90 modem. Incredibly, it removed
- the &S0/&S1 command available in earlier Supra models and most other modems.
- Therefore it is unlikely this one could ever be used from VMS. ckudia.c,
- 19 Dec 99.
- Added uw7ssl target for Unixware 7 with OpenSSL. makefile, 19 Dec 99.
- Went over new security.txt from Jeff. 19 Dec 99.
- Trimmed trailing blanks from lots of files. 19 Dec 99.
- Some corrections from Jeff to ckcnet.c and ckctel.c, plus more SSL/TLS stuff
- in ckuath.c, ck_ssl.c. 20 Dec 99.
- Changed UNIX sysinit() and syscleanup() to get and restore stdin flags.
- ckutio.c, 20 Dec 99.
- Added &S0 and &S1 to Supra Express init string -- it's not in the manual, but
- it's valid anyway. ckudia.c, 20 Dec 99.
- Fixed a bug in which C-Kermit, when sending a file in local mode and
- streaming, could hang if the user canceled with X or Z. The problem was that
- the code in sdata() that bumped the packet number when streaming did not also
- bump winlo to match, and so input() did not recognize the resulting ACK from
- the receiver because it seemed to have the wrong packet number. ckcfns.c,
- 20 Dec 99.
- If such a transfer was interrupted at just the wrong time, the Z packet might
- not contain the D(iscard) directive. Fixed in ckcpro.w, 20 Dec 99.
- Added "s" to "timestamp" in "set debug timestamp". ckuus3.c, 20 Dec 99.
- Converted '-P' command-line option to mean "literal filenames". ckuusy.c,
- 20 Dec 99.
- Added missing carriage returns to the end of four Compaq modem commands that
- lacked them. ckudia.c, 21 Dec 99.
- Some Supra Express V.90 init string corrections (incl removing Y0, which is
- in the manual but not in the modem). ckudia.c, 22 Dec 99.
- From Jeff: Add Telnet environment variables to SHOW TELNET. ckuus4.c,
- 22 Dec 99.
- Minor fixes for FreeBSD uucp lockfiles from Helge Oldach <hmo@sep.hamburg.com>,
- ckutio.c, 22 Dec 99.
- If Kermit given a -j or -J arg on the command line and ^C was typed during
- the connection phase, Kermit would dump core, probably because the longjmp
- buf isn't set up in the command-line parser. Fixed by adding
- signal(SIGINT,doexit) to cmdlin(). ckuusy.c, 22 Dec 99.
- Added CHECK PTY. ckuus3.c, 22 Dec 99.
- Back to our old friend, traverse()... As noted previously, Peter E reports a
- drastic slowdown since the Nov 28 - Dec 4 workover. I added code to count
- every stat() call. In a directory with 54 files, "echo ffiles(*)" results in
- 62 calls (the 8 extra are more-or-less constant overhead). This shows that
- traverse() is calling stat() once per file. However "directory *" in the same
- directory results in 227 stat() calls; 62 by traverse and 165 by the DIRECTORY
- code. That's way more than twice as many as there needs to be. For each
- file, DIR calls zgetfs(), ziperm(), and zfcdat(), each of which calls stat()
- on the same file. But ziperm() and zfcdat() should be able to pick up the
- info from zgetf's stat() call. The whole trick is to make sure it's the same
- file. But it's not such a trick -- we just check the diractive flag. Adding
- this to ziperm() reduces the number of stat() calls from 227 to 176. Then
- adding it to zfcdat() brings it down to 121, which is just about the minimum.
- In a directory with 2500 files, the DIRECTORY listing starts in 4 seconds,
- compared to 6 before this change, about 33% faster. ckufio.c, 22 Dec 99.
- But this is a small gain, and anyway does not affect non-DIRECTORY file lists,
- such as file menus on "?", file- and directory-name completion, etc. The only
- way to speed these up is to not call stat() on every file. But if traverse()
- does not call stat() on every file, it doesn't know whether it's a directory.
- Why do we care if it's a directory?
- . If it's a recursive search, we must open each directory and read it.
- . If it's a directories-only search, we must not match regular files.
- . If it's a files-only search, we must not match directories.
- It is possible to change traverse() to not call stat() if none of these three
- conditions is true, and this speeds up list generation a lot, for example
- reducing the number of stat() calls in a regular DIR command (with no
- switches) to approximately the number of files. So in the 54-file directory
- we're down from 227 to 62 stat() calls. In a 2500-file directory, we're
- seeing results after 2 seconds, rather than 6-8.
- The problem with this trick is that it prevents the names of directory files
- from being tagged with '/' at the end and showing up nicely in a file list.
- Aside from that, we still pass the traverse() torture test. So it's a
- tradeoff. And whenever there's a tradeoff, there needs to be a SET COMMAND,
- so I added a new, invisible command SET FILE FASTLOOKUP { ON, OFF }. It's off
- by default, since most people aren't getting file lists of huge NFS-mounted
- directories. So today's score: 33% speedup without sacrificing anything;
- 300-400% with SET FILE FASTLOOKUP ON. ckuus7.c, ckufio.c, 22 Dec 99.
- Noticed that a couple details in the flow control handling in ttvt() were
- different from those in ttpkt(), which might explain the problem that somebody
- reported with switching flow control between OUTPUT statements. There is,
- no doubt, more to do here... ttvt(): ckutio.c, 22 Dec 99.
- Changed CHECK PIPE back to CHECK PIPES. ckuus3.c, 23 Dec 99.
- Rearraged command-line parser SIGINT handler to squelch complaints from picky
- compilers. ckuusy.c, 23 Dec 99.
- Changes from Jeff for X forwarding. ckcdeb.h, ckctel.[ch], 24 Dec 99.
- Change from Jeff to command-line parser SIGINT handler to squelch even more
- complaints from picky compilers. ckuusy.c, 24 Dec 99.
- Changed setprefix() for NONE (called when clearchannel is negotiated on a
- network connection) to always prefix Xon and Xoff, regardless of the flow
- control setting, as well as DEL (127), which seems to be particularly
- troublesome, in addition to what it was prefixing before (CR, IAC, etc). This
- should allow CLEARCHANNEL to work even with connections to VMS and HP-UX. Now
- I can send from C-Kermit to gkermit on a Telnet connection with only the
- following prefixed: 1, 13, 17, 19, 127, 255; unprefixing any of these kills
- the tranfer (and sometimes the connection too). ckcmai.c, 24 Dec 99.
- Corrected a truly awful mistake in the command parser. In any WHILE command,
- the first left brace was treated as the beginning of the command list, so if
- the condition contained a left brace, the parsing was totally bollixed, as in
- "while not equal m(blah) {35} { commmands... }". Fixed in doif() and
- gtword(); the latter now sets global cmbptr to be a pointer to the CURRENT
- position in the command buffer (cmdbuf[]). Any higher-level routine can
- examine it to see what has been parsed so far and what has not. ckucmd.c,
- ckuus6.c, 24 Dec 99.
- Replaced clunky "does incoming file already have a backup suffix" code in
- znewn() with cleaner (and better-working) code from gkermit. ckufio.c,
- 24 Dec 99.
- From Jeff:
- . Make v(userid) return SET LOGIN USER value if one was given: ckuus4.c.
- . Expand setting of uidbuf[] in sysinit(): ckutio.c.
- . Some corrections to HTTP code: ckcnet.c.
- 26 Dec 99.
- From Carl Friend: Updated targets for CLIX. makefile, 27 Dec 99.
- If '-T' or '-i' is given on C-Kermit command line, then set transfer mode
- manual, don't use binary/text patterns, etc. Giving these options on the
- command line should be just like SEND /BIN or SEND /TEXT at the prompt.
- ckuusy.c, 27 Dec 99.
- Telnet updates from Jeff: ckctel.[ch], ckcnet.c, 28 Dec 99.
- Removed all mention of "regular expressions" from the docs. They aren't
- regular expressions. ckermit2.txt, etc. 28 Dec 99.
- Changed zopeno() and zclose() to handle ZCTERM and ZSTDIO better. ckufio.c,
- 28 Dec 99.
- Corrections to MYDIAL macro in ckermod.ini suggested by David Sanderson, to
- account for SET FLOW no longer being sticky. 28 Dec 99.
- Show actual value of CK_SYSINI, if defined, in SHOW FEATURES. ckuus5.c,
- 28 Dec 99.
- Added code to save previous handlers for SIGQUIT, SIGPIPE, SIGUSR1, and
- SIGUSR2, and to restore them before any exec(), execl(), execvp(), etc.
- suggested by David Sanderson, cku[ft]io.c, 28 Dec 99.
- More work on ttvt() to make its handling of flow control parallel that of
- ttpkt(). Plus additional debugging, etc. In response to persistent reports
- that changing flow control between OUTPUT statements doesn't work. ckutio.c,
- 28 Dec 99.
- Revisited the problem of referring to files with spaces in their names.
- The obvious way to do this is to put braces around the name, e.g.:
- send {this file}
- This hasn't worked in years, maybe never. The problem was simple: setatm()
- was being called with the wrong "break mask" arg in this case (we were telling
- setatm() to break on whitespace, but that's silly because the thing we're
- putting in the atom buffer is already a "word" by definition, since it was
- returned by gtword()). Fixed in cmifi2(): ckucmd.c, 28 Dec 99.
- Other methods are not so easy, however. "send this32file" can't work because
- of our stupid DOS/Windows filenames; "this32file" could easily be a DOS
- filename (file = "32file", in the "this" subdirectory of the current
- directory). There is simply no way around this without having separate
- fundamental parsing rules for different platforms. Yes, we could first try a
- match on this32file literally, and if it didn't match, then try running it
- thru the backslash interpreter and trying again, but this presumes we know
- what the user intended when they typed "this32file" and of course we can't.
- Added clarification to ckermit2.bwr. 28 Dec 99.
- Changes from Jeff for X forwarding. ckcnet.c, ckctel.c, 29 Dec 99.
- Backed off on yesterday's changes to zopeno() and zclose() -- they totally
- broke client/server ops; for example, FINISH would get a "?Can't open file"
- error. ckufio.c, 29 Dec 99.
- Made opent() succeed even if zopeno() returns 0, meaning "already open";
- after all, that's no reason to fail. ckcfn3.c, 29 Dec 99.
- Fixed a dangling case in the protocol state table, which might have been
- harmful if the new rcv_shortreply() returned -1, which normally would not
- happen except if the client sends a REMOTE command with the response
- redirected to a file, and writing to the file gets an error. ckcpro.w,
- 29 Dec 99. [NOTE: This fix is in error and was undone on 31 Dec 99.]
- WAIT 0 <modem-signals> skipped getting the modem signals because of a boundary
- condition on the loop test. Fixed in ckuus6.c, 29 Dec 99.
- Switching RTS/CTS on and off still didn't work. I think now I know why.
- In tthflow(), we have constructions like this:
- if ((temp.c_cflag & CRTSCTS) == CRTSCTS) ...
- But it turns out that, at least on Linux, CRTSCTS has a definition like:
- 020000000000
- which is liable to go negative, causing an 'if' condition like the one above
- to fail when it should succeed. Fixed in tthflow() by testing flags & CRTSCTS
- for 0 or non-0, rather than any particular value. ckutio.c, 29 Dec 99.
- The iksd log is full of references to a file called "//READ.ME" (two slashes).
- A little investigation shows that when C-Kermit is chroot'd (in SunOS), this
- is how realpath() returns names of files in the chroot'd root directory.
- Added a code snippet to collapse multiple leading /'s to a single one. Also
- noticed many references to a file called "getwd:_can't_open_.." in the log,
- also only when chroot'd; couldn't reproduce this but I suspect that realpath()
- is storing an error message in the destination buffer. I changed the code to
- zero the buffer if realpath() fails; let's see if this comes out in the log
- again after today. zfnqfp(): ckufio.c, 29 Dec 99.
- From Jeff: New ckctel.[ch] ckcnet.c ckcdeb.h more pleasing to DECC. 29 Dec 99.
- Added notes to ckermit2.txt about leading 0's in numeric IP addresses.
- 29 Dec 99.
- From Jeff: more X forwarding. ckcnet.c ckwart.c ckctel.c ckuus5.c ckuus3.c
- ckcdeb.h ckctel.h ckucns.c ckuusr.h ckuus4.c, 30 Dec 99.
- Removed definition of CK_FORWARD_X for UNIX from ckcdeb.h; we'll save this
- for C-Kermit 7.1. 30 Dec 99.
- Changed copyright dates to 2000. All modules, 30 Dec 99.
- Inserted the final copyright and permissions notice and disclaimer. ckcmai.c,
- 30 Dec 99.
- Removed Beta references from NEWS text; updated SUPPORT text. ckuus6.c,
- 30 Dec 99.
- Checked Lucas's bug (make a connection from CK on DU to IKSD, wait 10 min
- until IKSD times out & closes the connection, re-CONNECT, C-Kermit pops back
- because connection is closed, and now CBREAK mode is lost). Can't reproduce
- it on DU, SunOS, or anything else. But for safety's sake, added a new
- invisible command, SET COMMAND CBREAK, to force console into CBREAK mode in
- case it got lost. ckuus3.c, 30 Dec 99.
- Put the tx_lucidasub() routine in #ifdef OS2..#endif, since this is a fairly
- sizeable chunk of code used only by K95, and optimizers always complain about
- it. ckcuni.c, 30 Dec 99.
- George Gilmer determined that C-Kermit 7.0 Beta.11 can be built for NCR MP-RAS
- 2.03 and 3.02 by adding -DNOGETUSERSHLL and -DNO_DNS_SRV to the sys5r4sx[tcpc]
- targets, and uploaded the resulting binaries. Added new build targets and
- designer banner for MP-RAS, to be picked up next time around. makefile,
- ckuver.h, 30 Dec 99.
- Fixed a bug in UNIX zfnqfp() I introduced yesterday by copying the result
- to the wrong buffer, thus breaking file reception whenever backing up was
- necessary.
- After building on VMS 5.5, found that something had gone wrong with the
- "curses" (SMG) support. The first call worked, subsequent ones didn't. For
- example, Ctrl-L works the first time but not the second; the prompt comes out
- in the wrong place after the fullscreen file-transfer display. The Beta.11
- binary, however, works fine. Comparison of screen-related code in Beta.11
- ckuusx.c and in today's copy shows no differences at all. What happened? To
- make a long story short, I *forced* Ctrl-L to work by always calling initscr()
- before clear() and endwin() afterwards (refresh() too, though it doesn't make
- a difference). But SCREEN MOVE (move()) now behaves exactly like SCREEN
- CLEAR, and yes, we really are calling the correct SMG$blah routine. So I
- replaced the current ckuusx.c with the one from Beta.11 and rebuilt -- and we
- still have the same problems. As a final experiment, I rebuilt from the
- entire Beta.11 source set and guess what: this one has the same problems, even
- though the binary I built from exactly the same sources on exactly the same
- machine 24 days ago has no problems at all. Y2K jitters? It's only 30 hours
- away... Anyway, I changed back to the old, old MYCURSES code, despite the
- cautions in the comments. It works fine on both a fast Alpha and a sloooow
- VAXstation 3100 and cuts about 5K off the binary. ckuusx.c, 30 Dec 99.
- Next problem -- C-Kermit is not sending back the full pathname in its ACK when
- receiving a file if a file of the same name did not already exist. Similarly,
- fpathname(foo) no longer works if foo doesn't exist, but it did in Beta.11.
- After wasting several hours on this, I rolled back all the zfnqfp() changes
- from the past couple days; the only reason for them was to fix some glitches
- in the idsd log, which who cares. ckufio.c, 30 Dec 99.
- Next problem -- Unix traverse() really is too slow. People will hate it.
- Changed default value of FASTLOOKUP (variable stathack) to 1. ckuus7.c,
- 30 Dec 99.
- Added PROTECTION to HELP SET ATTRIBUTES. ckuus2.c, 30 Dec 99.
- Made sure that NOPUTENV was defined for not K95 or UNIX. ckcdeb.h, 30 Dec 99.
- More X forwarding from Jeff. 30 Dec 99.
- Trimmed trailing blanks from source files. 30 Dec 99.
- Made sure the result builds cleanly on VMS (net and nonet) and SunOS.
- Some final X forwarding and IKSD changes from Jeff. ckctel.c ckcnet.c
- ckctel.h ckutio.c, 31 Dec 99.
- David Sanderson reported that client commands that got short-form replies
- from the server (RCD, FINISH, etc) always failed. This was caused by the
- "Fixed a dangling case in the protocol state table" item from Dec 29; it
- wasn't dangling at all; fixed by removing the fix. ckcpro.w, 31 Dec 99.
- At the end of the Beta-test period, our census of binaries stands at:
- Beta 04 binaries: 9
- Beta 05 binaries: 20
- Beta 06 binaries: 6
- Beta 07 binaries: 25
- Beta 08 binaries: 19
- Beta 09 binaries: 21
- Beta 10 binaries: 70
- Beta 11 binaries: 179
- Total: 349
- After 2000 came in Russia (Leningrad) I transferred a 1988 file from here
- to there; the timestamp was correct. Then I touched it there to get the
- 1 Jan 2000 timestamp and transferred it back to NY, and this had the correct
- timestamp too. Later, same deal between here and Amsterdam. No problems.
- The pre-10.00 HP-UX builds were all done on systems that had their dates
- set back to 1971, so at midnight they'll turn over 1972, which has the same
- calendar as 2000 (and 1944). HINT: touch all source files after unpacking
- the tar archive :-)
- A reference to uidbuf[] needed to be #ifdef NOSPL. ckuus4.c, 31 Dec 99.
- DECC on DU 3.2 now dumps core on ckuus6.c with -O. makefile, 31 Dec 99.
- Binaries built 31 Dec 1999 - 1 Jan 2000.
- ---7.0.196 Released 1 Jan 2000---
- Minor fixes applied 2 Jan 2000, after binaries built but before announcements
- and final source-code packaging:
- 1. WAIT n FILE MODIFICATION did not fail if interrupted from keyboard.
- Interfered with IKSDPY: ckuus6.c.
- 2. Fixed NOICP builds by moving declaration of stathack from
- ckuus7.c to ckcmai.c.
- 3. Fixed SET FLOW help message when CK_DTRCD and CK_DTRCTS are defined.
- ckuus3.c.
- 4. Some authentication-related HELP messages updated, ckuus2.c.
- 5. Minor syntax corrections to telnet.txt, security.txt.
- 6. Minor corrections to introductory comments in several modules.
- 7. Server's response to GET xxx where xxx doesn't exist was changed from
- "No filespec given" to "File not found". ckcfns.c.
- 8. New makefile targets for NetBSD define DTR/CD and DTR/CTS flow control
- 9. Replaced "??-" in comments with "xx-" to shut the compilers up about
- trigraphs.
- 10. Replaced a missing comment terminator in ckcpro.w. This one could
- cause the following problem: when sending a file and failing to close
- it, the discard directive would not be sent. But it's hard to imagine
- a circumstance in which we would fail to close a file we just opened
- and read from successfully.
- 11. Enclosed an unguarded reference to the sj struct in #ifdef KANJI.
- ckcfns.c.
- SHOW VERSIONS of binaries built before these changes give a ckuusr date of
- 1 Dec 1999; binaries with these fixes show 1 Jan 2000 for ckuusr.
- ---7.0.196 Announced 3 Jan 2000---
- Added sinix541 makefile target for SINIX-L (i386) 5.41, plus designer banner,
- and added a couple #ifdefs to allow it to compile (it doesn't like fdopen()).
- makefile, ckuver.h, ckufio.c, 6 Jan 2000.
- Removed -O2 and added -DNODEBUG -DNOIKSD to the ultrix42c makefile entry;
- although it compiled OK, it got bizarre relocation errors at link time and
- this was the only (ok, first) way I could find to make them go away.
- makefile, 6 Jan 2000.
- Updated the ps2aix target for AIX 1.2.1 on the PS/2, and added a new
- ps2aixnetc target in the makefile. Had to put #ifndef PS2AIX10 around
- #include <netdb.h> in ckcnet.c, and add a prototype for ttyname() to ckutio.c.
- There's a warning about tlog() that's unavoidable (termio.h defines a tlog
- macro and we redefine it). OK, it's not really unavoidable... 6 Jan 2000.
- Added a couple new paragraphs to the ckermit2.txt section about coping with
- faulty Kermit implmentations. 6 Jan 2000.
- Changes for CLIX from Carl Friend. ckutio.c, ckcnet.c, makefile, 16 Jan 2000.
- Added makefile entry for SINIX 5.41. 16 Jan 2000.
- Changes from Joe Smith for SunOS 4.1 with X.25. ckutio.c, makefile,
- 16 Jan 2000.
- Changes from David Lane for Stratus VOS: ckcdeb.h, ckcker.h, cklfio.c,
- 16 Jan 2000.
- A couple new variations on the 3B2/3B20 makefile targets from Peter
- Mauzey. makefile, 17 Jan 2000.
- Text and binary filename patterns for VOS, and changes to VOS network module
- to allow building for X.25 but not TCP/IP, from David Lane. ckcmai.c,
- cklnet.c, 17 Jan 2000.
- Some changes to make C-Kermit compile on OSF/1 1.3. First there is some kind
- of foulup in the header files that turns off ANSI prototyping when C-Kermit
- thinks it should be doing it, so this had to be undone in ckucmd.c, ckcnet.c,
- ckucns.c, ckufio.c, and ckutio.c. Then in ckuusr2.c there was a string
- contstant that contained something like "/usr/share/kermit/*.*", which the
- compiler took to be a comment begin and so lost an #ifdef. This needed
- "rewording". Changed the dec-osf target to skip optimization and force
- static linking. 18 Jan 2000.
- Building C-Kermit 7.0 for OS-9/68000 on Steve Rance's Solaris 7 system in
- Australia using the xcc (Ultra C 2.0) cross-compiler (reportedly, Microware no
- longer supports development directly on OS-9, but requires cross-builds).
- This needed a new makefile, ck9xcc.mak. Notes (19-21 Jan 2000):
- . We can build wart but can't run it, so must touch ckcpro.c.
- Later I just took everything to do with wart out of the makefile.
- Later Steve changed the makefile to build wart for Sun and run it.
- . All ckc*.c and ckuus*.c build, and so do ck9con and ck9tio.
- . ck9fio.c blows up because of some inline assembly code.
- This was handled by changing #asm..#endasm to _asm("...");
- But we need to do this with #ifdefs to allow old way too?
- . ck9asm.a just builds, amazing.
- . ck9ren.c had to be removed from the makefile (not needed for this build).
- . References to {me,u}_binary in ck9con.c had to be updated to new macros.
- . Had to add NO_DNS_SRV.
- . Had to change <inet/...> to <INET/...> in ckcnet.h.
- But this was only for the cross compiler so I defined a new
- symbol OSKXXC for this.
- . Link step, libs, etc, needed changing/updating (termlib added).
- Steve Rance made various other edits, mostly changing the names of error
- symbols from E_blah to EOS_blah (should this be conditionalized? -- will
- it break "native" OS-9 builds?)
- Finally it built OK and runs on OS-9/68000 3.0.3. It can make a Telnet
- connection, transfer files, produce the fullscreen file-transfer display,
- produce file lists and do filename completion, etc; pretty much fully
- functional. I did find one glitch: any reference to the v(ipaddress)
- variable causes a crash, but only before any TCP connections have been made.
- I "fixed" this by #ifndef OSK'ing the code in nvlook() that calls
- getlocalipaddr(). ckuus4.c, 22 Jan 2000.
- To remove voluminous warnings (when -cw added CFLAGS), added CK_STDLIBS to
- OS-9 CFLAGS, but then had to put #include <unistd.h> within #ifndef
- OSK..#endif. Now it compiles cleanly except for the usual torrent of
- "variable declared (or set) but never used" warnings (because of all the
- #ifdefs), plus warnings about implicit declaration of a few functions,
- including alarm(), isatty(), getpid(), ustrncmp(), _ev_unlink(), and
- _ev_delete(); not sure what to #include to fix these but they should be
- harmless anyway. ckcdeb.h, 22 Jan 2000.
- Fixed a bunch of nontrivial warnings in ck9tio.c -- nested comments, use of
- uninitialized variables, and int conxxx() routines that did not return a
- value. 22 Jan 2000.
- The only serious remaining problem that I know about is: even though the
- TELNET command works just fine, SET HOST dies immediately with a stack
- overflow. Tried rebuilding ckuus7.c (the module containing the SET HOST
- code) without optimization but it made no difference. Will have to wait for
- OS-9 guys to fix this one; some magic incantation to increase the stack
- size? In the meantime we have a binary that's usable for most things (but
- unfortunately SET HOST is needed for scripting).
- Installed TCPware 5.4 on my Alpha and tried to build C-Kermit 7.0. Total
- disaster, horrible syntax errors in SYS$COMMON:[SYSLIB]DECC$RTLDEF.TLB;1 (not
- in Kermit code). Turned it over to Hunter Goatley. 21 Jan 2000.
- Steve Rance fixed the OS-9 problem by increasing the stack size. I cleaned
- up the source files to #ifdef all the recent changes that depend on Ultra C.
- ck9xcc.mak, ck9[tf]io.c, ck9con.c, 23 Jan 2000.
- Worked on BeOS 4.5. Got G-Kermit working in about 30 seconds. C-Kermit is
- harder because (a) no select(); (b) no curses; (c) no standard TCP/IP headers;
- and (d) no /dev/tty. The last was handled in a new way. Instead of using
- a hardwired string like "/dev/tty" for the controlling terminal as we have
- always done, I made dftty = NULL for BEOS and #define'd CTTNAM to be dftty.
- Then in sysinit I get the actual device name (like /dev/tt/p1) and make
- dftty point to it. Works like a charm. But I have no idea if we can dial
- out or anything... But I do have a C-Kermit 7.0 binary that transfers files
- in remote mode -- and FAST too! ckcdeb.h, ckutio.c, ckuver.h, makefile,
- 24 Jan 2000.
- Added SCO 3.2v5.0.2 makefile targets. 26 Jan 2000.
- Tried to build on 4.3BSD/VAX. Had to fix the KTARGET clause to avoid immediate
- failure with "sh: bad substitution". Fails miserably with "too many defines"
- in ckuusr.h. "make bsdm" gets a bit farther, but not much. makefile,
- 4 Feb 2000.
- Tried building 6.0 on on 4.3BSD/VAX; the 6.0 ckuusr.h is not too big. It
- built OK. 4 Feb 2000.
- Corrected KTARGET clauses in RT PC entries too. makefile, 4 Feb 2000.
- Back to 4.3BSD... Some old preprocessors just don't expect so many #defines.
- Yet there are huge blocks of #defines in ckuusr.h that are not protected by
- #ifdefs, e.g. #ifndef NODIAL for all the DIAL-related definitions. Added
- these in and tried building "bsdm". Then after working out some prototype
- conflicts (ttyname, hostent, servent, etc) and defining the needed -DNOblah's
- (realpath(), putenv(), ...) in the makefile target, the command-line-only
- version built OK. But the minimum interactive version (-DNOSPL) still won't
- build -- too many defines. makefile, ckuusr.h, ckutio.c, 5 Feb 2000.
- Migrated a few of the 4.3BSD changes into the RT PC AOS/ACIS/BSD targets.
- makefile, 5 Feb 2000.
- Added Stratus FTX targets to the makefile. 6 Feb 2000.
- Built on an SCO Xenix 2.3.4 TCP/IP development system assembled by Jeff
- Liebermann. This required addition of -DNO_DNS_SRV and removal of -lmalloc
- from the sco234netc target. makefile, 8 Feb 2000.
- To build C-Kermit 7.0 on BSD4.3, I tried the following trick:
- . Tar the BSD4.3 /usr/include tree and ftp it back here.
- . Make a bsd43 directory with an include subdirectory.
- . Untar the BSD include tree into the bsd43/include subdirectory.
- . Copy the C-Kermit 7.0 sources into the bsd43 directory.
- . Run the following shell script on them:
- for i in *.c; do
- echo $i...
- cc -E -DCK_CURSES -DTCPSOCKET -DBSD4 -DNOREALPATH -DNOTIMEH
- -DSYSTIMEBH -DNOIKSD -DNOPUTENV
- -I./include $i > $i.e
- rm -f $i
- grep -v "^#" $i.e > $i
- done
- . FTP the results back to the BSD system.
- . Give the regular "make bsd43c" command.
- It almost worked except SunOS cpp seems to have a 1K buffer limit for macro
- expansions, and certain macro expansions from stdio.h need more than 1K.
- So I redid it with gcc instead of cc. A quick check seems to indicate no
- macro expansions were truncated. Sent the results back to BSD. Still no
- good. In ckucmd.c, routine cmdecho(), was a line:
- putchar(BS); putchar(SP); putchar(BS);
- The expansion of putchar() is quite long, and three of them in a row resulted
- in a line that was truncated by cpp -- even in gcc! The solution was to put
- them on separate lines (so the problem is cpp's output-line buffer). Then the
- bit in traverse() that checked the inode needed a BSD42 #ifdef. The whole
- thing compiled and linked OK, and works fine: Telnet, curses, and all. Since
- the preprocessor ran on a Sun, I also had to change the v(cpu) and SHOW
- FEATURES processor constants from "sparc" to "vax" by hand. ckuus[45].c,
- makefile, ckufio.c, 8 Feb 2000.
- For the record, here's the final 4.2BSD script that uses gcc (the changes are
- just to disable ANSI prototyping, void, etc). The non-gcc one might still
- work, however, now that the putchar() line is unfolded:
- cp <sourcepath>/ck[cu]*.[ch] .
- rm -f ckustr.c cku2tm.c ckcmdb.c
- for i in *.c; do
- echo $i...
- gcc -E -DCK_CURSES -DTCPSOCKET -DBSD4 -DNOREALPATH -DNOTIMEH
- -DSYSTIMEBH -DNOIKSD -DNOPUTENV -DNOANSI -DBIGBUFOK -traditional
- -I./include $i > $i.e
- rm -f $i
- grep -v "^#" $i.e > $i
- done
- Ditto for 4.2BSD. Note that 4.2 and 4.3BSD on VAX are binary compatible. The
- only difference to Kermit is whether the acucntrl() program is called to grab
- a dialout line. 8 Feb 2000.
- In response to a sudden rash of complaints about failure to build on AIX 4.3.0
- because of:
- ld: 0711-781 ERROR: TOC overflow. TOC size: 70908 Maximum size: 65536
- Did some digging and discovered the "-bbigtoc" ld option for AIX. But it's
- strange that this was necessary, since the same code was built successfully on
- AIX 4.1.3, 4.1.5, 4.2.1, 4.3.1, 4.3.2, and 4.3.3 without these changes. Also
- upped -qmaxmem to 16000 since the previous value of 8000 gave failure-to-
- optimize warnings (so did 12000). makefile, 8 Feb 2000.
- Still on AIX... Here's a good one. Look at the following code from ckcpro.w:
- } else if (x == -1) { /* EOF - finished sending data */
- debug(F101,"<ssdata>Y cxseen","",cxseen);
- window(1); /* Set window size back to 1... */
- if (clsif() < 0) /* Close input file */
- cxseen = 1; /* Send EOF packet*/
- debug(F101,"<ssdata>Y CALLING SEOF()","",cxseen);
- seof(cxseen||czseen);
- BEGIN sseof; /* and enter send-eof state */
- }
- In AIX, this produced the warning: "'/*' detected in comment". When I
- inserted a space in "packet*/" the warning went away. This would suggest that
- the last three statements in the block were not being included in AIX builds.
- But if that were true, sending files wouldn't work. But sending files does
- work. ckcpro.w, 8 Feb 2000.
- Added -DHUP_POSIX to unixware20 target to fix nonfunctional HANGUP command
- (fix verified by Clarence Dold). makefile, 8 Feb 2000.
- Added tru64-40f target since we already have a tru64-40e and tru64-40g.
- makefile, 8 Feb 2000.
- Changed help text to not refer to a specific edition of the C-Kermit book.
- ckuus2.c, 8 Feb 2000.
- Changed version number to 7.0.197. makefile, ckcmai.c, 8 Feb 2000.
- --- 7.0.197 ---
- ******************
- (Build list moved from here to ckx196.txt, 18 Oct 1999).
- ------
- (End)