C-Kermit Version 4E(067): Status, Bugs, and Problems As of: 12:33pm Monday, 7 December 1987 See ckuker.upd for a list of changes since the last release. 4E(066) was a beta test release. It was tested at Columbia on various VAXes running Ultrix 1.2 and 2.0 (4.2 and 4.3 BSD equivalents, more or less), a Pro-380 running 2.9BSD, and an AT&T 3B20 running Sys V R2. The Unix versions need testing, especially in local (dialout) mode on SUNs, PC's with Xenix, etc. During the beta test, users reported that it worked on the Macintosh, on VAX/VMS (once a the definition of syscleanup() was supplied in CKVTIO.C), on Xenix systems once some extra #includes of "file.h" were removed, on the Pyramid once a minor change was made to ckutio.c, and various other systems. 4E(067) just applies these fixes, so that it can replace 4D(061) as the standard distributed version. See ckuker.upd for details. -- SUPPORT FOR DIFFERENT SYSTEMS: -- 4.2BSD: "make bsd" works. Should work on VAX, SUN, Pyramid, Convex, & others. 4.3BSD: "make bsd" works. 4.1BSD: "make bsd" should work for this too (did not in C-Kermit v4.2). 2.9BSD: "make bsd29" works, at least on Pro-380. Should be the same for 2.8. Version 7: works ok on the systems tested so far using "make v7", but some fiddling with the make file is necessary for proc table definitions; see the makefile and also ckuv7.hlp for details. PC/IX: should work ok with "make pcix". ATT 3Bx systems: should work ok with "make att3bx". Xenix: This word no longer means anything specific. Is it an old Xenix that looks like V6 or V7 Unix? Is it a System-V-like Xenix? Is it IBM's, or SCO's, or somebody else's, and which Xenix version is it, and which compiler version? Look at your system's documentation to see what's really hiding under the name Xenix and use the appropriate make option. Usually 'make xenix' or 'make sys3' work, so long as you're using the most up-to-date version of C-Kermit, 4D(061) or later. HP Integral PC -- "make sys3", but either remove code that sets up lock files, or have the lock files put in a directory that is guaranteed to be there, like /tmp. Some problems reported when running under csh. AT&T System V R3 has redefined the type of the signal() function. Use "make sys5r3". If that doesn't work (as reportedly it does not on certain recent Xenix systems), "make sys3" or "make xenix". Most other System V or System III based systems can build a working Kermit with "make sys3" or "make sys3nid" or "make att3bx" or (for Sys 5 R3) "make sys5r3". PDP-11's running a System III or V based Unix and which have no I & D space should use "make sys3nid". DEC Pro-350 or -380 with Pro/Venix V2 (not V1) -- uses the regular "make sys3" or "make sys3nid", but the file ckcfio.c might have to be edited first to reduce the value of MAXWLD and/or SSPACE. See below under HINTS for details. Valid Scaldstar CAD system -- There's a "make valid" in the makefile, but reportedly one thing is still lacking: ckutio.c needs to #include. For other Unix systems, see the makefile, and for further notes, consult the messages appended chronologically below. VAX/VMS: support added by Stew Rubenstein at Harvard and Martin Minow at DEC. Has to be built with CKV*.COM, needs development to handle all the VMS/RMS features and to improve performance. See CKV*.*. VMS-specific bugs in CKVKER.BWR. Somebody is working on upgrading the VMS support. Macintosh: Support originally added at Columbia for SUMACC C cross compiler. Has own makefile, etc. Adapted by Jim Noble of PRC to compile under Megamax C directly on the Mac. See CKM*.*. SUMACC no longer supported, only Megamax. Hope someone will convert to MPW or Lightspeed C as well. Commodore Amiga: Support added by Davide Cervone, U of Rochester, later replaced (with Davide's consent) by new code from Phil Julian & Jack Rouse of SAS Institute. See CKI*.*. -- HINTS -- - If the program dies with a message like "malloc fails in splitpath()" whenever it tries to parse a filename (as in the "send" command), then the amount of space allocated for filename expansion in the module ckufio.c must be reduced. This can be done by changing the #defines for MAXWLD (the maximum number of filenames) and SSPACE (the size of static string space) to make the numbers smaller. - When modifying or writing Kermit code, do NOT pass to a function (e.g., "signal") the address of a static function. Doing so may break VENIX code mapping. If you must pass the address of the function, make it global and pick a "non-generic" name for it that will hopefully be unique and yet informative. -- BUG LIST -- First, a disclaimer must be made. C-Kermit attempts to support all post-V6 Unix variations on all machines. This is a tall order, and requires careful attention to certain details. As changes are made (and C-Kermit is still in stage of fairly rapid development), there is always the chance that a change -- made to introduce a new feature or fix a bug -- will not work as intended on some systems, even though it was tested successfully on others. The main area to watch out for is not system differences (which are handled fairly well in the system-dependent ck?[ft]io modules), but in compiler differences, especially int/char confusion. Characters should be stored in variables of type char, not int, and char/int conversion should be avoided because of problems introduced by sign extension. And i/o should not be used to read characters into int variables, because the way in which the system stores the character in an int varies from system to system (e.g. 68000s put them on the left, the VAX on the right). If you have received a C-Kermit release that does not work correctly (except for the bugs & restrictions noted below), it is not because the release was not thoroughly tested -- it was -- but because it was not tested on your system since the last time changes were made, because of a lack of such a system to test it on. If this happens to you, please try to track down the problem and report as specifically as possible back to Columbia. General problems: - The program is too big, with too many features; source is too large to fit on some disks. Needs to be reorganized so that a minimal Kermit can be built for any system, and then frills can be added on if desired -- interactive command parser, help strings, dial command, script command, etc. - There's not a full enough set of features available from command line invocation. Commands like "bye" are missing. This is mainly to keep the "kermit -h" help message small enough to fit on one screen. - Conditionalizations are not done clearly. In some cases it might be better to have compile-time flags for features, rather than systems, or generic system names, rather than specific vendor/machine names, to avoid excessive nesting or repitition of compile-time variables. Constructions like "#ifdef FOO | BAR" are avoided because many compilers don't understand them; the alternative is to repeat code under different conditionals (to accomplish an OR) or to include it within nested conditionals (AND), sometimes applying De Morgan's law to achieve the desired result... - Program's return code might be wrong in some cases (in 4.0, it was always zero; in 4C some attempt is made to return correct codes for failure and success). Actually, no attempt has been made to correlate return codes with success or failure of file transfer -- a bad return code only reflects a fatal error. - On some systems (e.g. TRS-80 Model 16 with Xenix V7, or HP-9000 HP-UX) C-Kermit reportedly runs VERY SLOWLY. The program could certainly do with some tuning -- but not at the expense of modularity and transportability! -- but in the meantime, it can probably be sped up a lot by removing the -DDEBUG from the makefile, eliminating hundreds of function calls, many of them in critical code (one user reports a 1250% improvement doing this on the TRS-80 Model 16!). Another speedup could come from allowing more systems to take advantage of "myread()" -- the nonblocking version of read(); see below. (4E fixes this to a great extent with rewritten ttinl(), elimination of inlin(), etc.) - In reality, TANDEM flow control (XON/XOFF) is not really done on most systems, because Kermit opens the communication line in rawmode, which has the side effect of disabling flow control. Rawmode is used in order to allow 8-bit data. Using cooked mode & CRMOD would be possible for text files, but 8th-bit prefixing would be required for 8-bit binary files. But at least this would allow in-band flow control to take place. Allegedly, 4.3BSD and Sys 5 R3 allow XON/XOFF and rawmode to coexist, but this hasn't been verified. It doesn't seem to happen on Ultrix 2.0. - Need 'set' command for server timeout. - The timeout interval is not automatically adjusted according to the packet length. - The program could be a little bit less cavalier in its treatment of files. For instance, when receiving a file (with "warning" turned off) it will overwrite any existing file of the same name. That's ok, but what if the user types ^F or ^B to interrupt the transfer? This does not save the existing file -- it's already been destroyed by the open() of the new copy, which in turn is discarded as a result of the interruption. Maybe Kermit should always make a temporary, unique name for incoming files, and then rename them to their real names only after the transfer is complete. But that's no good on systems (like the Macintosh) that don't have disk space to burn. - Local versus remote mode is not, and probably can not, be determined automatically upon startup. For instance, if you build Kermit with "make sys3" on a 3B20 and a 3B2, the program has no way of knowing whether it's running on a timesharing system (the 3B20, where it should be remote by default) or a workstation (the 3B2, where it should be local by default). If you find that Kermit comes up on your system in the wrong mode, you can put the appropriate "set line" command in your .kermrc file -- "set line /dev/tty" SHOULD always put you in remote mode. (Actually, problems have been reported for this on some systems that support incoming X.25 connections on pseudoterminals.) - If the program crashes or is halted (killed) from outside while it has the terminal in a not-normal mode during command parsing or file transfer, the terminal mode is not restored, and lock files are not cleaned up. There can be no fix for this within C-Kermit itself. Subsequent Kermit runs may still fail because the device is already opened by "another process" (you have to log out & log in again to clear this one up). - The shell's interrupt, delete, and kill characters may interfere or conflict with those used by the Kermit command parser. In any case, there is no way to change Kermit's editing characters to conform to user's taste. - "!" command requires a space after, contrary to the Unix user's normal expectation. - Many people have asked for a system-wide startup file similar to the user's .kermrc file, perhaps with a conditional way to escape from it if the user has her own .kermrc file. This notion might be extended to include the entire hierarchy system -- home -- current directory. - Some users report that it would be more desirable to have an error during execution of a take file return directly to command level, rather than pop to the invoking take file, in case the error in question is of such severity that it would cause all subsequent commands in the stack of TAKE files to fail. Best to have a SET command to control this behavior. (This desired behavior does occur -- or at least should occur -- when the program is in the background.) - Some users report that the program should make no internal distinction between running in foreground or background, so that program exit codes are consistent, making it easier to debug shell scripts that invoke Kermit. - Speaking of background, not all systems seem to define it the same way. If your prompt disappears, you probably have one of those systems. See function conint() in ckutio.c, and try to figure out what's amiss. - Speaking of conint(), it has been reported that there may be something wrong with the way Unix Kermit responds to hangups. Although it traps the SIGHUP signal and cleans up and exits when a phone connection drops, some users report that the line is unusable after that. - Also in conint() -- There seems to be no way to suspend the Kermit program, e.g. with ^Z under the C-Shell. - Since Kermit opens and closes the communication line with each command line invocation, it is not convenient to use it in scripts in which it is repeatedly invoked (e.g. a print spooler). - Opening & closing a comm line selected with 'set line' involves the use of UUCP "lock files", whose use is inconsistent from one Unix variation to another, and from site to site and system to system. The lack of a consistent, reliable way to get guaranteed exclusive access to a communication is one of Unix's biggest shortcomings. - There very little provision in the program (as yet) for running setuid. Nor for dealing with bidirectional terminal lines. Nor with system-provided dialer programs. Every system does these things differently. - Variable names are sometimes confusing, especially the send/receive parameter pairs (spsiz/rpsize, mystch/stchr, npad/mypadn, rtimo/timint, etc). This is mostly history... they tend to agree with the names used in other Kermit programs. Still, they should probably be changed. Ditto for some of the procedure names. - Some C compilers do not support variable names longer than 6, nor function names longer than 5, and some are not case sensitive (one DEC-20 C compiler has all these restrictions, and the V6 Unix C compiler has some of them). To ensure the widest possible portability, all identifiers should comply with these restrictions -- currently many do not. - When the C-Kermit server is given a host command (or even some generic commands like 'space'), it might have to think for a long time before returning output. In this case, it should set a timer while waiting for input from the fork and whenever the timer goes off, it should send a null data packet to prevent the other Kermit from timing out. - When connecting back to C-Kermit after a transaction, or after finishing the server, it may be necessary to type a ^Q to clear up an XOFF deadlock. There's not much the Kermit program can do about this... - When interrupting a send with ^F or ^B, an appropriate message does not seem to make it into the transaction log. - The transaction log should record file type (text or binary). - There should be a nonverbose transaction log, in the Unix tradition, which can be read by another program. For instance, if Kermit is used to 'send *', but only certain of the files make across successfully, another program could read the list of those files and do something to them (like (re)move them). ckucmd.c: - Interactive Kermit commands that come in from a pipe (as in "cat foo | kermit") are echoed. Some people think they should not be. The fix can be made (at some expense) in getwd() by adding a line to the first if () {} block, "if (!isatty(0)) echof = 1;". (Not sure if this is still true...) ckufio.c: - ckufio currently goes to a lot of trouble to traverse the directory in order to expand "*" and "?" in wildcards. Maybe it should just fork the user's customary shell and have it do the expansion. This would allow fancier filespecs to be given, like "~/ck*.[cwh]". But it would slow down features like filename completion and menus in the interactive command parser. (Find out how Unix FTP does it...) ckutio.c: - Myread() should be expanded to include systems that can't do nonblocking reads, but can find out how many characters are in the input buffer -- this would eliminate calling read() in a loop for each character during packet transmission (e.g. Pro/Venix V1 could use "ioctl(x,TIOCQCNT,&y)", V7 could use its buffer-queue-peeking trick, etc). (Myread() was eliminated from BSD, and the same technique is used as in ckucon.c -- do a single-char blocking read, then check how many more chars are in the buffer, then read that many -- it's faster.) - There should be a timed option for ttoc() for use during connect so you can escape from XOFF'd or other stuck conditions. - There's no good way to select baud rates higher than 9600. Most Unix systems don't supply symbols for them (unless you use EXTA, EXTB), and even when they do, the program has no way of knowing whether a specific port serial controller supports those rates. - Use of RAW|TANDEM in 4.1 BSD gives only unidirectional, not bidirectional, flow control -- xoff's from the terminal are treated as data rather than control signals. Symptom: possible loss of characters during CONNECT. - On some systems, there is an undesired interaction between the various open() modes, fnctl(), and ioctl() invocations when modem-control lines are involved. Some of this due to bugs in some Unix implementations or to inconsistencies between them (e.g. as to the behavior of TIOCEXCL, etc). In particular, the whole business about opening modem-controlled lines with O_NDELAY before dialing and then switching modes after causes no end of confusion and trouble. ckudia.c: - Some systems do not allow users to manipulate dialers directly. - Should support a "phone book" (this would actually go in ckuus*.c). - Pro/Venix V2 (and some other Sys V-based systems) are having DTR-dropping problems when dialing. With Pro/Venix V2, a workaround is to get the system to ignore the modem control signals and treat the line as a direct line by issuing a "setline -d xxx" command, where "xxx" is the device node (e.g. com1), rather than "setline -m xxx". - Should do "demon dialing" (keep trying till there's a connection). ckuus*.c: - When an alternate filename is given for an incoming file name, and the alternate name is uppercase, the name is lowercased. Alternate names should be taken literally. - Baud rate selection currently requires user to type a number, which is then verified against a system-dependent table. Better to have a baud rate keyword (cmkey) table defined in the system-dependent module, so user can abbreviate (e.g. '9' for '9600'). Also, it's a pain having parallel tables in ckuus3.c, ckutio.c, etc. Should consolidate this. - No way to put trailing comments on commands. - ckuus2.c reportedly makes the C optimizer run out of space under PC/IX and some other systems. Protocol (ckcpro.w, ckcfn*.c): - No way to interrupt a protocol transaction until after it starts successfully. For instance, no way to interrupt the timeouts and retransmissions of the initial packet when the other side is not responding, except for killing the whole program. Cure: check for keyboard "interrupts" during the send-init process, set c[xz]seen. But doing this will make the state table a lot more complicated... Maybe change ^C trap to get back to command mode rather than exit the program. ckucon.c: - Doesn't do any particular kind of terminal emulation. It wasn't meant to. Filters can be used for this. Or a replacement module can be written (as has been done for the Macintosh). - When sending BREAK, should clear output buffer first (this is done in BSD, should be added for other systems to ttsndb() in ckutio.c). - Performance is poor on systems that can't check the input buffer or do nonblocking read() calls. See the horrendous code that was added for V7 to get around this (peeking into tty buffers in kernel memory). - As structured, connect mode can't include commands to toggle logging on and off or to change settings, because the fork that reads keyboard input doesn't share variables with the fork that does port i/o. - Reportedly, a control-S typed at the keyboard doesn't always seem to "take" when doing terminal emulation under Pro/Venix V2 (DEC micros, terminals, devices, systems are notorious for their insistence on doing XON/XOFF and attendant problems. Remember the VT180?) - Should have a shell escape ("push"). ------------------------------ Undigested: Date: Sun, 24 Nov 85 04:16:02 CST From: Stan Barber Subject: more notes on C-kermit 4C(057) Organization: Neurophysiology, Baylor College of Medicine, Houston, Tx One more suggestion: I would provide some mechanism to allow SYSIII compatible sites to configure what signal that might like to use to allow the child and parent to notify each other of problems. At my site, SIGUSR1 can not be used by kermit, so I modify ckucon.c by replacing SIGUSR1 with SIGUSR2. That fixes everything just fine. At least a warning should be noted somewhere (in the .bwr file, I guess) so that people will know to change it. Alternatively, I would suggest a unique name (SIGKERMIT) that the installer can define in the makefile (e.g. -DSIGKERMIT=SIGUSR2) to keep people from mucking in the source file. ------------------------------ Date: 9 Apr 1986 1105-EST (Wednesday) From: Vic Abell Subject: Kermit and 4.xBSD rlogin There is an undocumented option on the 4.xBSD rlogin call that must be used when C Kermit is at the end of a TCP/IP rlogin connection. The option is "-8" and should be used in the following fashion: % rlogin hostname -8 % kermit Vic Abell, Purdue University Computing Center abe@asc.purdue.edu, ...!pur-ee!pucc-j!abe ------------------------------ Date: Fri 5 Sep 86 13:59:44-EDT From: Fred Wang Subject: problem compiling kermit on the 3b2/310 If Mr. Ray's 3b2/310 is running the new C compiler (CFP+) he will run into problems when he issues the 'make att3bx' command. CFP+ uses the 'fpcc' rather than the conventional 'cc' to compile C programs. My suggestion to Mr. Ray's problem (if indeed he has CFP+) is to substitute fpcc for cc in the variables CC and CC2 in the makefile text. This worked fine for my 3b2/310 running Unix System V 2.0.4 with CFP+ C compiler. ------------------------------ Date: Fri, 12-SEP-1986 18:54 EDT From: Kuryan Thomas Subject: C-Kermit To: fdccu@cuvmb This is Kuryan Thomas at Virginia Tech again. I talked to you about the modem problem I was having with my 6300plus. I think I found the problem -- tthang() does an ioctl() call to clear the CBAUD field, which ought to cause a hangup. On my system, ioctl() doesn't like to be called with a zero baud, and returns -1, which causes tthang() to return an error. I think this may be why I always get a "Warning, problem hanging up the phone" whenever I exit Kermit (regardless of the "set modem" setting). I don't know how to cure this, but I'm not going to try. I think I prefer the "aberrant" behavior. This way, I can start a session on a remote Kermit, start its server, come back down to my shell, and start a long file-transfer in the background. This wouldn't work if Kermit could hang up the phone, because I'd have to use Kermit interactively. I often transfer quite large files, and it's actually an advantage instead of a bug that C-Kermit can't hang up my phone! Amazing how problems can be turned to your advantage, isn't it? Thanks for replying to my earlier message. ------------------------------ Date: Mon, 15 Sep 86 21:35:48 CST From: rice!sob@soma.BCM.TMC.EDU (Stan Barber) To: info-kermit@cu20b.columbia.edu Subject: NEWUUCP conditional in C-KERMIT You do need to define the NEWUUCP conditional to get the 4.3 acucntrl support. Also, lock files are now kept in a seperate globally writable LCK directory so unpriviledged programs can LCK lines without have write permission on /usr/spool/uucp. This will keep uucp from stomping on kermit. Stan (NEWUUCP is currently not defined anywhere, so this code never gets used) ------------------------------ Date: Fri, 17 Oct 86 15:17:14 EDT From: Chris Maio To: sy.fdc@cu20b.columbia.edu Subject: telnetd "fix" [Ed. - The following fix allows C-Kermit to work with 4.3BSD systems which are accessed via TCP/IP-based terminal servers. The fix is to TELNET, not Kermit. Thanks to Chris Maio of the Columbia University Computer Science Department for tracking down the problem and providing a workaround.] This fix for /etc/telnetd in 4.3 BSD is really only a workaround, designed to allow kermit, uucp, emacs, and other programs to receive carriage-return chararacters over a "netascii mode" telnet connection where the client is mapping carriage return to CRLFs (what I suspect to be the most common case for terminal servers and non-UNIX telnet implementations). The real solution is to use telnet binary mode connections, but not all telnet clients allow the user to negotiate this. In /usr/src/etc/telnetd.c, routine telrcv(), line 640, replace c = '\n'; with c = '\r'; This fix is inappropriate if you have telnet clients which map CR into CR NUL, and LF into CR LF, since those clients will then be unable to generate send the linefeed character through to the application when CRMOD is turned off. See RFC 854 for more details. The basic problem is that any program that manipulates the terminal will generally only work right if the telnet connection is "binary mode" (remember those odd commands you have to give to a TAC?). Many telnet user interfaces, including the terminal concentrators we use, don't provide a way for the user to specify binary mode instead of netascii mode. TOPS-20 is a lot smarter about this kind of thing, e.g. it negotiates telnet binary mode when a program running on a TVT specifies binary input from its controlling terminal, but I'm sure there are still bugs in TOPS-20's implementation. Chris ------------------------------ Date: Wed, 7 Jan 87 00:55:42 EST From: nelson@NLM-VAX.arpa (Gary Nelson) Subject: Xenix on IBM-PC/AT & SCO Xenix V Keywords: Xenix, C-Kermit, SCO Xenix In response to request for users of C-Kermit 4D(061) on SCO Xenix: My configuration: IBM-PC/AT SCO Xenix Release 2.1.3 (Update E & F) The dial command did not work after updating to the release of SCO Xenix V. The following diff file corrects problem in ckutio.c that broke the dial command. Note, if you are on SCO Release 2.1.0 - DO NOT include this fix, leave the 4D061 version as released alone - it works fine. The nap() mod is not neccessary - just saw it and changed it to use an available facility. ********** start of diff file ********** 14a15,27 > /* Modification history: > > 23-NOV-86 Gary B. Nelson, Nelson Associates, Manassas, VA > As a consequence of my new release of SCO Xenix V2.1.3 > breaking kermit: > Mods to msleep to use nap(), note -> add "-lx" to > LNKFLAGS in the makefile. > Mods to tthang to make it work again, with this new release > of XENIX (symptom was that the dial command > stopped working, a problem that was incorrectly > diagnosed by ?? as seen on the usenet a few days ago). > */ > 527d539 < #ifndef XENIX /* xenix cannot do close/open when carrier drops */ 532d543 < #endif 1416,1418c1427 < #ifdef XENIX < #define CLOCK_TICK 50 /* millisecs per clock tick */ < #else > #ifndef XENIX 1420d1428 < #endif 1431a1440,1446 > #endif > #endif > > #ifdef UXIII > #ifdef XENIX > nap( (long) m ); > #endif ********** end of diff file ********** ------------------------------ Date: Tue, 11 Aug 87 17:00:12 EDT From: MATTHEWS Subject: New xkuker (C-Kermit) Bugs on Pyramid Keywords: C-Kermit, Pyramid I have found a problems with the newest version 4E(066) of kermit. Here is what happens when you try to run it on Pyramids version of UNIX (OSx). Script started on Sun Aug 9 23:56:57 1987 udccpyr1% cd udccpyr1% cat .kermrc echo echo set file type BINARY set file type BINARY echo set file names LITERAL set file names LITERAL echo set prompt "C-Kermit@pyr1>" udccpyr1% cd /usr/tmp/kermit udccpyr1% ./wermit set file type BINARY set file names LITERAL C-Kermit, 4E(066) 4 Aug 87, 4.2 BSD Type ? for help set file type binary 8 bad ?Invalid - bad Fatal: Kermit command error in background execution udccpyr1% script done on Sun Aug 9 23:58:00 1987 I get no prompt or anything, it just exits with this error message. It appears as though it thinks I want to run it in the background. I compiled kermit the same exact way with the "bsd" flag on both machines and it does different things on each one. [Ed. - I noticed some similar behavior on a system running 2.9BSD. The problem can be traced to the conint() function in xkutio.c, where the program attempts to determine whether it's running in the background by testing some signals, etc. Apparently, there is no universally valid way (at least none that I know of) for doing this, so the same test will give different results on different systems. If Kermit thinks it's running in the background, then errors in 'take' files (including .kermrc) are fatal. Unix wizards are invited to take a look at the conint() function and suggest a better way of checking for background operation.] John Matthews ------------------------------ Date: Sat, 29 Aug 87 15:37 EST From: (Rick Pim) Subject: C-Kermit 4E Amiga .BOO File Keywords: C-Kermit, Amiga The Aug 7 info-kermit digest mentioned a new release of C-Kermit for, amongst other things, the Amiga. According to the directory I looked at of cki* *, the BOO file is new. The digest requested comments/etc, so I ordered the BOO file and decoded it today. According to the header once it's running, the version is 4D. It has at least one of the same bugs as 4D (parity does not work). [Ed. - Right, we don't have an Amiga .BOO file based on the new version yet. We were hoping somebody would make one. See next message.] ------------------------------ Date: Wed, 12 Aug 87 10:25:42 pdt From: cit-vax!ametek!walton@RUTGERS.EDU (Steve Walton) Subject: C-Kermit 4E(066) on Amiga Keywords: C-Kermit, Amiga Well, I grabbed C-Kermit 4E(066) from CU20B, and have been able to compile and link a running version on my Amiga using Manx Aztec C V3.40b. In the process, I added the appropriate include files and the DOSFH and FILENO macros for Manx C to ckiutl.c and ckitio.c; diffs will follow shortly. (One thing which was easy: parity can be ignored in ttinl(), since the Amiga's serial.device handles it itself, and passes characters to Kermit with the parity bit already stripped.) Stephen Walton, walton@ametek.UUCP Ametek Computer Research Div. 610 N. Santa Anita Ave. Arcadia, CA 91006 USA 818-445-6811 ------------------------------ Date: Thu, 3 Sep 87 08:26:14 EDT From: Marshall_DeBerry@um.cc.umich.edu Subject: C-Kermit 4E Problems on Tandy 16A/6000 and Arete 1200 Keywords: C-Kermit, Tandy 16A/6000, Arete 1200 I've tried out the new 4E(066) release on a Tandy 16A/6000 and Arete 1200 under System V.2. One problem I've noticed is that if you try to get the status of the transfer, as soon as you type Cntrl A, the transmission begins to send %T's, and eventually times out. This was during file transmissions between the Arete and MTS Kermit. It was also reproducible between the Arete and Tandy machines. [Ed. - This sounds like something pretty specific to your machine; Ctrl-A status reports work ok on the machines we've tested. I hope you can track it down.] The program compiled cleanly on both machines, except that on the Tandy end (running under Xenix 3.1.2), I had to include for one of the files in which void is used. ------------------------------ Date: Mon, 17 Aug 87 21:45 MDT From: (Joe Doupnik) Subject: C-Kermit 4E Feedback Keywords: C-Kermit, ATT Unix PC A couple of comments on the new test C Kermit: 1. signal() returns type "int" on my Unix PC running AT&T sys5r3, just like everyone else, yet the conditionals in the code specify "void" for only sys5r3. So here we have an exception to the cast in steel Standard Edition of Unix from the horse's mouth. Btw, release 3 here means 3.0 whereas in-house at AT&T they are up to 3.5 at last reading. [Ed. - Oh, so sys5r3 is not the same everywhere... Well, since the type cast for signal() is the only difference in Kermit between sys5r3 and sys5r2 (or, for that matter Sys3), then use "make sys3" or "make sys5" (which is an alias for "make sys3").] 2. The file statistics display indicates files are always transferred with type 1 block check, even though I have type 3 set in both .rkermit and on the remote machine and sometimes set it that way by hand in C Kermit. [Ed. - Can't reproduce this.] 3. When the dust settles Lint (no pun intended) ought to be run across the code to pick up the loose ends. My Lattice C compiler on the AT machine is more picky than the standard Unix compilers and lets me know to do better next time, sigh. You'd think it wanted us to be (gag) Pascal programmers. On the other hand, you may have done so and we are seeing Unix vs ANSI in action. Can't win either way. [Ed. - Done for edit 67. Still lots of minor complaints, but a few potentially serious mistakes were uncovered.] 4. Otherwise, it works just great! Throughput is way up. Whereas the previous release yielded about 10-12Kbaud across STARLAN to my AT this version indicates 18+Kb the same way. That's with 1000 byte packets. Regards, Joe D. ------------------------------ Date: Sat, 5 Sep 87 18:06:19 EDT From: David Herron E-Mail Hack Cc: R@ms.uky.edu Subject: Re: 4E feedback Joe Doupnik of USU.BITNET says "signal() returns type 'int' on my Unix PC running AT&T sys5r3 ..." He's getting confused over the numbering scheme(s) for SysV's. The SysV on the Unix PC is NOT the same SysV as the mainstream that is currently up to SysVr3.1 (i.e. a little past SysVr3). The SysV there started as Convergent's port of SysVr1 (or r0, since they hadn't subdivided SysX's into "releases" at that time) ... This port was different from the standard SysV of the time (for instance, it had full-fledged virtual memory ... something which didn't get into the mainstream SysV until one of the sub-releases of SysVr2). The current version of Unix PC SysV is 3.5.1. It has had some SysVr2 features tossed in and eventually may be re-integrated with the mainstream versions, but is still a different version of Unix. Hope this clears up some confusion -- you may want to put these remarks into a README of some sort in the CKermit distribution. BTW, some people here had fixed up a CKermit which worked well with the Unix PC's, but they didn't think about sending in their code. I'm going to point them at this experimental version and get them to re-do their stuff for this version... and by-golly, I think they'll send in their stuff to y'all this time around too ... :-) David Herron, Local E-Mail Hack, david@ms.uky.edu, david@ms.uky.csnet {uunet,cbosgd}!ukma!david, david@UKMA.BITNET Je parle francais comme une vache espagnole. ------------------------------ From: sob@watson.tmc.edu (Stan Barber) Subject: C-Kermit Lock Files Date: 20 Aug 87 21:26:17 GMT Keywords: C-Kermit, Unix Lock Files I should point out that C-Kermit(041) does handle lock files correctly under BSD4.3 with the 4.3UUCP locking structure. This creates a lock directory (/usr/spool/uucp/LCK) that is publically writable and each program (except kermit) using the locking protocol is smart enough to test for dead locks (coming from programs that aborted and did not remove its lock). Stan [Ed. - Presumably, this is also true for 4E?] ------------------------------ Date: Mon, 14 Sep 87 19:12+0600 To: fdccu%cuvmb.BITNET@CUVMA.COLUMBIA.EDU Subject: C-Kermit 4e(066) Fixes From: Darren R Besler This is in regard to the experimental version of C-Kermit, version 4E(066). The installation here at the University of Manitoba is the following: Processor: Amdahl 5870 Oper Sys: UTS/V running under VM Comm Ctlr: Amdahl 4705 Due to the above machine configuration we are running UTS in half duplex mode. C-Kermit is written to work in full duplex mode. I have made appropriate changes to allow running in half duplex mode. These changes have been embedded amongst #ifdef HALFDUPLEX or #ifdef FULLDUPLEX constructs. Could these changes be incorporated into the next version of C-Kermit. Additionally, I added #ifdefs for UOFM and UTSV. Feel free to remove these if you please. These are mostly for asthetic reasons. Also, we too are having trouble with long packets. The files modified are the following: ckucmd.c ckuker.mak ckutio.c Here is the cdiff for ckucmd.c ------------------------------------------------------------------------- *** ../kermit.orig/ckucmd.c Thu Aug 20 14:50:13 1987 --- ../kermit/ckucmd.c Wed Aug 19 12:06:03 1987 *************** *** 63,68 **** --- 63,72 ---- copyright notice is retained. */ + #define FULLDUPLEX + #ifdef HALFDUPLEX + #undef FULLDUPLEX + #endif /* Includes */ #include /* Standard C I/O package */ *************** *** 855,860 **** --- 859,867 ---- int quote = 0; /* Flag for quote character */ int echof = 0; /* Flag for whether to echo */ int ignore = 0; + #ifdef HALFDUPLEX + static int qmark = 0; + #endif #ifdef datageneral extern int termtype; /* DG terminal type flag */ *************** *** 889,894 **** --- 896,917 ---- } #else c = getchar(); /* or from tty. */ + #ifdef HALFDUPLEX + if ( c == '?' ) { + qmark = 1; + } + else if ( qmark ) { + while ( c != '\n' && c != '\r' ) { /* Consume until EOL */ + c = getchar(); + } + c = getchar(); + if ( c != '?' ) { + qmark = 0; + } + } + #endif + + if (c == EOF) { /*** perror("ckucmd getchar"); (just return silently) ***/ return(-4); *************** *** 941,947 **** } if (c == NL || c == CR) { /* CR, LF */ *bp = NUL; /* End the string */ ! if (echof) { /* If echoing, */ putchar(c); /* echo the typein */ #ifdef apollo if (c == CR) putchar(NL); --- 964,973 ---- } if (c == NL || c == CR) { /* CR, LF */ *bp = NUL; /* End the string */ ! #ifdef FULLDUPLEX ! if (echof) /* If echoing, */ ! #endif ! { putchar(c); /* echo the typein */ #ifdef apollo if (c == CR) putchar(NL); *************** *** 959,965 **** --- 985,996 ---- return(cmflgs = 1); } if (!ignore && (c == '?')) { /* Question mark */ + #ifdef UOFM + putchar('\n'); + #endif + #ifdef FULLDUPLEX putchar(c); + #endif *bp = NUL; setatm(pp); return(cmflgs = 3); -------------------------------------------------------------------------- Here is the cdiff for ckuker.mak ------------------------------------------------------------------------- *** ../kermit.orig/ckuker.mak Fri Aug 14 13:28:37 1987 --- ../kermit/ckuker.mak Fri Aug 21 11:13:22 1987 *************** *** 8,13 **** --- 8,14 ---- # # for Amdahl UTS 2.4 on IBM 370 series & compatible mainframes, "make uts24" # for Amdahl UTSV IBM 370 series & compatible mainframes, "make sys3" + # for Amdahl UTSV IBM 370 at Univ of Manitoba, "make utsV" # for AT&T 3Bx systems, "make att3bx" # for AT&T generic System III/System V, "make sys3" or "make sys3nid" # for ATT System V R3, use "make sys5r3". This is different from the above. *************** *** 316,318 **** --- 317,331 ---- #Zilog ZEUS 3.21 zilog: make wermit "CFLAGS = -DUXIII -DZILOG -DTLOG -i -O" "LNKFLAGS = -i" + + # Amdahl UTS/V at Univerity of Manitoba + utsV: + make wermit\ + "CFLAGS = -DUXIII -DDEBUG -DTLOG -DUOFM -DHALFDUPLEX -DUTSV -i -O"\ + "LNKFLAGS = -i" + + # Clean up intermediate and object files + clean: + -rm -f ckcmai.o ckucmd.o ckuusr.o ckuus2.o ckuus3.o ckcpro.o \ + ckcfns.o ckcfn2.o ckucon.o ckutio.o ckufio.o ckudia.o ckuscr.o \ + ckwart.o ckcpro.c wart -------------------------------------------------------------------------- Here is the cdiff for ckucmd.c -------------------------------------------------------------------------- *** ../kermit.orig/ckucmd.c Thu Aug 20 14:50:13 1987 --- ../kermit/ckucmd.c Wed Aug 19 12:06:03 1987 *************** *** 63,68 **** --- 63,72 ---- copyright notice is retained. */ + #define FULLDUPLEX + #ifdef HALFDUPLEX + #undef FULLDUPLEX + #endif /* Includes */ #include /* Standard C I/O package */ *************** *** 855,860 **** --- 859,867 ---- int quote = 0; /* Flag for quote character */ int echof = 0; /* Flag for whether to echo */ int ignore = 0; + #ifdef HALFDUPLEX + static int qmark = 0; + #endif #ifdef datageneral extern int termtype; /* DG terminal type flag */ *************** *** 889,894 **** --- 896,917 ---- } #else c = getchar(); /* or from tty. */ + #ifdef HALFDUPLEX + if ( c == '?' ) { + qmark = 1; + } + else if ( qmark ) { + while ( c != '\n' && c != '\r' ) { /* Consume until EOL */ + c = getchar(); + } + c = getchar(); + if ( c != '?' ) { + qmark = 0; + } + } + #endif + + if (c == EOF) { /*** perror("ckucmd getchar"); (just return silently) ***/ return(-4); *************** *** 941,947 **** } if (c == NL || c == CR) { /* CR, LF */ *bp = NUL; /* End the string */ ! if (echof) { /* If echoing, */ putchar(c); /* echo the typein */ #ifdef apollo if (c == CR) putchar(NL); --- 964,973 ---- } if (c == NL || c == CR) { /* CR, LF */ *bp = NUL; /* End the string */ ! #ifdef FULLDUPLEX ! if (echof) /* If echoing, */ ! #endif ! { putchar(c); /* echo the typein */ #ifdef apollo if (c == CR) putchar(NL); *************** *** 959,965 **** --- 985,996 ---- return(cmflgs = 1); } if (!ignore && (c == '?')) { /* Question mark */ + #ifdef UOFM + putchar('\n'); + #endif + #ifdef FULLDUPLEX putchar(c); + #endif *bp = NUL; setatm(pp); return(cmflgs = 3); -------------------------------------------------------------------------- Thank you.... Darren R Besler Dept. of Computer Services University of Manitoba Winnipeg, Manitoba, Canada [Ed. - a couple problems -- where's the diff for ckutio.c? Also, not clear that it's wise to make half-duplex user interface a compile-time option. What if there are half- and full-duplex lines to the same system?] ------------------------------ 15-Sep-87 19:51:13-EDT,5162;000000000001 Return-Path: Received: from RUTGERS.EDU by CU20B.COLUMBIA.EDU with TCP; Tue 15 Sep 87 19:51:06-EDT Received: by RUTGERS.EDU (5.54/1.14) with UUCP id AA25563; Tue, 15 Sep 87 19:55:17 EDT Received: Mon, 14 Sep 87 16:42:40 PDT by ames.arpa (5.58/1.2) Received: by philabs.Philips.Com (smail2.2/8-28-87/5.51) id AA18076; Mon, 14 Sep 87 19:12:53 EDT Received: by phri.phri (5.51/5.17) id AA10458; Mon, 14 Sep 87 18:13:48 EDT Received: by pluto.UUCP (4.12/4.7) id AA01710; Sun, 13 Sep 87 13:22:28 edt From: ames!pluto!warren@phri (Warren Burstein) Message-Id: <8709131722.AA01710@pluto.UUCP> Useless-Header: Yes Date: 13 Sep 87 17:22:26 GMT To: gatech!philabs!comp-protocols-kermit@rutgers.EDU Subject: Submission for comp-protocols-kermit Responding-System: pluto.UUCP Path: pluto!warren From: warren@pluto.UUCP (Warren Burstein) Newsgroups: comp.protocols.kermit Subject: patches to ckermit Message-ID: <536@pluto.UUCP> Date: 13 Sep 87 17:22:25 GMT Organization: Industrial Automation Systems - New York, NY Lines: 178 This doesn't have to go into the newsgroup if you don't want it to, this was just a good way to get it to you. These patches add to ckermit a "set phone" command. Aliases are recognized in the "dial" command. My .kermrc is now full of set phone commands. The new command looks like set phone pacx 280-8050 After this command, I can say dial pacx I don't know how to make a "patch" file so here is a shar of all the diffs. I am leaving the net in two days, I hope to be back on in a while and pick up my mail from this machine. I didn't use any fancy methods to store phone numbers, it didn't seem worth the effort. --------------- # This is a shell archive. Remove anything before this line, then # unpack it by saving it in a file and typing "sh file". (Files # unpacked will be owned by you and have default permissions.) # # This archive contains: # ckudia.diff ckuus3.diff ckuusr.diff ckuusrh.diff echo x - ckudia.diff cat > "ckudia.diff" << '//E*O*F ckudia.diff//' 73,75d72 < * < * 6-May-87 Support for phone aliases < * -- Warren Burstein 126d122 < char *malloc(), *strcpy(); 422,431d417 < < /* < * Array of phone aliases, unsorted < */ < < #define MAXPHONES 100 < struct phones { < char *name, *number; < } phones[MAXPHONES]; < 528d513 < struct phones *lookup_phone(), *p; 530,537d514 < if ( !isdigit(*telnbr)) < if (p = lookup_phone(telnbr)) < telnbr = p->number; < else { < printf("I don't recognize that system\n"); < return -2; < } < 866,927d842 < } < < /* < * Following code added by WB for phone aliases. < */ < < /* < * Add a phone alias. < */ < < add_phone(name, number) < char *name, *number; < { < struct phones *p; < < /* < * If name is in use, redefine its number. < */ < if (p = lookup_phone(name)) { < free(p->number); < p->number = malloc(strlen(number) + 1); < (void) strcpy(p->number, number); < return; < } < < /* < * Find a vacancy in the table. < */ < for (p = phones; p < &phones[MAXPHONES]; p++) < if ( !p->name) { < p->name = malloc(strlen(name) + 1); < (void) strcpy(p->name, name); < p->number = malloc(strlen(number) + 1); < (void) strcpy(p->number, number); < return; < } < < printf("There are too many phone aliases.\n"); < } < < /* < * Returns phone number to use, or NULL if phone number could not be found. < */ < < struct phones *lookup_phone(name) < char *name; < { < struct phones *p; < < for (p = phones; p < &phones[MAXPHONES]; p++) < if (p->name && !strcmp(p->name, name)) < return p; < < return (struct phones *) 0; < } < < shphones() { < struct phones *p; < < for (p = phones; p < &phones[MAXPHONES]; p++) < if (p->name) < printf("%s %s\n", p->name, p->number); //E*O*F ckudia.diff// echo x - ckuus3.diff cat > "ckuus3.diff" << '//E*O*F ckuus3.diff//' 268,280d267 < case XYPHONE: < { < char name[30], number[30]; < < if ( (x = cmfld("name of phone alias", "", &s)) < 0) return x; < (void) strcpy(name, s); < if ( (x = cmfld("phone number", "", &s)) < 0) return x; < (void) strcpy(number, s); < < add_phone(name, number); < } < break; < //E*O*F ckuus3.diff// echo x - ckuusr.diff cat > "ckuusr.diff" << '//E*O*F ckuusr.diff//' 436d435 < "phone-number", XYPHONE, 0, 473,474c472 < #define SHPHONE 2 /* phone numbers */ < --- > 477d474 < "phone-aliases", SHPHONE, 0, 1085,1089c1082 < < case SHPHONE: < shphones(); < break; < --- > //E*O*F ckuusr.diff// echo x - ckuusrh.diff cat > "ckuusrh.diff" << '//E*O*F ckuusrh.diff//' 104c104 < #define XYPHONE 33 /* set phone alias - WB */ --- > //E*O*F ckuusrh.diff// exit 0 -- /|/~\~~\ The entire world Warren Burstein |__/__/_/ is a very strange carrot. | But the farmer philabs!tg!pluto!warren / is not afraid at all. Why doesn't life come with subtitles? ------------------------------ Date: Mon, 21 Sep 87 09:54:28 PDT From: kevin@ACC-SB-UNIX.ARPA (Kevin 0'Gorman) Subject: C-kermit 067 / UNIX PC The comments in the makefile about AT&T 3bx machines DO NOT APPLY to the 3b1. This machine uses the standard lock files. However, when using the "shared libraries" (highly recommended) available on the UNIX PC, there is a name conflict which makes it useful to add something like -Dopeni=UPCOI -Ddial=UPCDIAL to the cc command line. I accordingly create a new version, like the sys3 entry except for this addition. I call it unixpc, though upc would also be familiar to UNIX PC hackers. ------------------------------ Date: Wed, 23 Sep 87 08:43:02 EDT From: Marshall_DeBerry@um.cc.umich.edu Subject: C-Kermit on Tandy 6000 Regarding your question about the Tandy 6000: I am currently running 4D(061) kermit on such a machine with no problems. My machine has 512K memory and a 15 Meg hard drive. It runs at 6Mhz. I have not experienced any problems with "slowness", as other's have often described. As a matter of fact, my machine is in reality on old Model II that was upgraded to essentially a Model 16a, which is my case is equivalent to a Model 6000 now. Anyway, the Xenix that Tandy current supports is Xenix 3.1.2, which is pretty much like system III. Note that all the versions of kermit I have compiled on my machine have been done under Xenix 3.xx. The earlier version of Xenix that Tandy put out for the first Model 16's was done from a version 7 Unix base. I have had no expericence with the older Xenix. However, if you are using that version, you really should pay the $99.00 to Tandy and upgrade to version 3.xx. (At least it was $99.00 about a year and a half ago). Anyhow, to compile c-kermit on a 6000 under Xenix 3.xx, you need to do two things: 1). Look in the source files for the use of identifier "void". If you find that identifier in a file, make sure you put the include line "#include " at the top of that file with the other include statements. 2). Say make sys3, and wait awhile. If your system is fully loaded, ie, about 90% full on the hard drive, and little memory, you may not be able to compile the program. Make space on your hard drive (down to around 75% free), and try again. It may take as long as a half hour to compile. Note that I recently compiled the experimental c-kermit (the "new release") on a 6000 under Xenix 3.1.2 with no problems, save for the "void" identifier. Also note that I am the only user of my machine, ie, I don't have other users running out of tty ports. I can't tell you what running kermit is like on a 6000 with 2-3 other users. I hope this information is of help to Tandy 6000 owners trying to get kermit up and running. ------------------------------ Date: Mon, 28 Sep 87 10:53:38 PDT From: kevin@ACC-SB-UNIX.ARPA (Kevin 0'Gorman) I hacked Kermit to work with the internal modem on my AT&T 3b1 over the weekend. This is a lot different from external modems, because it is controlled by IOCTL's instead of by in-band characters. Thinking that other machines may have such built-in modems, I did the changes in such a way that others can use the same technique. The user-visible name for the modem is "internal", and it is only visible when "INTMDM" is defined (currently only if you 'make upc'). Where I expected other machines to have variant code, I conditioned everything on INTMDM. Elsewhere, I conditioned on UNIXPC. Setting UNIXPC causes INTMDM and UXIII to be defined in ckcker.h, and I expect that some new machines will also work this way, so that machine FOO will have an entry such that 'make FOO' defines FOO, and ckuker.h will define INTMDM and FOO_OS. I have included context diffs from the 4E(067) sources. The changes are confined to Makefile, ckuker.h, ckudia, and ckutio. I have compiled this on a 3b1 under System V, and on a VAX under 4.3BSD, and nothing seems broken. I will be at this address only two more days, so after that direct any replies or comments to kevin@kosman.uucp, where I get mail and USENET news. diff -c K067/Makefile UPCkermit/Makefile *** K067/Makefile Sun Sep 27 19:41:40 1987 --- UPCkermit/Makefile Sun Sep 27 19:22:42 1987 *************** *** 8,14 # # for Amdahl UTS 2.4 on IBM 370 series & compatible mainframes, "make uts24" # for Amdahl UTSV IBM 370 series & compatible mainframes, "make sys3" ! # for AT&T 3Bx systems, "make att3bx" # for AT&T generic System III/System V, "make sys3" or "make sys3nid" # for ATT System V R3, use "make sys5r3". This is different from the above. # for BBN C/70 with IOS 2.0, "make c70" --- 8,15 ----- # # for Amdahl UTS 2.4 on IBM 370 series & compatible mainframes, "make uts24" # for Amdahl UTSV IBM 370 series & compatible mainframes, "make sys3" ! # for AT&T 3Bx systems except 3b1, "make att3bx" ! # for AT&T UNIX PC (7300 and 3b1), "make upc" # for AT&T generic System III/System V, "make sys3" or "make sys3nid" # for ATT System V R3, use "make sys5r3". This is different from the above. # for BBN C/70 with IOS 2.0, "make c70" *************** *** 187,193 ckufio.o: ckufio.c ckcker.h ckcdeb.h ! ckutio.o: ckutio.c ckcdeb.h ckucon.o: ckucon.c ckcker.h ckcdeb.h --- 188,194 ----- ckufio.o: ckufio.c ckcker.h ckcdeb.h ! ckutio.o: ckutio.c ckcker.h ckcdeb.h ckucon.o: ckucon.c ckcker.h ckcdeb.h *************** *** 238,243 sys3: make wermit "CFLAGS = -DUXIII -DDEBUG -DTLOG -i -O" "LNKFLAGS = -i" #Generic ATT System III or System V (no I&D space) sys3nid: --- 239,249 ----- sys3: make wermit "CFLAGS = -DUXIII -DDEBUG -DTLOG -i -O" "LNKFLAGS = -i" + #ATT UNIX PC 7300 and 3b1 (renames things for shared library) + upc: + make wermit \ + "CFLAGS = -DDEBUG -DTLOG -DUNIXPC -Ddial=Dial -Dopeni=Openi -O" \ + "LNKFLAGS =" #Generic ATT System III or System V (no I&D space) *************** *** 239,244 make wermit "CFLAGS = -DUXIII -DDEBUG -DTLOG -i -O" "LNKFLAGS = -i" #Generic ATT System III or System V (no I&D space) sys3nid: make wermit "CFLAGS = -DUXIII -DDEBUG -DTLOG -O" "LNKFLAGS =" --- 245,251 ----- "CFLAGS = -DDEBUG -DTLOG -DUNIXPC -Ddial=Dial -Dopeni=Openi -O" \ "LNKFLAGS =" + #Generic ATT System III or System V (no I&D space) sys3nid: make wermit "CFLAGS = -DUXIII -DDEBUG -DTLOG -O" "LNKFLAGS =" *************** *** 243,249 sys3nid: make wermit "CFLAGS = -DUXIII -DDEBUG -DTLOG -O" "LNKFLAGS =" ! #AT&T 3B-series computers running System V # Only difference from sys3 is lock file stuff... att3bx: make wermit "CFLAGS = -DUXIII -DATT3BX -DDEBUG -DTLOG -i -O" \ --- 250,256 ----- sys3nid: make wermit "CFLAGS = -DUXIII -DDEBUG -DTLOG -O" "LNKFLAGS =" ! #AT&T 3B-series computers running System V (other than 3b1, which uses 'upc') # Only difference from sys3 is lock file stuff... att3bx: make wermit "CFLAGS = -DUXIII -DATT3BX -DDEBUG -DTLOG -i -O" \ diff -c K067/ckcker.h UPCkermit/ckcker.h *** K067/ckcker.h Sun Sep 27 19:42:21 1987 --- UPCkermit/ckcker.h Sun Sep 27 18:10:45 1987 *************** *** 9,14 copyright notice is retained. */ /* Mnemonics for ASCII characters */ #define NUL 000 /* ASCII Null */ --- 9,32 ----- copyright notice is retained. */ + /* Set up for possible internal modem types. Generally the code is conditioned + * first on the symbol INTMDM, which indicates that the system supports some + * kind of internal modem ( controlled by ioctl's to the device driver). Then + * the individual variants are tested. + * Any of a variety of things can cause INTMDM to be defined, usually by + * recognizing the machine type (initially, only the UNIXPC). + */ + + #undef INTMDM /* make sure any definition is intentional, because + * of the way this is used in ckudia.c + */ + + #ifdef UNIXPC /* This will run on an ATT 7300 or 3b1 */ + #define INTMDM + #define UXIII /* This is always System V */ + #endif + /* Place other conditions setting INTMDM here */ + /* Mnemonics for ASCII characters */ #define NUL 000 /* ASCII Null */ Only in K067: ckcpro.c diff -c K067/ckudia.c UPCkermit/ckudia.c *** K067/ckudia.c Sun Sep 27 19:45:09 1987 --- UPCkermit/ckudia.c Sun Sep 27 18:00:12 1987 *************** *** 1,4 ! char *dialv = "Dial Command, V2.0(009) 14 Sep 87"; /* C K U D I A -- Dialing program for connection to remote system */ --- 1,4 ----- ! char *dialv = "Dial Command, 4E+(010) 27 Sep 87"; /* C K U D I A -- Dialing program for connection to remote system */ *************** *** 41,46 /* * Modifications: * * 21-Jul-85 Fixed failure returns hanging on no carrier signal * Requires tthang change too (ckutio.c revision) * -- Herm Fischer --- 41,49 ----- /* * Modifications: * + * 26-Sep-87 Added support for 'builtin' modem types, with one + * instance - the UNIX PC internal modem. + * -- Kevin O'Gorman + * * 21-Jul-85 Fixed failure returns hanging on no carrier signal * Requires tthang change too (ckutio.c revision) * -- Herm Fischer *************** *** 117,122 #include "ckcker.h" #include "ckucmd.h" #ifndef ZILOG #include /* Longjumps */ #else --- 120,136 ----- #include "ckcker.h" #include "ckucmd.h" + #ifdef UNIXPC + #include + #include + + extern int ttgetp(), + ttsetp(), + ttpkup(), + ttdial(), + ttdmode(); + #endif + #ifndef ZILOG #include /* Longjumps */ #else *************** *** 162,173 #define n_DF200 4 #define n_GDC 5 #define n_HAYES 6 ! #define n_PENRIL 7 ! #define n_RACAL 8 ! #define n_UNKNOWN 9 ! #define n_USROBOT 10 ! #define n_VENTEL 11 ! #define n_CONCORD 12 /* * Declare modem "variant" numbers for any of the above for which it is --- 176,188 ----- #define n_DF200 4 #define n_GDC 5 #define n_HAYES 6 ! #define n_BILTIN 7 ! #define n_PENRIL 8 ! #define n_RACAL 9 ! #define n_UNKNOWN 10 ! #define n_USROBOT 11 ! #define n_VENTEL 12 ! #define n_CONCORD 13 /* * Declare modem "variant" numbers for any of the above for which it is *************** *** 386,391 "", /* dial_str */ 0 /* dial_rate */ }; /* * Declare table for converting modem numbers to information pointers. --- 401,436 ----- "", /* dial_str */ 0 /* dial_rate */ }; + + static + MDMINF BILTIN = /* Info for modem controlled by IOCTL's */ + /* Most of these things are meaningless in the context of + modems controlled thru the device driver. Rather + than to ambiguate their meanings by using them for + other things, I just set them to NULL or zero. */ + /* This structure will compile in even in systems without + a builtin modem. This is so that the numbering + scheme still works, and the ptrtab[] array has + something to point to. */ + { + #ifdef UNIXPC + 40, /* dial-time for UNIX PC */ + ",:", /* pause-chars */ + 2, /* 2-second pause (actually, : causes 10 secs) */ + #else + 0, /* dial_time */ + NULL, /* pause_chars */ + 0, /* pause_time */ + #endif + NULL, /* wake_str */ + 0, /* wake_rate */ + NULL, /* wake_prompt */ + NULL, /* dmode_str */ + NULL, /* dmode_prompt */ + "%s@", /* dial_str */ + 0 /* dial_rate */ + }; + /* * Declare table for converting modem numbers to information pointers. *************** *** 406,411 &DF200, &GDC, &HAYES, &PENRIL, &RACAL, &UNKNOWN, --- 451,457 ----- &DF200, &GDC, &HAYES, + &BILTIN, &PENRIL, &RACAL, &UNKNOWN, *************** *** 420,425 * * The entries MUST be in alphabetical order by modem name. */ struct keytab mdmtab[] = { "cermetek", n_CERMETEK, 0, --- 466,476 ----- * * The entries MUST be in alphabetical order by modem name. */ + /* + * The "internal" entry exists only in systems where it has meaning, + * so that "?" doesn't show it, and you cannot totally befuddle kermit + * by selecting a non-existent set of features. + */ struct keytab mdmtab[] = { "cermetek", n_CERMETEK, 0, *************** *** 430,435 "direct", 0, 0, "gendatacomm", n_GDC, 0, "hayes", n_HAYES, 0, "penril", n_PENRIL, 0, "racalvadic", n_RACAL, 0, "unknown", n_UNKNOWN, 0, --- 481,489 ----- "direct", 0, 0, "gendatacomm", n_GDC, 0, "hayes", n_HAYES, 0, + #ifdef INTMDM + "internal", n_BILTIN, 0, + #endif "penril", n_PENRIL, 0, "racalvadic", n_RACAL, 0, "unknown", n_UNKNOWN, 0, *************** *** 534,539 int mdmEcho = 0; /* assume modem does not echo */ int n, n1; char *pc; /* pointer to a character */ if (!mdmtyp) { printf("Sorry, you must 'set modem' first\n"); --- 588,596 ----- int mdmEcho = 0; /* assume modem does not echo */ int n, n1; char *pc; /* pointer to a character */ + #ifdef UNIXPC + struct updata updata; + #endif if (!mdmtyp) { printf("Sorry, you must 'set modem' first\n"); *************** *** 543,550 printf("Sorry, you must 'set line' first\n"); return(-2); } ! if (speed < 0) { ! printf("Sorry, you must 'set speed' first\n"); return(-2); } if (ttopen(ttname,&local,mdmtyp) < 0) {/* Open, no wait for carrier */ --- 600,611 ----- printf("Sorry, you must 'set line' first\n"); return(-2); } ! #ifdef INTMDM ! #ifdef UNIXPC ! if (strncmp(ttname, "/dev/ph", sizeof("/dev/ph")-1) != 0 ! && mdmtyp != n_BILTIN) { ! printf("Sorry, the phone lines require you to use the command\ ! 'set modem-dialer internal'\n"); return(-2); } #endif *************** *** 546,552 if (speed < 0) { printf("Sorry, you must 'set speed' first\n"); return(-2); ! } if (ttopen(ttname,&local,mdmtyp) < 0) {/* Open, no wait for carrier */ erp = errmsg; sprintf(erp,"Sorry, can't open %s",ttname); --- 607,642 ----- printf("Sorry, the phone lines require you to use the command\ 'set modem-dialer internal'\n"); return(-2); ! } ! #endif ! if (mdmtyp == n_BILTIN) { ! #ifdef UNIXPC ! if (strncmp(ttname, "/dev/ph", sizeof("/dev/ph")-1) != 0) { ! printf("Sorry, you must 'set line' to a phone line to use the\n\ ! internal modem.\n"); ! return(-2); ! } ! #else ! printf("Sorry, there has been a configuration error with the\n\ ! internal modem.\n"); ! #endif ! } ! if (mdmtyp == n_BILTIN) { ! #ifdef UNIXPC ! if (speed != 300 && speed != 1200) { ! printf("Sorry, you must 'set speed' to 300 or 1200 first\n"); ! return(-2); ! } ! #endif UNIXPC ! } else { ! #endif INTMEM ! if (speed < 0) { ! printf("Sorry, you must 'set speed' first\n"); ! return(-2); ! } ! #ifdef INTMDM ! } ! #endif INTMDM if (ttopen(ttname,&local,mdmtyp) < 0) {/* Open, no wait for carrier */ erp = errmsg; sprintf(erp,"Sorry, can't open %s",ttname); *************** *** 552,558 sprintf(erp,"Sorry, can't open %s",ttname); perror(errmsg); return(-2); ! } pmdminf = ptrtab[mdmtyp-1]; /* set pointer to modem info */ augmdmtyp = mdmtyp; /* initialize "augmented" modem type */ /* cont'd... */ --- 642,648 ----- sprintf(erp,"Sorry, can't open %s",ttname); perror(errmsg); return(-2); ! } pmdminf = ptrtab[mdmtyp-1]; /* set pointer to modem info */ augmdmtyp = mdmtyp; /* initialize "augmented" modem type */ /* cont'd... */ *************** *** 596,601 if ( n = setjmp(sjbuf) ) /* if a "failure jump" was taken... */ { alarm ( 0 ); /* disable timeouts */ if ( n1 = setjmp(sjbuf) ) /* failure while handling failure */ { printf ( "%s failure while handling failure.\r\n", F_reason[n1] ); --- 686,692 ----- if ( n = setjmp(sjbuf) ) /* if a "failure jump" was taken... */ { alarm ( 0 ); /* disable timeouts */ + debug(F110,"Failure jump in dial.c, type ",F_reason[n],0); if ( n1 = setjmp(sjbuf) ) /* failure while handling failure */ { printf ( "%s failure while handling failure.\r\n", F_reason[n1] ); *************** *** 712,717 /* interdigit waits for tone dial */ /* ...dial, cont'd */ default: /* place modem into command mode */ ttolSlow(pmdminf->wake_str, pmdminf->wake_rate); waitFor(pmdminf->wake_prompt); --- 803,846 ----- /* interdigit waits for tone dial */ /* ...dial, cont'd */ + #ifdef INTMDM + case n_BILTIN: + #ifdef UNIXPC + if (ttgetp(&updata) != 0) { + printf("Sorry, can't get modem parameters.\n"); + (void) tthang(); + ttpkt(speed, CONNECT, parity); + reset(); + return(-2); + } + /* check the (read-only) mode bit */ + if ((updata.c_lineparam & (VOICE | DATA)) != DATA) { + printf("Sorry, can't open the line for a data call.\n"); + (void) tthang(); + ttpkt(speed, CONNECT, parity); + reset(); + return(-2); + } + updata.c_lineparam &= ~INCMNG; + updata.c_feedback = SPEAKERON | NORMSPK | NORMRNG | MEDRNG ; + if (ttsetp(&updata) != 0) { + printf("Sorry, can't set modem parameters.\n"); + (void) tthang(); + ttpkt(speed, CONNECT, parity); + reset(); + return(-2); + } + if (ttpkup(&updata) != 0) { + printf("Sorry, can't go offhook -- is the line plugged in?\n"); + (void) tthang(); + ttpkt(speed, CONNECT, parity); + reset(); + return(-2); + } + #endif UNIXPC + break; /* nothing to do */ + #endif + default: /* place modem into command mode */ ttolSlow(pmdminf->wake_str, pmdminf->wake_rate); waitFor(pmdminf->wake_prompt); *************** *** 735,740 alarm(waitct); /* time to allow for connecting */ ttflui(); /* clear out stuff from waking modem up */ sprintf(lbuf, pmdminf->dial_str, telnbr); /* form dialing string */ ttolSlow(lbuf,pmdminf->dial_rate); /* send dialing string */ if (augmdmtyp == n_RACAL) { /* acknowledge printout of dialing string */ --- 864,887 ----- alarm(waitct); /* time to allow for connecting */ ttflui(); /* clear out stuff from waking modem up */ sprintf(lbuf, pmdminf->dial_str, telnbr); /* form dialing string */ + #ifdef INTMDM + if (augmdmtyp == n_BILTIN) { + #ifdef UNIXPC + register char *telno; + + telno = lbuf; + while (*telno != '\0') { + if (ttdial(*(telno++)) != 0) { + printf("Sorry, error in dialing.\n"); + (void) tthang(); + ttpkt(speed, CONNECT, parity); + reset(); + return(-2); + } + } + #endif UNIXPC + } else + #endif INTMDM ttolSlow(lbuf,pmdminf->dial_rate); /* send dialing string */ debug(F110,"Dialing done",lbuf,0); *************** *** 737,742 sprintf(lbuf, pmdminf->dial_str, telnbr); /* form dialing string */ ttolSlow(lbuf,pmdminf->dial_rate); /* send dialing string */ if (augmdmtyp == n_RACAL) { /* acknowledge printout of dialing string */ sleep(3); ttflui(); --- 884,891 ----- #endif INTMDM ttolSlow(lbuf,pmdminf->dial_rate); /* send dialing string */ + debug(F110,"Dialing done",lbuf,0); + if (augmdmtyp == n_RACAL) { /* acknowledge printout of dialing string */ sleep(3); ttflui(); *************** *** 851,856 if (c == '3') status = FAILED; if (c == '5') status = CONNECTED; break; case n_UNKNOWN: /** SHOULD WAIT FOR CARRIER OR TIMEOUT -- DS **/ --- 1000,1032 ----- if (c == '3') status = FAILED; if (c == '5') status = CONNECTED; break; + + #ifdef INTMDM + case n_BILTIN: + #ifdef UNIXPC + if (ttgetp(&updata) != 0) { + printf("Sorry, can't get connect status.\n"); + strcpy(lbuf, "Ioctl failure"); + status = FAILED; + break; + } + if (updata.c_linestatus & MODEMCONNECTED) { + /* finally, go into delay-mode */ + debug(F110," Modem connected",ttname,0); + if (ttdmode(ttname)) { + printf("Sorry, can't reset file parameters.\n"); + strcpy(lbuf, "Fcntl failure"); + status = FAILED; + break; + } + debug(F110," Line now will block",ttname,0); + + status = CONNECTED; + break; + } + #endif UNIXPC + break; + #endif INTMDM case n_UNKNOWN: /** SHOULD WAIT FOR CARRIER OR TIMEOUT -- DS **/ diff -c K067/ckutio.c UPCkermit/ckutio.c *** K067/ckutio.c Sun Sep 27 19:45:51 1987 --- UPCkermit/ckutio.c Sun Sep 27 19:18:22 1987 *************** *** 1,4 ! char *ckxv = "Unix tty I/O, 4E(046), 17 Sep 87"; /* C K U T I O */ --- 1,4 ----- ! char *ckxv = "Unix tty I/O, 4E+(047), 27 Sep 87"; /* C K U T I O */ *************** *** 14,19 */ /* Includes for all Unixes (conditional includes come later) */ #include /* Types */ #include /* Directory */ --- 14,20 ----- */ /* Includes for all Unixes (conditional includes come later) */ + #include "ckcker.h" #include /* Types */ #include /* Directory */ *************** *** 30,35 #include #endif #include "ckcdeb.h" /* Typedefs, formats for debug() */ /* Maximum length for the name of a tty device */ --- 31,40 ----- #include #endif + #ifdef UNIXPC + #include /* structures for internal modem */ + #endif + #include "ckcdeb.h" /* Typedefs, formats for debug() */ /* Maximum length for the name of a tty device */ *************** *** 130,135 /* S.O. Lidie, Lehigh University, LUSOL@LEHICDC1.BITNET */ char *ckxsys = " CDC VX/VE 5.2.1 System V"; #else char *ckxsys = " AT&T System III/System V"; #endif /* vxve */ #endif /* zilog */ --- 135,145 ----- /* S.O. Lidie, Lehigh University, LUSOL@LEHICDC1.BITNET */ char *ckxsys = " CDC VX/VE 5.2.1 System V"; #else + #ifdef UNIXPC + /* AT&T UNIX PC (7300 and 3b1) System V support by */ + /* Kevin O'Gorman, Oxnard, CA, kevin@kosman */ + char *ckxsys = " AT&T UNIX PC System V"; + #else char *ckxsys = " AT&T System III/System V"; #endif /* unix pc */ #endif /* vxve */ *************** *** 131,136 char *ckxsys = " CDC VX/VE 5.2.1 System V"; #else char *ckxsys = " AT&T System III/System V"; #endif /* vxve */ #endif /* zilog */ #endif /* aegis */ --- 141,147 ----- char *ckxsys = " AT&T UNIX PC System V"; #else char *ckxsys = " AT&T System III/System V"; + #endif /* unix pc */ #endif /* vxve */ #endif /* zilog */ #endif /* aegis */ *************** *** 647,652 /* T T C L O S -- Close the TTY, releasing any lock. */ ttclos() { if (ttyfd < 0) return(0); /* Wasn't open. */ if (xlocal) { if (tthang()) /* Hang up phone line */ --- 658,664 ----- /* T T C L O S -- Close the TTY, releasing any lock. */ ttclos() { + debug(F101,"Ttclos, xlocal","",xlocal); if (ttyfd < 0) return(0); /* Wasn't open. */ if (xlocal) { if (tthang()) /* Hang up phone line */ *************** *** 685,690 #endif /* uxiii */ if (ttyfd < 0) return(0); /* Not open. */ #ifdef aegis sio_$control((short)ttyfd, sio_$dtr, false, st); /* DTR down */ msleep(500); /* pause */ --- 697,703 ----- #endif /* uxiii */ if (ttyfd < 0) return(0); /* Not open. */ + debug(F110,"Hanging up line",ttnmsv,0); #ifdef aegis sio_$control((short)ttyfd, sio_$dtr, false, st); /* DTR down */ msleep(500); /* pause */ *************** *** 703,709 if ((modem_rtn & MDCD) != 0) return(-1); /* check if DCD is low */ modem_rtn = MRTS | MDTR; /* bits for RTS & DTR */ if (ioctl(ttyfd,MCSETAF,&modem_rtn) < 0) return(-1); /* set lines */ ! #else ttc_save = ttraw.c_cflag; ttraw.c_cflag &= ~CBAUD; /* swa: set baud rate to 0 to hangup */ if (ioctl(ttyfd,TCSETAF,&ttraw) < 0) return(-1); /* do it */ --- 716,729 ----- if ((modem_rtn & MDCD) != 0) return(-1); /* check if DCD is low */ modem_rtn = MRTS | MDTR; /* bits for RTS & DTR */ if (ioctl(ttyfd,MCSETAF,&modem_rtn) < 0) return(-1); /* set lines */ ! #else /* not HPUX */ ! #ifdef UNIXPC ! if (strncmp( ttnmsv, "/dev/ph", sizeof("/dev/ph")-1) == 0) { ! int res; ! extern int ttdisc(); ! ttdisc(); /* hang up the phone */ ! } else { ! #endif ttc_save = ttraw.c_cflag; ttraw.c_cflag &= ~CBAUD; /* swa: set baud rate to 0 to hangup */ if (ioctl(ttyfd,TCSETAF,&ttraw) < 0) return(-1); /* do it */ *************** *** 709,714 if (ioctl(ttyfd,TCSETAF,&ttraw) < 0) return(-1); /* do it */ msleep(100); /* let things settle */ ttraw.c_cflag = ttc_save; /* NOTE - The following #ifndef...#endif can be removed for SCO Xenix 2.1.3 */ /* or later, but must keep for earlier versions, which can't do close/open. */ --- 729,737 ----- if (ioctl(ttyfd,TCSETAF,&ttraw) < 0) return(-1); /* do it */ msleep(100); /* let things settle */ ttraw.c_cflag = ttc_save; + #ifdef UNIXPC + } + #endif /* NOTE - The following #ifndef...#endif can be removed for SCO Xenix 2.1.3 */ /* or later, but must keep for earlier versions, which can't do close/open. */ *************** *** 716,721 #ifndef XENIX /* xenix cannot do close/open when carrier drops */ /* following corrects a PC/IX defficiency */ ttc_save = fcntl(ttyfd,F_GETFL,0); close(ttyfd); /* close/reopen file descriptor */ if ((ttyfd = open(ttnmsv, ttc_save)) < 0) return(-1); #endif /* not xenix */ --- 739,753 ----- #ifndef XENIX /* xenix cannot do close/open when carrier drops */ /* following corrects a PC/IX defficiency */ ttc_save = fcntl(ttyfd,F_GETFL,0); + #ifdef UNIXPC + /* If this is one of the UNIX PC internal lines, we MUST reopen with + * O_NDELAY, or else the system thinks we want to wait for an incoming + * call. + */ + if (strncmp(ttnmsv, "/dev/ph", sizeof("/dev/ph")-1) == 0) { + ttc_save |= O_NDELAY; + } + #endif close(ttyfd); /* close/reopen file descriptor */ if ((ttyfd = open(ttnmsv, ttc_save)) < 0) return(-1); #endif /* not xenix */ *************** *** 732,737 ttres() { /* Restore the tty to normal. */ int x; if (ttyfd < 0) return(-1); /* Not open. */ #ifndef UXIII /* except for sIII, */ sleep(1); /* Wait for pending i/o to finish. */ --- 764,770 ----- ttres() { /* Restore the tty to normal. */ int x; + debug(F111,"Ttres, restoring terminal",ttnmsv,ttyfd); if (ttyfd < 0) return(-1); /* Not open. */ #ifndef UXIII /* except for sIII, */ sleep(1); /* Wait for pending i/o to finish. */ *************** *** 826,831 return( 0 ); /* okay to go ahead and lock */ } /* T T L O C K */ static --- 859,957 ----- return( 0 ); /* okay to go ahead and lock */ } + #ifdef UNIXPC + + + /* Getty-get-off function. This function gets the 'getty(1m)' off + the indicated line. The return codes seen are: + 0: Can't do it. Probably a user logged on. + 1: No need. No getty on that line. + 2: Done. You should restore the getty when you're done. + */ + static int Offreslt; + static char savttnam[10]; + + static int + Getoffsh(path) register char *path; + { char Systmcmd[33]; + while (*path != '\0') path++; + path -= 3; + strcpy(savttnam,path); + sprintf(Systmcmd,"/usr/bin/getoff.sh %s",path); + debug(F110,"System command ",Systmcmd,0); + return system(Systmcmd); + } + + static void + Getonshl(path) register char *path; + { char Systmcmd[33]; + while (*path != '\0') path++; + path -= 3; + sprintf(Systmcmd,"/usr/bin/geton.sh %s",path); + debug(F110,"System command ",Systmcmd,0); + system(Systmcmd); + } + + /* T T G E T P */ + int + ttgetp(updata) struct updata *updata; + { + return ioctl(ttyfd, PIOCGETP, updata); + } + + /* T T S E T P */ + int + ttsetp(updata) struct updata *updata; + { + return ioctl(ttyfd, PIOCSETP, updata); + } + + /* T T D I S C */ + static int + ttdisc(updata) + { + return ioctl(ttyfd, PIOCDISC); + } + + /* T T P K U P */ + int + ttpkup(updata) struct updata *updata; + { + return ioctl(ttyfd, PIOCOFFHOOK, updata); + } + + /* T T D I A L */ + int + ttdial(digit) char digit; + { + return ioctl(ttyfd, PIOCDIAL, &digit); + } + + /* T T D M O D E */ + int + ttdmode(ttname) char *ttname; + { + struct updata u; + int s; + debug(F101," Setting line blockable","",ttyfd); + s = fcntl(ttyfd, F_GETFL); + debug(F111," File status",ttname,s); + if (fcntl(ttyfd, F_SETFL, fcntl(ttyfd, F_GETFL, 0) & ~O_NDELAY) + < 0) { + return(1); + } + s = fcntl(ttyfd, F_GETFL); + debug(F111," File status",ttname,s); + ttgetp(&u); + debug(F101," Status","",u.c_linestatus); + debug(F110," Resetting mode",ttname,0); + close(open(ttname, O_RDWR)); /* reopen the line */ + debug(F100," Line reset","",0); + return (0); + } + + #endif UNIXPC + /* T T L O C K */ static *************** *** 851,856 write (lck_fil, &pid_buf, sizeof(pid_buf) ); /* uucp expects int in file */ #endif /* att3bx */ close (lck_fil); hasLock = 1; /* now is locked */ #endif /* not aegis */ return(0); --- 977,996 ----- write (lck_fil, &pid_buf, sizeof(pid_buf) ); /* uucp expects int in file */ #endif /* att3bx */ close (lck_fil); + #ifdef UNIXPC + /* If there was no lock file, nobody was using the line, but there may + * have been a getty (or uugetty) on it. This has to be thrown off, or + * we'll run into trouble later with competition for incoming characters. + * Use the User Agent script in /usr/bin for this purpose, and if it fails, + * remove our own lock file and return an error status. For now, this + * case causes a confusing error message about lock files, but it's one + * of those "never happen" cases anyway. + */ + if ((Offreslt = Getoffsh(ttfd)) <= 0) { + unlink(flfnam); + return -1; + } + #endif /*UNIX PC*/ hasLock = 1; /* now is locked */ #endif /* not aegis */ return(0); *************** *** 860,867 static ttunlck() { /* kill uucp lock if possible */ ! if (hasLock) return( unlink( flfnam ) ); ! return(0); } /* New-style (4.3BSD) UUCP line direction control (Stan Barber, Rice U) */ --- 1000,1012 ----- static ttunlck() { /* kill uucp lock if possible */ ! int savres = 0; ! debug(F110,"Unlocking uucp",flfnam,0); ! if (hasLock) savres = unlink( flfnam ); ! #ifdef UNIXPC ! if (Offreslt == 512) Getonshl(savttnam); ! #endif UNIXPC ! return( savres ); } /* New-style (4.3BSD) UUCP line direction control (Stan Barber, Rice U) */ *************** *** 975,981 ttraw.c_cflag |= s; } if (ioctl(ttyfd,TCSETAW,&ttraw) < 0) return(-1); /* set new modes . */ ! if (flow == DIALING) { #ifndef aegis if (fcntl(ttyfd,F_SETFL, fcntl(ttyfd, F_GETFL, 0) & ~O_NDELAY) < 0 ) return(-1); --- 1120,1133 ----- ttraw.c_cflag |= s; } if (ioctl(ttyfd,TCSETAW,&ttraw) < 0) return(-1); /* set new modes . */ ! if (flow == DIALING ! #ifdef UNIXPC ! /* don't do this yet if using the ioctl dialer */ ! /* if we did, the phone would wait for an incoming call */ ! /* instead, this is about the last thing to do in dial() */ ! && (!xlocal || strncmp(ttnmsv, "/dev/ph", sizeof("/dev/ph")-1)) ! #endif UNIXPC ! ) { #ifndef aegis if (fcntl(ttyfd,F_SETFL, fcntl(ttyfd, F_GETFL, 0) & ~O_NDELAY) < 0 ) return(-1); *************** *** 1024,1030 if (flow == 0) tttvt.c_iflag &= ~(IXON|IXOFF); if (flow == DIALING) tttvt.c_cflag |= CLOCAL|HUPCL; ! if (flow == CONNECT) tttvt.c_cflag &= ~CLOCAL; tttvt.c_lflag &= ~(ISIG|ICANON|ECHO); tttvt.c_iflag |= (IGNBRK|IGNPAR); --- 1176,1182 ----- if (flow == 0) tttvt.c_iflag &= ~(IXON|IXOFF); if (flow == DIALING) tttvt.c_cflag |= CLOCAL|HUPCL; ! if (flow == CONNECT) ttraw.c_cflag &= ~CLOCAL; tttvt.c_lflag &= ~(ISIG|ICANON|ECHO); tttvt.c_iflag |= (IGNBRK|IGNPAR); *************** *** 1041,1047 } if (ioctl(ttyfd,TCSETAW,&tttvt) < 0) return(-1); /* set new modes . */ ! if (flow == DIALING) { #ifndef aegis if (fcntl(ttyfd,F_SETFL, fcntl(ttyfd, F_GETFL, 0) & ~O_NDELAY) < 0 ) return(-1); --- 1193,1206 ----- } if (ioctl(ttyfd,TCSETAW,&tttvt) < 0) return(-1); /* set new modes . */ ! if (flow == DIALING ! #ifdef UNIXPC ! /* don't do this yet if using the ioctl dialer */ ! /* if we did, the phone would wait for an incoming call */ ! /* instead, this is about the last thing to do in dial() */ ! && (!xlocal || strncmp(ttnmsv, "/dev/ph", sizeof("/dev/ph")-1)) ! #endif UNIXPC ! ) { #ifndef aegis if (fcntl(ttyfd,F_SETFL, fcntl(ttyfd, F_GETFL, 0) & ~O_NDELAY) < 0 ) return(-1); 2-Oct-87 11:44:28-EDT,1556;000000000001 ------------------------------ Date: Thu, 1 Oct 1987 15:27 CDT From: William Bruce Curtis Subject: C-Kermit and Berkeley Unix job control (crtl-Z) To: Is there a reason that cntrl-Z is trapped in the new release of C-Kermit? The user document for C-Kermit says that Kermit can be stopped using cntrl-Z (job control under Berkeley Unix) but the following code in the conint routine in ckutio.c traps the keyboard generated stop signal (SIGTSTP) and causes the program to exit. #ifdef SIGTSTP signal(SIGTSTP,SIG_IGN); /* Keyboard stop */ #endif I have commented out the code and C-Kermit seems to work fine plus it can be stopped from the keyboard with ctrl-Z just like the earlier releases. Thanks, Bruce Curtis ------------------------------ To: info-kermit@cu20b.columbia.edu Subject: minor bug in c-kermit Date: Thu, 01 Oct 87 23:52:57 EDT From: moore@UTKCS2.CS.UTK.EDU In C-Kermit 4E(067) 14 Sep 87, 4.2 BSD: When compiling under Ultrix 2.0, using the vcc C compiler (which is slightly better than pcc), C-Kermit doesn't compile cleanly, due the the existence of several #ifdef vax11c lines in some of the .h files. These have been used to denote VAX/VMS specific code. The vcc compiler pre-defines the symbol vax11c on Ultrix just as it does on VMS. C-Kermit can be made to compile cleanly on both Ultrix and VMS if these lines are changed to #ifdef vms. Keith Moore UT Computer Science Dept. Internet: moore@utkcs2.cs.utk.edu 107 Ayres Hall, UT Campus CSnet: moore@tennessee Knoxville Tennessee BITNET: moore@utkcs1 ------------------------------ Date: Tue, 13 Oct 1987 11:17:57 LCL From: Dean W. Bettinger Subject: C-Kermit for SCO Xenix With some help from SCO I was able to compile and run C-Kermit by adding the code below to the Makefile and typing "make sco". I am using a 386AT from 386 Corp. It uses the Intel SBC-386AT motherboard. The version of SCO Xenix 286 is 2.2.1. The version of the development system (c compiler, etc.) is 2.2. All I really had to do was to add the compiler and linker options "-M2le" and it compiled and ran fine. If you are running SCO Xenix on an 8086/8088 machine you will want to leave out the "2" in "-M2le". ############################################################################ #SCO "Xenix/286" e.g. for IBM PC/AT sco: make wermit "CFLAGS= -DXENIX -DUXIII -DDEBUG -DTLOG -F 3000 -i -M2le" \ "LNKFLAGS = -F 3000 -i -M2le" ############################################################################ ------------------------------ Date: Wed, 21 Oct 87 22:20:18 EDT From: cbmvax!vu-vlsi!devon!paul@RUTGERS.EDU (Paul Sutcliffe Jr.) Subject: Diffs for C-Kermit 4D(061) and Tandy 6000 Keywords: C-Kermit 4D(061), Tandy Kermit In Info-Kermit Digest V6 #23, I said I'd send the diffs along to compile C-Kermit on a Tandy 6000. Here they are. Note that they assume that one is running Tandy Xenix 3.0 or greater. Install these diffs in the "stock" 4D(061) C-Kermit distribution, and then type "make trs16" to compile. In reality, you only need to make the modification to the makefile (ckuker.mak); the other diffs just make the startup banner agree with the operating system version -- I didn't like kermit saying "Xenix/286" on my 68000! - paul =========== CUT HERE =========== *** .orig/ckuker.mak Fri Nov 21 16:04:08 1986 --- ckuker.mak Sun Jan 18 13:29:07 1987 *************** *** 226,231 "LNKFLAGS = -F 3000 -i" #PC/IX, Interactive Corp System III for IBM PC/XT pcix: make wermit \ --- 226,237 ----- "LNKFLAGS = -F 3000 -i" + #Tandy 16/6000 with Xenix 3.0 + trs16: + make wermit "CFLAGS= -DTRS16 -DXENIX -DUXIII -DDEBUG -DTLOG -DM_VOID -Dvoid=int -F 3000 -n" \ + "LNKFLAGS = -F 3000 -n" + + #PC/IX, Interactive Corp System III for IBM PC/XT pcix: make wermit \ *** .orig/ckufio.c Fri Nov 21 16:04:08 1986 --- ckufio.c Sat Jan 17 20:43:16 1987 *************** *** 63,68 /* Sys III/V, Xenix, PC/IX,... support by Herm Fischer, Litton Data Systems */ #ifdef UXIII #ifdef XENIX char *ckzsys = " Xenix/286"; #else #ifdef PCIX --- 63,71 ----- /* Sys III/V, Xenix, PC/IX,... support by Herm Fischer, Litton Data Systems */ #ifdef UXIII #ifdef XENIX + #ifdef TRS16 + char *ckzsys = " Xenix/68000"; + #else char *ckzsys = " Xenix/286"; #else #ifdef PCIX *************** *** 71,76 #ifdef ISIII char *ckzsys = " Interactive Systems Corp, System III"; #else char *ckzsys = " AT&T System III/System V"; #endif #endif --- 74,80 ----- #ifdef ISIII char *ckzsys = " Interactive Systems Corp, System III"; #else + #ifndef TRS16 char *ckzsys = " AT&T System III/System V"; #endif #endif *************** *** 72,77 char *ckzsys = " Interactive Systems Corp, System III"; #else char *ckzsys = " AT&T System III/System V"; #endif #endif #endif --- 76,83 ----- #else #ifndef TRS16 char *ckzsys = " AT&T System III/System V"; + #endif + #endif #endif #endif #endif *** .orig/ckutio.c Fri Nov 21 16:04:09 1986 --- ckutio.c Sat Jan 17 20:44:47 1987 *************** *** 96,101 /* Sys III/V, Xenix, PC/IX support by Herm Fischer, Encino, CA */ #ifdef UXIII #ifdef XENIX char *ckxsys = " Xenix/286"; #else #ifdef PCIX --- 96,104 ----- /* Sys III/V, Xenix, PC/IX support by Herm Fischer, Encino, CA */ #ifdef UXIII #ifdef XENIX + #ifdef TRS16 + char *ckxsys = " Xenix/68000"; + #else char *ckxsys = " Xenix/286"; #else #ifdef PCIX *************** *** 104,109 #ifdef ISIII char *ckxsys = " Interactive Systems Corp System III"; #else char *ckxsys = " AT&T System III/System V"; #endif #endif --- 107,113 ----- #ifdef ISIII char *ckxsys = " Interactive Systems Corp System III"; #else + #ifndef TRS16 char *ckxsys = " AT&T System III/System V"; #endif #endif *************** *** 105,110 char *ckxsys = " Interactive Systems Corp System III"; #else char *ckxsys = " AT&T System III/System V"; #endif #endif #endif --- 109,116 ----- #else #ifndef TRS16 char *ckxsys = " AT&T System III/System V"; + #endif + #endif #endif #endif #endif =========== CUT HERE =========== Paul Sutcliffe, Jr. UUCP (smart): paul@devon.UUCP UUCP (dumb): ...{rutgers,ihnp4,cbosgd}!bpa!vu-vlsi!devon!paul ------------------------------ 2-Nov-87 21:56:28-EST,3654;000000000011 Return-Path: Received: from uunet.UU.NET by CU20B.COLUMBIA.EDU with TCP; Mon 2 Nov 87 21:55:42-EST Received: from munnari.UUCP by uunet.UU.NET (5.54/1.14) with UUCP id AA18412; Mon, 2 Nov 87 21:07:28 EST Received: from adl.austek.oz (via augean) by munnari.oz with SunIII (5.5) id AA15800; Tue, 3 Nov 87 12:44:30 EST Received: from sade.adl.austek by lennon.adl.austek (4.44/4.2 Austek-RJS) id AA12300; Tue, 3 Nov 87 08:24:27 CST Received: by sade.adl.austek (4.44/4.2 Austek-RJS) id AA17010; Tue, 3 Nov 87 08:20:38 CST Date: Tue, 3 Nov 87 08:20:38 CST From: munnari!adl.austek.oz.au!rsharpe@uunet.UU.NET (Richard Sharpe--Apprentice Sorcerer) Message-Id: <8711022150.AA17010@sade.adl.austek> To: sy.fdc@cu20b.columbia.edu Subject: CKermit under Unix ... Frank, You may no longer deal with such problems, so If you don't, can you please pass this along to the person who does. We are having problems with ckermit on an Ultrix system (approx 4.3BSD). We have kermit installed setuid and setgid to uucp to allow access to the UUCP spool directory (to write the lock files). However, whenever kermit tries to write files in the user's directories (perhaps because the user is running kermit on the VAX in server mode and doing a send from a pc--mskermit), it fails saying that it cannot open the file. If the user sets their directory to world write, then ckermit onm the VAX is happy. Now, this seems to be an interaction between the way we have kermit installed and what it is trying to do, but I cannot see any other way to set up kermit so that it can reliably access the UUCP spool directory. So, I checked out the code, and found that zopeno in ckufio.c just does an open of the file that it is opening for output and then does a chown to the real user and real group. I added the following code, and all seems to work: 1. First pick up the real and effective UIDs. 2. Then, just before the file open, set effective UID to back to our real UID. 3. Then, just after the file open, set our effective UID back to what it was just before we changed it. Here is the code fragment that does it (lines with a * in col 1 are mine): zopeno(n,name) int n; char *name; { * int uid, euid; debug(F111," zopeno",name,n); if (chkfn(n) != 0) return(0); if ((n == ZCTERM) || (n == ZSTDIO)) { /* Terminal or standard output */ fp[ZOFILE] = stdout; debug(F101," fp[]=stdout", "", (int) fp[n]); return(1); } * uid = getuid(); euid = geteuid(); * seteuid(uid); /* Set us back to who is running kermit */ fp[n] = fopen(name,"w"); /* A real file, try to open */ * seteuid(euid); /* And set things back to our SUID value */ if (fp[n] == NULL) { perror("zopeno can't open"); } else { chown(name, getuid(), getgid()); /* In case set[gu]id */ if (n == ZDFILE) setbuf(fp[n],NULL); /* Debugging file unbuffered */ } debug(F101, " fp[n]", "", (int) fp[n]); return((fp[n] != NULL) ? 1 : 0); } ------------------------------------ Now, as I say, this works, but I wonder if there is not a simpler way to get this done, like only have kermit setgid to uucp. Would that be sufficient? BTW, this fragment came from version 4c(029) of ckufio.c. I also have another version (ckcmai 4d(061) 8-Sep-86 and ckufio 4c(033) 8-Sep-86) but there seems to be no changes in routine zopeno. Hope you can help me here. Regards Richard Sharpe rsharpe%adl.austek.oz@uunet.uu.net 4-Nov-87 01:39:01-EST,1567;000000000011 Return-Path: Received: from uunet.UU.NET by CU20B.COLUMBIA.EDU with TCP; Wed 4 Nov 87 01:38:45-EST Received: from munnari.UUCP by uunet.UU.NET (5.54/1.14) with UUCP id AA27192; Wed, 4 Nov 87 01:02:59 EST Received: from adl.austek.oz (via augean) by munnari.oz with SunIII (5.5) id AA06094; Wed, 4 Nov 87 16:16:23 EST Received: from sade.adl.austek by lennon.adl.austek (4.44/4.2 Austek-RJS) id AA21733; Wed, 4 Nov 87 09:55:22 CST Received: by sade.adl.austek (4.44/4.2 Austek-RJS) id AA19879; Wed, 4 Nov 87 09:54:09 CST Date: Wed, 4 Nov 87 09:54:09 CST From: munnari!adl.austek.oz.au!rsharpe@uunet.UU.NET (Richard Sharpe--Apprentice Sorcerer) Message-Id: <8711032324.AA19879@sade.adl.austek> To: SY.FDC@cu20b.columbia.edu In-Reply-To: Frank da Cruz's message of Tue 3 Nov 87 08:49:18-EST <12347657657.146.SY.FDC@CU20B.COLUMBIA.EDU> Subject: CKermit under Unix ... Frank, I have found problems with my solution that are to do with the differences between sysV and 4.2 (I read about this setuid stuff in Bach's book), so I am going to fix it up properly for SysV and 4.2/Ultrix. I also have access to a MicroPort 2.2 system, so I will try to get it working on that system as well. Finally, across the road is an NCR Tower, so I will try to get it running on that. When I do, I will ship you a copy of the changes. I may also try to fix the problem where you wipe out the existing file if a send is aborted. However, let me know if someone has already fixed this. Regards Richard ------------------------------ Date: Wed 4 Nov 87 09:40:00-EST From: Frank da Cruz Subject: Re: CKermit under Unix ... To: munnari!adl.austek.oz.au!rsharpe@UUNET.UU.NET Sounds good. And no, nobody has sent in a fix for wiping out an existing file when the transfer is aborted, and "warning" is off. Of course, if people care about this, they should set warning on. But to be super nice to them, I suppose Kermit could behave as though warning was on all the time, i.e. give a new, unique name to an incoming file if another file by the desired name already exists. Then, if the transfer finishes successfully, delete the old file and rename the new one to the desired name. Otherwise, delete the new file and keep the old one. - Frank ------------------------------ Date: Thu, 1 Oct 1987 15:27 CDT From: William Bruce Curtis Subject: C-Kermit and Berkeley Unix job control (crtl-Z) Keywords: C-Kermit Is there a reason that cntrl-Z is trapped in the new release of C-Kermit? The user document for C-Kermit says that Kermit can be stopped using cntrl-Z (job control under Berkeley Unix) but the following code in the conint routine in ckutio.c traps the keyboard generated stop signal (SIGTSTP) and causes the program to exit. #ifdef SIGTSTP signal(SIGTSTP,SIG_IGN); /* Keyboard stop */ #endif I have commented out the code and C-Kermit seems to work fine plus it can be stopped from the keyboard with ctrl-Z just like the earlier releases. Thanks, Bruce Curtis ------------------------------ Date: Sun, 6 Dec 87 16:02 MST From: (Joe Doupnik) Subject: CKermit bug in MAXL field w/Long pkts. A small problem in CKermit 4E(067) 14 Sept 1987: when using Long Packets the MAXL field in the initialization packet is incorrect. For example, when the received packet size is set to 1000 bytes (Set Rec Pack 1000) then MAXL is transmitted as a Control-H (8) and when the size is set to 997 bytes then MAXL is Control-E (5). This indicates that somewhere the parameter rpsiz is referring to the Long packet length rather than the desired size of regular packets and tochar(rpsiz) is, of course, extracting the 8 bit remainder of rpsiz + 32d. Curiously, manually overriding the startup length yields a correct field for the initial S packet interchange with the server but an incorrect value for the S packet interchange for a particular file. In practice this has little effect because Long packet lengths are used from their separate information and when they are not used the MAXL field is correct. Regards, Joe D. ------------------------------ A user at NBS complained that the makefile does not work for building C-Kermit from source on a PC/AT under Microsoft Xenix version 3.4B. It compiled all the source files into object files, but did not link them together into "wermit". After much experimentation, he found that he could link the program manually: cc -F3000 -i -o wermit ------------------------------ 8-Dec-87 01:21:18-EST,3316;000000000011 Return-Path: Received: from carrara.marble.com ([128.103.32.2]) by CU20B.COLUMBIA.EDU with TCP; Tue 8 Dec 87 01:21:06-EST Received: by carrara.marble.com (5.52/1.14) id AA02440; Tue, 8 Dec 87 01:23:26 EST Date: Tue, 8 Dec 87 01:23:26 EST From: brown@carrara.marble.com (Robert Brown) Message-Id: <8712080623.AA02440@carrara.marble.com> To: sy.fdc@cu20b.columbia.edu Cc: Subject: Kermit and SIGTSTP I have been testing C-Kermit version 4E on a Microvax running 4.3 BSD Unix, and have discovered a problem with its handling of SIGTSTP. Right now when Kermit gets the signal, control transfers to trap() who just exits. This means that I cannot suspend Kermit and later foreground it -- a big problem on a system that supports job control. Kermit should be modified to do the following: 1. When setting up signal handlers, Kermit should do something like: signal(SIGTSTP, stop_handler), so that control transfers to a specific handler for stopping. 2. The stop_handler routine should do the following: a. Reset any terminal modes to their original values. b. Stop Kermit and all of its children with kill(0, SIGSTOP). (this signal cannot be stopped or ignored) c. When the user foregrounds the process, control will resume right after the kill(), so reset terminal modes to what Kermit wants and continue. . . After composing this letter, I decided to go ahead and hack the copy of Kermit I have here. The changes for job control (produced by "diff -c") are included below. They should work on BSD 4.x. Let me know if I can be of further help, and whether changes like this will make it into a future Kermit release. Thanks. bob brown brown@harvard.harvard.edu is a reliable return address if brown@carrara.marble.com bounces back at you. *** ckutio.c.~1~ Sat Nov 28 20:49:54 1987 --- ckutio.c Tue Dec 8 01:09:26 1987 *************** *** 1170,1175 **** --- 1170,1178 ---- conint(f) int (*f)(); { /* Set an interrupt trap. */ int x, y; + #ifdef SIGTSTP + int stptrap(); + #endif /* Check for background operation, even if not running on real tty, so that */ /* background flag can be set correctly. */ *************** *** 1204,1210 **** } else { signal(SIGINT,f); /* Catch terminal interrupt */ #ifdef SIGTSTP ! signal(SIGTSTP,f); /* Keyboard stop */ #endif #ifdef UXIII signal(SIGQUIT,esctrp); /* Quit signal, Sys III/V. */ --- 1207,1213 ---- } else { signal(SIGINT,f); /* Catch terminal interrupt */ #ifdef SIGTSTP ! signal(SIGTSTP,stptrap); /* Keyboard stop */ #endif #ifdef UXIII signal(SIGQUIT,esctrp); /* Quit signal, Sys III/V. */ *** ckuusr.c.~1~ Sat Nov 28 19:42:45 1987 --- ckuusr.c Tue Dec 8 01:15:03 1987 *************** *** 549,554 **** --- 549,563 ---- debug(F100,"terminal interrupt...","",0); doexit(GOOD_EXIT); /* Exit indicating success */ } + + + /* STRAP -- Handle SIGTSTP signals */ + + stptrap() { + conres(); /* restore terminal modes */ + kill(0, SIGSTOP); /* stop Kermit unconditionally */ + concb(); /* back to parsing terminal modes */ + } /* P A R S E R -- Top-level interactive command parser. */