home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / old / ckermit4e / ckuker.bwr < prev    next >
Text File  |  2020-01-01  |  82KB  |  2,283 lines

  1. C-Kermit Version 4E(072):
  2. Status, Bugs, and Problems
  3. As of: Wed May 29 08:39:56 1991
  4.  
  5. See the file ckuker.upd for a history of the changes that were made and
  6. bugs that were fixed in each release.
  7.  
  8. *********************
  9.  
  10. Version 5A of C-Kermit is in preparation, and will replace this version
  11. some time in 1991.  The most common complaint about version 4E is that it
  12. does not build properly on the IBM RS/6000 -- no surprise, since this version
  13. predates that computer (version 5A will, of course, support the RS/6000 and
  14. many other systems not supported by this version, and will include many new
  15. features including sliding windows, international character sets, built-in
  16. TCP/IP support, and an MS-DOS-Kermit-like script programming language).
  17. Meanwhile, instructions for modifying C-Kermit 4E for the RS/6000 are included
  18. at the end of this file.
  19.  
  20. **********************
  21.  
  22. BUILDING C-KERMIT
  23.  
  24. See the file ckuker.mak for instructions on building C-Kermit for different
  25. UNIX systems.  To use the ckuker.mak file, rename it to "makefile" or
  26. "Makefile", and give the UNIX command "make xxx", where "xxx" designates which
  27. kind of system you want to build C-Kermit for, e.g. "make bsd", "make xenix".
  28.  
  29. C-Kermit can also be built for VAX/VMS -- see the files ckv*.com and
  30. ckvker.bwr for further information.  Similarly for the Apple Macintosh
  31. (ckm*.*), Commodore Amiga (cki*.*), Data General AOS/VS (ckd*.*), etc.  This
  32. file applies to UNIX.
  33.  
  34. Following are hints, beyond what might be found in ckuker.mak, about building
  35. C-Kermit for various UNIX systems.
  36.  
  37. HP Integral PC -- "make sys3", but either remove code that sets up lock files,
  38. or have the lock files put in a directory that is guaranteed to be there,
  39. like /tmp.  Some problems reported when running under csh.
  40.  
  41. Most System V or System III based systems can build a working Kermit with
  42. "make sys3" or "make sys3nid" or "make att3bx" or (for Sys 5 R3) "make
  43. sys5r3".
  44.  
  45. Xenix variations of System III/V have their own makefile entries, "make
  46. xenix", "make sco286", etc.
  47.  
  48. AT&T System V R3 has redefined the type of the signal() function.  Use
  49. "make sys5r3".  If that doesn't work (as reportedly it does not on certain
  50. recent Xenix systems), "make sys3" or "make xenix".
  51.  
  52. AT&T 7300 has its own make option, "make sysvupc" as of 4E(068), to allow
  53. operation with its internal modem and system support thereof.
  54.  
  55. PDP-11's running a System III or V based Unix and which have no I & D space
  56. should use "make sys3nid".
  57.  
  58. DEC Pro-350 or -380 with Pro/Venix V2 (not V1) -- uses the regular "make sys3"
  59. or "make sys3nid", but the file ckcfio.c might have to be edited first to
  60. reduce the value of MAXWLD and/or SSPACE.  See below under HINTS for details.
  61.  
  62. Valid Scaldstar CAD system -- There's a "make valid" in the makefile, but
  63. reportedly one thing is still lacking: ckutio.c needs to #include<sys/file.h>.
  64.  
  65. -- HINTS --
  66.  
  67. - If the program dies with a message like "malloc fails in splitpath()"
  68.   whenever it tries to parse a filename (as in the "send" command), then
  69.   the amount of space allocated for filename expansion in the module
  70.   ckufio.c must be reduced.  This can be done by changing the #defines
  71.   for MAXWLD (the maximum number of filenames) and SSPACE (the size of
  72.   static string space) to make the numbers smaller.
  73.  
  74. - When modifying or writing Kermit code, do not pass to a function
  75.   (e.g., "signal") the address of a static function.  Doing so may
  76.   break VENIX code mapping.  If you must pass the address of the
  77.   function, make it global and pick a "non-generic" name for it that
  78.   will hopefully be unique and yet informative.
  79.  
  80.  
  81. -- BUG LIST --
  82.  
  83. First, a disclaimer must be made.  C-Kermit attempts to support all post-V6
  84. Unix variations on all machines.  This is a tall order, and requires careful
  85. attention to certain details.  As changes are made (and C-Kermit is still in
  86. stage of fairly rapid development), there is always the chance that a change
  87. -- made to introduce a new feature or fix a bug -- will not work as intended
  88. on some systems, even though it was tested successfully on others.  The main
  89. area to watch out for is not system differences (which are handled fairly well
  90. in the system-dependent ck?[ft]io modules), but in compiler differences,
  91. especially signed/unsighed int/char confusion.  Characters should be stored in
  92. variables of type char, not int, and char/int conversion should be avoided
  93. because of problems introduced by sign extension.  And i/o should not be used
  94. to read characters into int variables, because the way in which the system
  95. stores the character in an int varies from system to system (e.g.  68000s put
  96. them on the left, the VAX on the right).
  97.  
  98. If you have received a C-Kermit release that does not work correctly (except
  99. for the bugs & restrictions noted below), it is not because the release was
  100. not thoroughly tested -- it was -- but because it was not tested on your system
  101. since the last time changes were made, because of a lack of such a system to
  102. test it on.  If this happens to you, please try to track down the problem and
  103. report as specifically as possible back to Columbia.
  104.  
  105.  
  106. General problems:
  107.  
  108. - The program is too big, with too many features; source is too large to fit on
  109.   some disks.  Needs to be reorganized so that a minimal Kermit can be built
  110.   for any system, and then frills can be added on if desired -- interactive
  111.   command parser, help strings, dial command, script command, etc.
  112.  
  113. - There's not a full enough set of features available from command line
  114.   invocation.  Commands like "bye" are missing.  This is mainly to keep the
  115.   "kermit -h" help message small enough to fit on one screen.
  116.  
  117. - Conditionalizations are not done clearly.  In some cases it might be
  118.   better to have compile-time flags for features, rather than systems, or
  119.   generic system names, rather than specific vendor/machine names, to
  120.   avoid excessive nesting or repitition of compile-time variables.
  121.   Constructions like "#ifdef FOO | BAR" are avoided because many compilers
  122.   don't understand them; the alternative is to repeat code under different
  123.   conditionals (to accomplish an OR) or to include it within nested
  124.   conditionals (AND), sometimes applying De Morgan's law to achieve the
  125.   desired result... 
  126.  
  127. - Program's return code might be wrong in some cases (in 4.0, it was always
  128.   zero; in 4C some attempt is made to return correct codes for failure and
  129.   success).  Actually, no attempt has been made to correlate return codes
  130.   with success or failure of file transfer -- a bad return code only reflects
  131.   a fatal error.
  132.  
  133. - On some systems (e.g. TRS-80 Model 16 with Xenix V7, or HP-9000 HP-UX)
  134.   C-Kermit reportedly runs VERY SLOWLY.  The program could certainly do with
  135.   some tuning -- but not at the expense of modularity and transportability! --
  136.   but in the meantime, it can probably be sped up a lot by removing the
  137.   -DDEBUG from the makefile, eliminating hundreds of function calls, many of
  138.   them in critical code (one user reports a 1250% improvement doing this on 
  139.   the TRS-80 Model 16!).
  140.  
  141. - In reality, TANDEM flow control (XON/XOFF) is not really done on most
  142.   systems, because Kermit opens the communication line in rawmode, which
  143.   has the side effect of disabling flow control.  Rawmode is used in order
  144.   to allow 8-bit data.  Using cooked mode & CRMOD would be possible for
  145.   text files, but 8th-bit prefixing would be required for 8-bit binary
  146.   files.  But at least this would allow in-band flow control to take place.
  147.   Allegedly, 4.3BSD and Sys 5 R3 allow XON/XOFF and rawmode to coexist,
  148.   but this hasn't been verified.  It doesn't seem to happen on Ultrix 2.0.
  149.  
  150. - Need 'set' command for server timeout.
  151.  
  152. - The timeout interval is not automatically adjusted according to the
  153.   packet length.
  154.  
  155. - The program could be a little bit less cavalier in its treatment of files.
  156.   For instance, when receiving a file (with "warning" turned off) it will
  157.   overwrite any existing file of the same name.  That's ok, but what if the
  158.   user types ^F or ^B to interrupt the transfer?  This does not save the
  159.   existing file -- it's already been destroyed by the open() of the new copy,
  160.   which in turn is discarded as a result of the interruption.  Maybe Kermit
  161.   should always make a temporary, unique name for incoming files, and then
  162.   rename them to their real names only after the transfer is complete.  But
  163.   that's no good on systems (like the Macintosh) that don't have disk space
  164.   to burn.
  165.  
  166. - Local versus remote mode is not, and probably can not, be determined
  167.   automatically upon startup.  For instance, if you build Kermit with
  168.   "make sys3" on a 3B20 and a 3B2, the program has no way of knowing whether
  169.   it's running on a timesharing system (the 3B20, where it should be remote
  170.   by default) or a workstation (the 3B2, where it should be local by default).
  171.   If you find that Kermit comes up on your system in the wrong mode, you can
  172.   put the appropriate "set line" command in your .kermrc file -- "set line
  173.   /dev/tty" SHOULD always put you in remote mode.  (Actually, problems have
  174.   been reported for this on some systems that support incoming X.25 connections
  175.   on pseudoterminals.)
  176.  
  177. - If the program crashes or is halted (killed) from outside while it has the
  178.   terminal in a not-normal mode during command parsing or file transfer, the
  179.   terminal mode is not restored, and lock files are not cleaned up.  There can
  180.   be no fix for this within C-Kermit itself.  Subsequent Kermit runs may still
  181.   fail because the device is already opened by "another process" (you have
  182.   to log out & log in again to clear this one up).
  183.  
  184. - The shell's interrupt, delete, and kill characters may interfere or
  185.   conflict with those used by the Kermit command parser.  In any case, there
  186.   is no way to change Kermit's editing characters to conform to user's taste.
  187.  
  188. - "!" command requires a space after, contrary to the Unix user's normal
  189.   expectation.
  190.  
  191. - Many people have asked for a system-wide startup file similar to
  192.   the user's .kermrc file, perhaps with a conditional way to escape from
  193.   it if the user has her own .kermrc file.  This notion might be extended
  194.   to include the entire hierarchy system -- home -- current directory.
  195.  
  196. - Some users report that it would be more desirable to have an error during
  197.   execution of a take file return directly to command level, rather than
  198.   pop to the invoking take file, in case the error in question is of such
  199.   severity that it would cause all subsequent commands in the stack of TAKE
  200.   files to fail.  Best to have a SET command to control this behavior.
  201.   (This desired behavior does occur -- or at least should occur -- when the
  202.   program is in the background.)
  203.  
  204. - Some users report that the program should make no internal distinction
  205.   between running in foreground or background, so that program exit codes
  206.   are consistent, making it easier to debug shell scripts that invoke Kermit.
  207.  
  208. - Speaking of background, not all systems seem to define it the same way.
  209.   If your prompt disappears, you probably have one of those systems.  See
  210.   function conint() in ckutio.c, and try to figure out what's amiss.
  211.  
  212. - Speaking of conint(), it has been reported that there may be something
  213.   wrong with the way Unix Kermit responds to hangups.  Although it traps
  214.   the SIGHUP signal and cleans up and exits when a phone connection drops,
  215.   some users report that the line is unusable after that.
  216.  
  217. - Since Kermit opens and closes the communication line with each command line
  218.   invocation, it is not convenient to use it in scripts in which it is
  219.   repeatedly invoked (e.g. a print spooler).
  220.  
  221. - Opening & closing a comm line selected with 'set line' involves the use
  222.   of UUCP "lock files", whose use is inconsistent from one Unix variation to
  223.   another, and from site to site and system to system.  The lack of a
  224.   consistent, reliable way to guarantee exclusive access to a communication
  225.   line is one of Unix's biggest shortcomings. 
  226.  
  227. - There is very little provision in the program (as yet) for running setuid.
  228.   Nor for dealing with bidirectional terminal lines.  Nor with system-provided
  229.   dialer programs.  Every system does these things differently.
  230.  
  231. - Variable names are sometimes confusing, especially the send/receive parameter
  232.   pairs (spsiz/rpsize, mystch/stchr, npad/mypadn, rtimo/timint, etc).  This
  233.   is mostly history... they tend to agree with the names used in other Kermit
  234.   programs.  Still, they should probably be changed.  Ditto for some of the
  235.   procedure names.
  236.  
  237. - Some C compilers do not support variable names longer than 6, nor function
  238.   names longer than 5, and some are not case sensitive (one DEC-20 C compiler
  239.   has all these restrictions, and the V6 Unix C compiler has some of them).
  240.   To ensure the widest possible portability, all identifiers should comply
  241.   with these restrictions -- currently many do not.
  242.  
  243. - When the C-Kermit server is given a host command (or even some generic
  244.   commands like 'space'), it might have to think for a long time before
  245.   returning output.  In this case, it should set a timer while waiting for
  246.   input from the fork and whenever the timer goes off, it should send a null
  247.   data packet to prevent the other Kermit from timing out.
  248.  
  249. - When connecting back to C-Kermit after a transaction, or after finishing
  250.   the server, it may be necessary to type a ^Q to clear up an XOFF deadlock.
  251.   There's not much the Kermit program can do about this...
  252.  
  253. - When interrupting a send with ^F or ^B, an appropriate message does not
  254.   seem to make it into the transaction log.
  255.  
  256. - The transaction log should record file type (text or binary).
  257.  
  258. - There should be a nonverbose transaction log, in the Unix tradition,
  259.   which can be read by another program.  For instance, if Kermit is
  260.   used to 'send *', but only certain of the files make across successfully,
  261.   another program could read the list of those files and do something to
  262.   them (like (re)move them).
  263.  
  264. - The program should be interruptable at any point -- in interactive command
  265.   mode, during file transfer (but not during CONNECT), by Ctrl-C, which should
  266.   return you to the command prompt, rather than always exiting.
  267.  
  268. ckucmd.c:
  269.  
  270. - Interactive Kermit commands that come in from a pipe (as in
  271.   "cat foo | kermit") are echoed.  Some people think they should not be.
  272.   The fix can be made (at some expense) in getwd() by adding a line to
  273.   the first if () {} block, "if (!isatty(0)) echof = 1;".
  274.   (Not sure if this is still true...)
  275.  
  276. ckufio.c:
  277.  
  278. - ckufio currently goes to a lot of trouble to traverse the directory in
  279.   order to expand "*" and "?" in wildcards.  Maybe it should just fork the
  280.   user's customary shell and have it do the expansion.  This would allow
  281.   fancier filespecs to be given, like "~/ck*.[cwh]".  But it would slow down
  282.   features like filename completion and menus in the interactive command
  283.   parser.  (Find out how Unix FTP does it...)
  284.  
  285. ckutio.c:
  286.  
  287. - Myread() should be expanded to include systems that can't do nonblocking
  288.   reads, but can find out how many characters are in the input buffer -- this
  289.   would eliminate calling read() in a loop for each character during packet
  290.   transmission (e.g. Pro/Venix V1 could use "ioctl(x,TIOCQCNT,&y)", V7 could
  291.   use its buffer-queue-peeking trick, etc).  (myread() was eliminated from
  292.   BSD, and the same technique is used as in ckucon.c -- do a single-char
  293.   blocking read, then check how many more chars are in the buffer, then read
  294.   that many -- it's faster.)
  295.  
  296. - There's no good way to select baud rates higher than 9600.  Most Unix systems
  297.   don't supply symbols for them (unless you use EXTA, EXTB), and even when they
  298.   do, the program has no way of knowing whether a specific port serial
  299.   controller supports those rates.  (This is partially addressed in 4E(071).)
  300.  
  301. - On some systems, there is an undesired interaction between the various
  302.   open() modes, fnctl(), and ioctl() invocations when modem-control lines
  303.   are involved.  Some of this due to bugs in some Unix implementations or to
  304.   inconsistencies between them (e.g. as to the behavior of TIOCEXCL, etc).
  305.   In particular, the whole business about opening modem-controlled lines
  306.   with O_NDELAY before dialing and then switching modes after causes no end of
  307.   confusion and trouble.
  308.  
  309. - The Sys III/V code in tthang() is confusing, and possibly incorrect --
  310.   the closing and reopening of the ttyfd.  Often produces an annoying message
  311.   "Problem hanging up phone".
  312.  
  313. ckudia.c:
  314.  
  315. - Some systems do not allow users to manipulate dialers directly.
  316. - Should support a "phone book" (this would actually go in ckuus*.c).
  317. - Pro/Venix V2 (and some other Sys V-based systems) are having DTR-dropping
  318.   problems when dialing.  With Pro/Venix V2, a workaround is to get the system
  319.   to ignore the modem control signals and treat the line as a direct line by
  320.   issuing a "setline -d xxx" command, where "xxx" is the device node (e.g.
  321.   com1), rather than "setline -m xxx".
  322. - Should do "demon dialing" (keep trying till there's a connection).
  323.  
  324. ckuus*.c:
  325.  
  326. - When an alternate filename is given for an incoming file name, and the
  327.   alternate name is uppercase, the name is lowercased.  Alternate names
  328.   should be taken literally.
  329.  
  330. - Baud rate selection currently requires user to type a number, which is
  331.   then verified against a system-dependent table.  Better to have a baud rate
  332.   keyword (cmkey) table defined in the system-dependent module, so user
  333.   can abbreviate (e.g. '9' for '9600').  Also, it's a pain having parallel
  334.   tables in ckuus3.c, ckutio.c, etc.  Should consolidate this.
  335.  
  336. - No way to put trailing comments on commands.
  337.  
  338. - ckuus2.c reportedly makes the C optimizer run out of space under PC/IX and
  339.   some other systems.  C compilers just don't like strings...
  340.  
  341. Protocol (ckcpro.w, ckcfn*.c):
  342.  
  343. - No way to interrupt a protocol transaction until after it starts
  344.   successfully.  For instance, no way to interrupt the timeouts and
  345.   retransmissions of the initial packet when the other side is not
  346.   responding, except for killing the whole program.  Cure: check for
  347.   keyboard "interrupts" during the send-init process, set c[xz]seen.
  348.   But doing this will make the state table a lot more complicated...
  349.   Maybe change ^C trap to get back to command mode rather than exit
  350.   the program.
  351.  
  352. ckucon.c:
  353.  
  354. - Doesn't do any particular kind of terminal emulation.  It wasn't meant to.
  355.   Filters can be used for this.  Or a replacement module can be written
  356.   (as has been done for the Macintosh).
  357.  
  358. - When sending BREAK, should clear output buffer first (this is done in BSD,
  359.   should be added for other systems to ttsndb() in ckutio.c).
  360.  
  361. - Performance is poor on systems that can't check the input buffer or
  362.   do nonblocking read() calls.  See the horrendous code that was added for V7
  363.   to get around this (peeking into tty buffers in kernel memory).
  364.  
  365. - As structured, connect mode can't include commands to toggle logging on
  366.   and off or to change settings, because the fork that reads keyboard input
  367.   doesn't share variables with the fork that does port i/o.
  368.  
  369. - Reportedly, a control-S typed at the keyboard doesn't always seem to "take"
  370.   when doing terminal emulation under Pro/Venix V2 (DEC micros, terminals,
  371.   devices, systems are notorious for their insistence on doing XON/XOFF and
  372.   attendant problems.  Remember the VT180?)
  373.  
  374. - Should have a shell escape ("push").
  375.  
  376. ------------------------------
  377.  
  378.  
  379. KNOWN BUGS
  380.  
  381. Rolm dialing doesn't work for outpool modem calls.  This is because it returns
  382. a CALL COMPLETE indication only for local data calls.  This will be fixed in
  383. the next release of Rolm's CBX software.  Other dialing untested so far in
  384. this version.
  385.  
  386. Ctrl-C out of dialing sometimes results in "longjump botch" and core dump, at
  387. least on VAX/Ultrix with "set modem rolm".
  388.  
  389. ------------------------------
  390.  
  391.  
  392. COLLECTED COMMENTS AND HINTS FROM USERS AND DEVELOPERS:
  393.  
  394. Date: Sun, 15 Jan 89 19:37 MDT
  395. From: Joe Doupnik <JRD@cc.usu.edu>
  396. Subject: Hints for C-Kermit on ATT7300
  397.  
  398. For Unix PC owners here are a couple of hints. The name of the phone line
  399. devices are /dev/ph0 and /dev/ph1. The RS232 serial port is /dev/tty000. These
  400. names are in the manuals (somewhere).
  401.  
  402. Dialing out with the internal modem -
  403.     C-Kermit> set line /dev/ph0    (or /dev/ph1  for the second phone line)
  404.     C-Kermit> set speed 1200
  405.     C-Kermit> set modem att
  406.     C-Kermit> dial (123) 555-1212    (Control-C will terminate the dialer)
  407.  
  408. The telephone line must be in the DATA state; C Kermit will remind you of
  409. this if it finds the line in VOICE state.
  410. When exiting C Kermit the system will hang waiting for Control-\ to be
  411. typed; ignore the resulting message "Warning, problem hanging up the phone."
  412.  
  413. Connecting via the RS232C serial port -
  414. At the o/s prompt say
  415.     $ /usr/bin/getoff.sh tty000        to turn off the login processor
  416.     $ Kermit                fire up C Kermit
  417.     C-Kermit> set line /dev/tty000        name of the serial port
  418.     C-Kermit> set speed nnnn        whatever speed is best
  419.     start doing work
  420.     after exiting C Kermit you may say
  421.     $ /usr/bin/geton.sh tty000        restore login processor to the line
  422.  
  423. One may omit the getoff/getoff lines if the line is not used for logging in.
  424.  
  425.     Regards,
  426.     Joe D.
  427.  
  428. ------------------------------
  429.  
  430. Date: Sun, 24 Nov 85 04:16:02 CST
  431. From: Stan Barber <neuro1!sob@rice.ARPA>
  432. Subject: more notes on C-kermit 4C(057)
  433. Organization: Neurophysiology, Baylor College of Medicine, Houston, Tx
  434.  
  435. One more suggestion:
  436.  
  437. I would provide some mechanism to allow SYSIII compatible sites to 
  438. configure what signal that might like to use to allow the child and
  439. parent to notify each other of problems. At my site, SIGUSR1 can not
  440. be used by kermit, so I modify ckucon.c by replacing SIGUSR1 with
  441. SIGUSR2. That fixes everything just fine.
  442.  
  443. At least a warning should be noted somewhere (in the .bwr file, I guess)
  444. so that people will know to change it.
  445.  
  446. Alternatively, I would suggest a unique name (SIGKERMIT) that the
  447. installer can define in the makefile (e.g. -DSIGKERMIT=SIGUSR2) to
  448. keep people from mucking in the source file.
  449.  
  450. ------------------------------
  451.  
  452. Date:  9 Apr 1986 1105-EST (Wednesday)
  453. From: Vic Abell <abe@purdue-asc.arpa>
  454. Subject: Kermit and 4.xBSD rlogin
  455.  
  456. There is an undocumented option on the 4.xBSD rlogin call that must be used
  457. when C Kermit is at the end of a TCP/IP rlogin connection.  The option is "-8"
  458. and should be used in the following fashion:
  459.  
  460.     % rlogin hostname -8
  461.     % kermit
  462.  
  463. Vic Abell, Purdue University Computing Center
  464. abe@asc.purdue.edu, ...!pur-ee!pucc-j!abe
  465.  
  466. ------------------------------
  467.  
  468. Date: Fri 5 Sep 86 13:59:44-EDT
  469. From: Fred Wang <OP.FRED@CU20B.COLUMBIA.EDU>
  470. Subject: problem compiling kermit on the 3b2/310
  471.  
  472.     If Mr. Ray's 3b2/310 is running  the new C compiler (CFP+)  he
  473. will run into problems when he issues the 'make att3bx' command.  CFP+
  474. uses the  'fpcc'  rather  than  the conventional  'cc'  to  compile  C
  475. programs.
  476.  
  477.     My suggestion to Mr. Ray's problem (if indeed he has CFP+)  is
  478. to substitute fpcc for cc in the variables CC and CC2 in the  makefile
  479. text. This worked fine for my 3b2/310 running Unix System V 2.0.4 with
  480. CFP+ C compiler.
  481.  
  482. ------------------------------
  483.  
  484. Date:     Fri, 12-SEP-1986 18:54 EDT
  485. From:     Kuryan Thomas <THOMASK@VTVAX5>
  486. Subject:  C-Kermit
  487. To:       fdccu@cuvmb
  488.  
  489. This is Kuryan Thomas at Virginia Tech again.  I talked to you about the
  490. modem problem I was having with my 6300plus.  I think I found the problem --
  491. tthang() does an ioctl() call to clear the CBAUD field, which ought to
  492. cause a hangup.  On my system, ioctl() doesn't like to be called with a
  493. zero baud, and returns -1, which causes tthang() to return an error.
  494. I think this may be why I always get a "Warning, problem hanging up the
  495. phone" whenever I exit Kermit (regardless of the "set modem" setting).
  496.  
  497. I don't know how to cure this, but I'm not going to try.  I think I prefer
  498. the "aberrant" behavior.  This way, I can start a session on a remote
  499. Kermit, start its server, come back down to my shell, and start a long
  500. file-transfer in the background.  This wouldn't work if Kermit could
  501. hang up the phone, because I'd have to use Kermit interactively.  I often
  502. transfer quite large files, and it's actually an advantage instead of a bug
  503. that C-Kermit can't hang up my phone!
  504.  
  505. Amazing how problems can be turned to your advantage, isn't it?
  506.  
  507. Thanks for replying to my earlier message.
  508.  
  509. ------------------------------
  510.  
  511. Date: Mon, 15 Sep 86 21:35:48 CST
  512. From: rice!sob@soma.BCM.TMC.EDU (Stan Barber)
  513. To: info-kermit@cu20b.columbia.edu
  514. Subject: NEWUUCP conditional in C-KERMIT
  515.  
  516. You do need to define the NEWUUCP conditional to get the 4.3 acucntrl support.
  517. Also, lock files are now kept in a seperate globally writable LCK directory
  518. so unpriviledged programs can LCK lines without have write permission on
  519. /usr/spool/uucp. This will keep uucp from stomping on kermit.
  520.  
  521. Stan
  522.  
  523. [Ed. - NEWUUCP is currently not defined anywhere, so this code never gets
  524. used.] 
  525.  
  526. ------------------------------
  527.  
  528. Date: Fri, 17 Oct 86 15:17:14 EDT
  529. From: Chris Maio <chris@columbia.edu>
  530. To: sy.fdc@cu20b.columbia.edu
  531. Subject: telnetd "fix"
  532.  
  533. [Ed. - The following fix allows C-Kermit to work with 4.3BSD systems which are
  534. accessed via TCP/IP-based terminal servers.  The fix is to TELNET, not Kermit.
  535. Thanks to Chris Maio of the Columbia University Computer Science Department for
  536. tracking down the problem and providing a workaround.]
  537.  
  538. This fix for /etc/telnetd in 4.3 BSD is really only a workaround, designed
  539. to allow kermit, uucp, emacs, and other programs to receive carriage-return
  540. chararacters over a "netascii mode" telnet connection where the client is
  541. mapping carriage return to CRLFs (what I suspect to be the most common
  542. case for terminal servers and non-UNIX telnet implementations).  The real
  543. solution is to use telnet binary mode connections, but not all telnet clients
  544. allow the user to negotiate this.
  545.  
  546. In /usr/src/etc/telnetd.c, routine telrcv(), line 640, replace
  547.  
  548.             c = '\n';
  549. with
  550.             c = '\r';
  551.  
  552. This fix is inappropriate if you have telnet clients which map CR into CR NUL,
  553. and LF into CR LF, since those clients will then be unable to generate send the
  554. linefeed character through to the application when CRMOD is turned off.  See
  555. RFC 854 for more details.
  556.  
  557. The basic problem is that any program that manipulates the terminal will
  558. generally only work right if the telnet connection is "binary mode" (remember
  559. those odd commands you have to give to a TAC?).  Many telnet user interfaces,
  560. including the terminal concentrators we use, don't provide a way for the user
  561. to specify binary mode instead of netascii mode.  TOPS-20 is a lot smarter
  562. about this kind of thing, e.g. it negotiates telnet binary mode when a program
  563. running on a TVT specifies binary input from its controlling terminal, but
  564. I'm sure there are still bugs in TOPS-20's implementation.
  565.  
  566.                         Chris
  567.  
  568. ------------------------------
  569.  
  570. Date: Wed, 7 Jan 87 00:55:42 EST
  571. From: nelson@NLM-VAX.arpa (Gary Nelson)
  572. Subject: Xenix on IBM-PC/AT & SCO Xenix V
  573. Keywords: Xenix, C-Kermit, SCO Xenix
  574.  
  575. In response to request for users of C-Kermit 4D(061) on SCO Xenix:
  576.  
  577. My configuration:    IBM-PC/AT
  578.             SCO Xenix Release 2.1.3 (Update E & F)
  579.  
  580. The dial command did not work after updating to the release of SCO
  581. Xenix V.  The following diff file corrects problem in ckutio.c that broke
  582. the dial command.  Note, if you are on SCO Release 2.1.0 - DO NOT include
  583. this fix, leave the 4D061 version as released alone - it works fine.  The
  584. nap() mod is not neccessary - just saw it and changed it to use an available
  585. facility.
  586.  
  587. ********** start of diff file ********** 
  588.  
  589. 14a15,27
  590. > /* Modification history:
  591. > 23-NOV-86    Gary B. Nelson, Nelson Associates, Manassas, VA
  592. >         As a consequence of my new release of SCO Xenix V2.1.3
  593. >             breaking kermit:
  594. >         Mods to msleep to use nap(), note -> add "-lx" to
  595. >             LNKFLAGS in the makefile.
  596. >         Mods to tthang to make it work again, with this new release
  597. >             of XENIX (symptom was that the dial command
  598. >             stopped working, a problem that was incorrectly
  599. >             diagnosed by ?? as seen on the usenet a few days ago).
  600. > */
  601. 527d539
  602. < #ifndef XENIX        /* xenix cannot do close/open when carrier drops */
  603. 532d543
  604. < #endif
  605. 1416,1418c1427
  606. < #ifdef XENIX
  607. < #define CLOCK_TICK 50            /* millisecs per clock tick */
  608. < #else
  609. > #ifndef XENIX
  610. 1420d1428
  611. < #endif
  612. 1431a1440,1446
  613. > #endif
  614. > #endif
  615. > #ifdef UXIII
  616. > #ifdef XENIX
  617. >     nap( (long) m );
  618. > #endif
  619.  
  620. ********** end of diff file ********** 
  621.  
  622. ------------------------------
  623.  
  624. From: sob@watson.tmc.edu (Stan Barber)
  625. Subject: C-Kermit Lock Files
  626. Date: 20 Aug 87 21:26:17 GMT
  627. Keywords: C-Kermit, Unix Lock Files
  628.  
  629. I should point out that C-Kermit(041) does handle lock files correctly under
  630. BSD4.3 with the 4.3UUCP locking structure.  This creates a lock directory
  631. (/usr/spool/uucp/LCK) that is publically writable and each program (except
  632. kermit) using the locking protocol is smart enough to test for dead locks
  633. (coming from programs that aborted and did not remove its lock).
  634.  
  635. Stan
  636.  
  637. [Ed. - Presumably, this is also true for 4E?]
  638.  
  639. ------------------------------
  640.  
  641. Date: 13 Sep 87 17:22:26 GMT
  642. From: warren@pluto.UUCP (Warren Burstein)
  643. Subject: patches to ckermit
  644. Organization: Industrial Automation Systems - New York, NY
  645.  
  646. These patches add to ckermit a "set phone" command.  Aliases
  647. are recognized in the "dial" command.  My .kermrc is now full of
  648. set phone commands.
  649.  
  650. The new command looks like
  651.    set phone pacx 280-8050
  652. After this command, I can say
  653.    dial pacx
  654.  
  655. I don't know how to make a "patch" file so here is a shar
  656. of all the diffs.
  657.  
  658. I am leaving the net in two days, I hope to be back on in
  659. a while and pick up my mail from this machine.
  660.  
  661. I didn't use any fancy methods to store phone numbers, it didn't
  662. seem worth the effort.
  663.  
  664. ---------------
  665. # This is a shell archive.  Remove anything before this line, then
  666. # unpack it by saving it in a file and typing "sh file".  (Files
  667. # unpacked will be owned by you and have default permissions.)
  668. #
  669. # This archive contains:
  670. # ckudia.diff ckuus3.diff ckuusr.diff ckuusrh.diff
  671.  
  672. echo x - ckudia.diff
  673. cat > "ckudia.diff" << '//E*O*F ckudia.diff//'
  674. 73,75d72
  675. <  *
  676. <  *   6-May-87  Support for phone aliases
  677. <  *                            -- Warren Burstein
  678. 126d122
  679. < char *malloc(), *strcpy();
  680. 422,431d417
  681. < /*
  682. <  * Array of phone aliases, unsorted
  683. <  */
  684. < #define MAXPHONES 100
  685. < struct phones {
  686. <     char *name, *number;
  687. < } phones[MAXPHONES];
  688. 528d513
  689. <     struct phones *lookup_phone(), *p;
  690. 530,537d514
  691. <     if ( !isdigit(*telnbr))
  692. <         if (p = lookup_phone(telnbr))
  693. <           telnbr = p->number;
  694. <         else {
  695. <             printf("I don't recognize that system\n");
  696. <             return -2;
  697. <         }
  698. 866,927d842
  699. < }
  700. < /*
  701. <  * Following code added by WB for phone aliases.
  702. <  */
  703. < /*
  704. <  * Add a phone alias.
  705. <  */
  706. < add_phone(name, number)
  707. < char *name, *number;
  708. < {
  709. <     struct phones *p;
  710. <     /*
  711. <      * If name is in use, redefine its number.
  712. <      */
  713. <     if (p = lookup_phone(name)) {
  714. <         free(p->number);
  715. <         p->number = malloc(strlen(number) + 1);
  716. <         (void) strcpy(p->number, number);
  717. <         return;
  718. <     }
  719. <     /*
  720. <      * Find a vacancy in the table.
  721. <      */
  722. <     for (p = phones; p < &phones[MAXPHONES]; p++)
  723. <       if ( !p->name) {
  724. <           p->name = malloc(strlen(name) + 1);
  725. <           (void) strcpy(p->name, name);
  726. <           p->number = malloc(strlen(number) + 1);
  727. <           (void) strcpy(p->number, number);
  728. <           return;
  729. <       }
  730. <     printf("There are too many phone aliases.\n");
  731. < }
  732. < /*
  733. <  * Returns phone number to use, or NULL if phone number could not be found.
  734. <  */
  735. < struct phones *lookup_phone(name)
  736. < char *name;
  737. < {
  738. <     struct phones *p;
  739. <     for (p = phones; p < &phones[MAXPHONES]; p++)
  740. <         if (p->name && !strcmp(p->name, name))
  741. <             return p;
  742. <     return (struct phones *) 0;
  743. < }
  744. < shphones() {
  745. <     struct phones *p;
  746. <     for (p = phones; p < &phones[MAXPHONES]; p++)
  747. <       if (p->name)
  748. <         printf("%s %s\n", p->name, p->number);
  749. //E*O*F ckudia.diff//
  750.  
  751. echo x - ckuus3.diff
  752. cat > "ckuus3.diff" << '//E*O*F ckuus3.diff//'
  753. 268,280d267
  754. <   case XYPHONE:
  755. <     {
  756. <         char name[30], number[30];
  757. <         if ( (x = cmfld("name of phone alias", "", &s)) < 0) return x;
  758. <         (void) strcpy(name, s);
  759. <         if ( (x = cmfld("phone number", "", &s)) < 0) return x;
  760. <         (void) strcpy(number, s);
  761. <         add_phone(name, number);
  762. <     }
  763. <     break;
  764. //E*O*F ckuus3.diff//
  765.  
  766. echo x - ckuusr.diff
  767. cat > "ckuusr.diff" << '//E*O*F ckuusr.diff//'
  768. 436d435
  769. <     "phone-number",     XYPHONE, 0,
  770. 473,474c472
  771. < #define SHPHONE 2            /* phone numbers */
  772. ---
  773. >  
  774. 477d474
  775. <     "phone-aliases",   SHPHONE, 0,
  776. 1085,1089c1082
  777. <     case SHPHONE:
  778. <         shphones();
  779. <         break;
  780. ---
  781. >  
  782. //E*O*F ckuusr.diff//
  783.  
  784. echo x - ckuusrh.diff
  785. cat > "ckuusrh.diff" << '//E*O*F ckuusrh.diff//'
  786. 104c104
  787. < #define XYPHONE 33                /* set phone alias - WB */
  788. ---
  789. >  
  790. //E*O*F ckuusrh.diff//
  791.  
  792. exit 0
  793. -- 
  794. /|/~\~~\    The entire world             Warren Burstein
  795.  |__/__/_/  is a very strange carrot.
  796.  |          But the farmer               philabs!tg!pluto!warren
  797. /           is not afraid at all.        Why doesn't life come with subtitles?
  798.  
  799. ------------------------------
  800.  
  801. Date: Mon, 21 Sep 87 09:54:28 PDT
  802. From: kevin@ACC-SB-UNIX.ARPA (Kevin 0'Gorman)
  803. Subject: C-kermit 067 / UNIX PC
  804.  
  805. The comments in the makefile about AT&T 3bx machines DO NOT APPLY
  806. to the 3b1.  This machine uses the standard lock files.  However, when using
  807. the "shared libraries" (highly recommended) available on the UNIX PC, there
  808. is a name conflict which makes it useful to add something like
  809.     -Dopeni=UPCOI -Ddial=UPCDIAL
  810. to the cc command line.  I accordingly create a new version, like the sys3
  811. entry except for this addition.  I call it unixpc, though upc would also be
  812. familiar to UNIX PC hackers.
  813.  
  814. ------------------------------
  815.  
  816. Date: Wed, 23 Sep 87 08:43:02 EDT
  817. From: Marshall_DeBerry@um.cc.umich.edu
  818. Subject: C-Kermit on Tandy 6000
  819.  
  820.   I am currently running 4D(061) kermit on a Tandy 6000 with no
  821. problems.  My machine has 512K memory and a 15 Meg hard drive.  It
  822. runs at 6Mhz.  I have not experienced any problems with "slowness",
  823. as other's have often described.  As a matter of fact, my machine is
  824. in reality on old Model II that was upgraded to essentially a Model 16a,
  825. which is my case is equivalent to a Model 6000 now.  Anyway, the Xenix
  826. that Tandy current supports is Xenix 3.1.2, which is pretty much like
  827. system III.  Note that all the versions of kermit I have compiled on my
  828. machine have been done under Xenix 3.xx.  The earlier version of Xenix that
  829. Tandy put out for the first Model 16's was done from a version 7 Unix base.
  830. I have had no expericence with the older Xenix.  However, if you are using that
  831. version, you really should pay the $99.00 to Tandy and upgrade to version
  832. 3.xx. (At least it was $99.00 about a year and a half ago).
  833.   Anyhow, to compile c-kermit on a 6000 under Xenix 3.xx, you need to do
  834. two things:
  835.  1).  Look in the source files for the use of identifier "void". If you
  836.      find that identifier in a file, make sure you put  the include
  837.      line "#include <sys/types.h>" at the top of that file with the
  838.      other include statements.
  839.  2).  Say make sys3, and wait awhile.  If your system is fully loaded,
  840.       ie, about 90% full on the hard drive, and little memory, you may
  841.       not be able to compile the program.  Make space on your hard drive
  842.       (down to around 75% free), and try again.  It may take as long as
  843.       a half hour to compile.
  844.  
  845. Note that I recently compiled the experimental c-kermit (the "new release")
  846. on a 6000 under Xenix 3.1.2 with no problems, save for the "void" identifier.
  847.  Also note that I am the only user of my machine, ie, I don't have other
  848.  users running out of tty ports.  I can't tell you what running kermit
  849.  is like on a 6000 with 2-3 other users.
  850.  
  851. I hope this information is of help to Tandy 6000 owners trying to get kermit
  852. up and running.
  853.  
  854. ------------------------------
  855.  
  856. To: info-kermit@cu20b.columbia.edu
  857. Subject: minor bug in c-kermit
  858. Date: Thu, 01 Oct 87 23:52:57 EDT
  859. From: moore@UTKCS2.CS.UTK.EDU
  860.  
  861. In C-Kermit 4E(067) 14 Sep 87, 4.2 BSD:
  862. When compiling under Ultrix 2.0, using the vcc C compiler (which is slightly
  863. better than pcc), C-Kermit doesn't compile cleanly, due the the existence
  864. of several #ifdef vax11c lines in some of the .h files.  These have been used
  865. to denote VAX/VMS specific code.  The vcc compiler pre-defines the symbol
  866. vax11c on Ultrix just as it does on VMS.  C-Kermit can be made to compile
  867. cleanly on both Ultrix and VMS if these lines are changed to #ifdef vms.
  868.  
  869. Keith Moore
  870. UT Computer Science Dept.    Internet: moore@utkcs2.cs.utk.edu
  871. 107 Ayres Hall, UT Campus    CSnet: moore@tennessee
  872. Knoxville Tennessee        BITNET: moore@utkcs1
  873.  
  874. ------------------------------
  875.  
  876. Date: Wed, 21 Oct 87 22:20:18 EDT
  877. From: cbmvax!vu-vlsi!devon!paul@RUTGERS.EDU (Paul Sutcliffe Jr.)
  878. Subject: Diffs for C-Kermit 4D(061) and Tandy 6000
  879. Keywords: C-Kermit 4D(061), Tandy Kermit
  880.  
  881. In Info-Kermit Digest V6 #23, I said I'd send the diffs along to compile
  882. C-Kermit on a Tandy 6000.  Here they are.  Note that they assume that one is
  883. running Tandy Xenix 3.0 or greater.
  884.  
  885. Install these diffs in the "stock" 4D(061) C-Kermit distribution, and then
  886. type "make trs16" to compile.  In reality, you only need to make the
  887. modification to the makefile (ckuker.mak); the other diffs just make the
  888. startup banner agree with the operating system version -- I didn't like
  889. kermit saying "Xenix/286" on my 68000!
  890.  
  891. - paul
  892.  
  893. =========== CUT HERE ===========
  894.  
  895. *** .orig/ckuker.mak    Fri Nov 21 16:04:08 1986
  896. --- ckuker.mak    Sun Jan 18 13:29:07 1987
  897. ***************
  898. *** 226,231
  899.           "LNKFLAGS = -F 3000 -i"
  900.   
  901.   
  902.   #PC/IX, Interactive Corp System III for IBM PC/XT
  903.   pcix:
  904.       make wermit \
  905.  
  906. --- 226,237 -----
  907.           "LNKFLAGS = -F 3000 -i"
  908.   
  909.   
  910. + #Tandy 16/6000 with Xenix 3.0
  911. + trs16:
  912. +     make wermit "CFLAGS= -DTRS16 -DXENIX -DUXIII -DDEBUG -DTLOG -DM_VOID -Dvoid=int -F 3000 -n" \
  913. +         "LNKFLAGS = -F 3000 -n"
  914.   #PC/IX, Interactive Corp System III for IBM PC/XT
  915.   pcix:
  916.       make wermit \
  917.  
  918. *** .orig/ckufio.c    Fri Nov 21 16:04:08 1986
  919. --- ckufio.c    Sat Jan 17 20:43:16 1987
  920. ***************
  921. *** 63,68
  922.   /* Sys III/V, Xenix, PC/IX,... support by Herm Fischer, Litton Data Systems */
  923.   #ifdef UXIII
  924.   #ifdef XENIX
  925.   char *ckzsys = " Xenix/286";
  926.   #else
  927.   #ifdef PCIX
  928.  
  929. --- 63,71 -----
  930.   /* Sys III/V, Xenix, PC/IX,... support by Herm Fischer, Litton Data Systems */
  931.   #ifdef UXIII
  932.   #ifdef XENIX
  933. + #ifdef TRS16
  934. + char *ckzsys = " Xenix/68000";
  935. + #else
  936.   char *ckzsys = " Xenix/286";
  937.   #else
  938.   #ifdef PCIX
  939. ***************
  940. *** 71,76
  941.   #ifdef ISIII
  942.   char *ckzsys = " Interactive Systems Corp, System III";
  943.   #else
  944.   char *ckzsys = " AT&T System III/System V";
  945.   #endif
  946.   #endif
  947.  
  948. --- 74,80 -----
  949.   #ifdef ISIII
  950.   char *ckzsys = " Interactive Systems Corp, System III";
  951.   #else
  952. + #ifndef TRS16
  953.   char *ckzsys = " AT&T System III/System V";
  954.   #endif
  955.   #endif
  956. ***************
  957. *** 72,77
  958.   char *ckzsys = " Interactive Systems Corp, System III";
  959.   #else
  960.   char *ckzsys = " AT&T System III/System V";
  961.   #endif
  962.   #endif
  963.   #endif
  964.  
  965. --- 76,83 -----
  966.   #else
  967.   #ifndef TRS16
  968.   char *ckzsys = " AT&T System III/System V";
  969. + #endif
  970. + #endif
  971.   #endif
  972.   #endif
  973.   #endif
  974.  
  975. *** .orig/ckutio.c    Fri Nov 21 16:04:09 1986
  976. --- ckutio.c    Sat Jan 17 20:44:47 1987
  977. ***************
  978. *** 96,101
  979.   /* Sys III/V, Xenix, PC/IX support by Herm Fischer, Encino, CA */
  980.   #ifdef UXIII
  981.   #ifdef XENIX
  982.   char *ckxsys = " Xenix/286";
  983.   #else
  984.   #ifdef PCIX
  985.  
  986. --- 96,104 -----
  987.   /* Sys III/V, Xenix, PC/IX support by Herm Fischer, Encino, CA */
  988.   #ifdef UXIII
  989.   #ifdef XENIX
  990. + #ifdef TRS16
  991. + char *ckxsys = " Xenix/68000";
  992. + #else
  993.   char *ckxsys = " Xenix/286";
  994.   #else
  995.   #ifdef PCIX
  996. ***************
  997. *** 104,109
  998.   #ifdef ISIII
  999.   char *ckxsys = " Interactive Systems Corp System III";
  1000.   #else
  1001.   char *ckxsys = " AT&T System III/System V";
  1002.   #endif
  1003.   #endif
  1004.  
  1005. --- 107,113 -----
  1006.   #ifdef ISIII
  1007.   char *ckxsys = " Interactive Systems Corp System III";
  1008.   #else
  1009. + #ifndef TRS16
  1010.   char *ckxsys = " AT&T System III/System V";
  1011.   #endif
  1012.   #endif
  1013. ***************
  1014. *** 105,110
  1015.   char *ckxsys = " Interactive Systems Corp System III";
  1016.   #else
  1017.   char *ckxsys = " AT&T System III/System V";
  1018.   #endif
  1019.   #endif
  1020.   #endif
  1021.  
  1022. --- 109,116 -----
  1023.   #else
  1024.   #ifndef TRS16
  1025.   char *ckxsys = " AT&T System III/System V";
  1026. + #endif
  1027. + #endif
  1028.   #endif
  1029.   #endif
  1030.   #endif
  1031.  
  1032. =========== CUT HERE ===========
  1033.  
  1034. Paul Sutcliffe, Jr.
  1035.  
  1036. UUCP (smart):  paul@devon.UUCP
  1037. UUCP (dumb):   ...{rutgers,ihnp4,cbosgd}!bpa!vu-vlsi!devon!paul
  1038.  
  1039. ------------------------------
  1040.  
  1041. Date: Tue, 3 Nov 87 08:20:38 CST
  1042. From: munnari!adl.austek.oz.au!rsharpe@uunet.UU.NET
  1043.  (Richard Sharpe--Apprentice Sorcerer)
  1044. Subject: CKermit under Unix ...
  1045.  
  1046. We are having problems with ckermit on an Ultrix system (approx 4.3BSD).
  1047.  
  1048. We have kermit installed setuid and setgid to uucp to allow access to the UUCP
  1049. spool directory (to write the lock files). However, whenever kermit tries to
  1050. write files in the user's directories (perhaps because the user is running
  1051. kermit on the VAX in server mode and doing a send from a pc--mskermit), it
  1052. fails saying that it cannot open the file. If the user sets their directory to
  1053. world write, then ckermit onm the VAX is happy.
  1054.  
  1055. Now, this seems to be an interaction between the way we have kermit installed
  1056. and what it is trying to do, but I cannot see any other way to set up kermit
  1057. so that it can reliably access the UUCP spool directory.
  1058.  
  1059. So, I checked out the code, and found that zopeno in ckufio.c just does an
  1060. open of the file that it is opening for output and then does a chown to the
  1061. real user and real group. I added the following code, and all seems to work:
  1062.  
  1063.    1. First pick up the real and effective UIDs.
  1064.  
  1065.    2. Then, just before the file open, set effective UID to back to our real
  1066.       UID. 
  1067.  
  1068.    3. Then, just after the file open, set our effective UID back to what it
  1069.       was just before we changed it.
  1070.  
  1071.    Here is the code fragment that does it (lines with a * in col 1 are mine):
  1072.  
  1073.    zopeno(n,name) int n; char *name; {
  1074. *      int uid, euid;
  1075.        debug(F111," zopeno",name,n);
  1076.        if (chkfn(n) != 0) return(0);
  1077.        if ((n == ZCTERM) || (n == ZSTDIO)) {  /* Terminal or standard output */
  1078.        fp[ZOFILE] = stdout;
  1079.        debug(F101," fp[]=stdout", "", (int) fp[n]);
  1080.        return(1);
  1081.        }
  1082. *      uid = getuid(); euid = geteuid();
  1083. *      seteuid(uid);        /* Set us back to who is running kermit */
  1084.        fp[n] = fopen(name,"w");        /* A real file, try to open */
  1085. *      seteuid(euid);       /* And set things back to our SUID value */
  1086.        if (fp[n] == NULL) {
  1087.        perror("zopeno can't open");
  1088.        } else {
  1089.        chown(name, getuid(), getgid());     /* In case set[gu]id */
  1090.        if (n == ZDFILE) setbuf(fp[n],NULL); /* Debugging file unbuffered */
  1091.        }
  1092.        debug(F101, " fp[n]", "", (int) fp[n]);
  1093.        return((fp[n] != NULL) ? 1 : 0);
  1094.    }
  1095.  
  1096.   Now, as I say, this works, but I wonder if there is not a simpler way to get
  1097. this done, like only have kermit setgid to uucp. Would that be sufficient?
  1098.  
  1099.   BTW, this fragment came from version 4c(029) of ckufio.c. I also have
  1100. another version (ckcmai 4d(061) 8-Sep-86 and ckufio 4c(033) 8-Sep-86) but
  1101. there seems to be no changes in routine zopeno.
  1102.  
  1103.   Hope you can help me here.
  1104.  
  1105. Regards
  1106. Richard Sharpe
  1107. rsharpe%adl.austek.oz@uunet.uu.net
  1108.  
  1109. ------------------------------
  1110.  
  1111. Date: Wed, 4 Nov 87 09:54:09 CST
  1112. From: munnari!adl.austek.oz.au!rsharpe@uunet.UU.NET
  1113.  (Richard Sharpe--Apprentice Sorcerer)
  1114. Subject: CKermit under Unix ...
  1115.  
  1116. I have found problems with my solution that are to do with the differences
  1117. between sysV and 4.2 (I read about this setuid stuff in Bach's book), so I am
  1118. going to fix it up properly for SysV and 4.2/Ultrix. I also have access to a
  1119. MicroPort 2.2 system, so I will try to get it working on that system as well.
  1120. Finally, across the road is an NCR Tower, so I will try to get it running on
  1121. that. 
  1122.  
  1123. When I do, I will ship you a copy of the changes. I may also try to fix the
  1124. problem where you wipe out the existing file if a send is aborted. However,
  1125. let me know if someone has already fixed this.
  1126.  
  1127. Regards
  1128. Richard
  1129.  
  1130. ------------------------------
  1131.  
  1132. Date: 27 Jan 88 10:59 EST
  1133. From: junod@dtrc.ARPA (John Junod)
  1134. Subject: C-Kermit Timeout Problem Fix
  1135. Keywords: C-Kermit 4E(068)
  1136.  
  1137. The following code was developed about a year and a half ago by Mark A.
  1138. Thomas here at David Taylor Research Center to solve the time-out problem as
  1139. mentioned in the Info-Kermit Digest, V7 #3.
  1140.  
  1141. Hope this helps....
  1142.  
  1143.            L. John Junod
  1144.            junod@dtrc
  1145.  
  1146. /* The following fix was made in kermit to prevent the local machine from
  1147. timing out the terminal line.  The local machine uses the last access time
  1148. of /dev/ttyXX to check for an inactive terminal. Fancy kermit i/o doesn't
  1149. update /dev/ttyXX while packets are sent/received. Since a packet doesn't
  1150. update the access time of the tty line, The local machine thinks the line is 
  1151. inactive and times it out after 5-10 minutes.  A call to the routine  
  1152. check_time() is made in spack() and rpack(), and after 50 packets the tty 
  1153. time is updated.  60 packets at 300 baud take about 5 minutes to send, so 50
  1154. packets is safe. */
  1155.  
  1156. /* included to fix local timeout problem */
  1157.  
  1158. #include "signal.h"
  1159. #include "sys/types.h"
  1160. #include "sys/timeb.h"
  1161. #define  NULL           0x0
  1162.  
  1163. /*  C H E C K _ T I M E  --  Fix timeout during packet sending and
  1164.                  receiving.  Since packets don't update the
  1165.                  tty access and modify times, we do it.      */
  1166.  
  1167. check_time()
  1168.    {
  1169.    static char *tty_name = (char *) NULL; 
  1170.    static int i = 0;
  1171.    char *ttyname(),*calloc();
  1172.    struct timeb tbp;
  1173.    time_t t[2];
  1174.    if (tty_name == NULL)
  1175.       {
  1176.       tty_name = calloc(32,sizeof(char));
  1177.       strcpy(tty_name,ttyname(0));    /* allocate and get tty name of stdin */
  1178.       }
  1179.    i++;
  1180.    if (i > 50)
  1181.       {
  1182.       i = 0;
  1183.       ftime(&tbp);           /* get system time */
  1184.       t[0] = tbp.time;
  1185.       t[1] = tbp.time;
  1186.       utime(tty_name,t);     /* update tty time */
  1187.       }
  1188.    }
  1189.  
  1190. [Ed. - This would probably do the trick for BSD, but all the time stuff is
  1191. system dependent.  BSD, Sys V, Xenix, Venix, V7, etc, have different ways of
  1192. getting the time.  Meanwhile, this message has been added to the C-Kermit
  1193. "beware file".]
  1194.  
  1195. ------------------------------
  1196.  
  1197. Date: Wed, 10 Feb 88 22:29:13 EST
  1198. From: rochester!ames!ucbcad!ucbvax.Berkeley.EDU!-
  1199.   ucbcad!ames.uux!pur-ee!iuvax!bsu-cs!dhesi@columbia.edu (Rahul Dhesi)
  1200. Subject: Re: Unix Kermit Idle Line Problem
  1201.  
  1202. This is an answer to a query from nerd@percival.UUCP (Michael Galassi)
  1203. dated 28 Dec 87 00:42:59 GMT, in which he said that users using 
  1204. "C-Kermit, 4C(057) 31 Jul 85, 4.2 BSD" are timed out for being idle
  1205. even though they are doing Kermit file transfers.  Here is my
  1206. work-around as it was posted in a local newsgroup.
  1207.  
  1208. "By popular demand, here again is the technique for avoiding inactivity
  1209. timeouts when doing a long file transfer via Kermit.
  1210.  
  1211. Step 1.   At the system prompt, give the command "tty".  This command
  1212. will print your terminal name.  It will be of the form /dev/tty15
  1213. where instead of 15 you will see the number of your terminal.
  1214. Remember it.
  1215.  
  1216. Step 2.  Invoke Kermit interactively with the command "kermit" given
  1217. without parameters.  (Actually you can give parameters too, so long
  1218. as they don't cause Kermit to begin data transfer immediately.)
  1219. When Kermit starts up and prints the prompt "C-Kermit", you go to:
  1220.  
  1221. Step 3.   To Kermit, give the command "set line /dev/tty15".  In place
  1222. of the 15, use whatever terminal number you obtained in Step 1.
  1223.  
  1224. Step 4.  Now give Kermit the commands necessary to begin your file
  1225. transfer.   You will not get an inactivity timeout.
  1226.  
  1227. Users who want to win fame on this system and the gratitude of others
  1228. can change Kermit so that the above sequence will not be necessary.
  1229. Currently Kermit uses the standard device /dev/tty which is synonymous
  1230. with your actual terminal.  However, the operating system treats it
  1231. like a distinct device from your actual terminal.  So, even though a
  1232. file transfer is going on using /dev/tty, the actual terminal, say
  1233. /dev/tty15, seems to be idle to the system, so you can get logged out.
  1234. This can be fixed by (a) finding the place where Kermit opens /dev/tty
  1235. and (b) replacing that with an open of the actual terminal name, which
  1236. can be obtained from the system call ttyname()."
  1237.  
  1238. Rahul Dhesi         UUCP:  {ihnp4,seismo}!{iuvax,pur-ee}!bsu-cs!dhesi
  1239.  
  1240. [Ed. - We'll consider this for the next release.  Meanwhile, this message
  1241. has been added to the C-Kermit "beware file", CKUKER.BWR.]
  1242.  
  1243. ------------------------------
  1244.  
  1245. Date: 10 January 1989 1051-PST (Tuesday)
  1246. From: stanonik@nprdc.arpa (Ron Stanonik)
  1247. Subject: using /dev/tty
  1248. Keywords:
  1249.  
  1250. We have ckermit 4e(070) on our vax 780 running 4.3bsd.
  1251.  
  1252. We run a daemon on the system that checks for idle terminals and after
  1253. suitable warnings, if still idle, logs them off.
  1254.  
  1255. The problem is that long kermit transfers to the vax look like an idle
  1256. terminal because the kermit server on the vax uses /dev/tty, but the idle
  1257. checker checks the modtime of the specific tty (eg, /dev/ttyh0).
  1258.  
  1259. We modified kermit to find and use the specific tty as the default.  This
  1260. seems to work, but I can't help feeling there must have been some good reason
  1261. for using /dev/tty as the default.  Any clues?  Any problems we might run
  1262. into?
  1263.  
  1264. Thanks,
  1265.  
  1266. Ron Stanonik
  1267. stanonik@nprdc.arpa
  1268.  
  1269. Here are our diffs:
  1270.  
  1271. RCS file: RCS/ckcdeb.h,v
  1272. retrieving revision 1.1
  1273. retrieving revision 1.2
  1274. diff  -r1.1 -r1.2
  1275. 120c120
  1276. < #define CTTNAM "/dev/tty"
  1277. ---
  1278. > #define CTTNAM "/dev/ttyXX"
  1279. ===================================================================
  1280. RCS file: RCS/ckcmai.c,v
  1281. retrieving revision 1.1
  1282. retrieving revision 1.2
  1283. diff  -r1.1 -r1.2
  1284. 263a264
  1285. > extern char *ttyname();
  1286. 283a285
  1287. >     strncpy(dftty, isatty(0)?ttyname(0):"/dev/tty", strlen(dftty));
  1288. ===================================================================
  1289. RCS file: RCS/ckuusr.c,v
  1290. retrieving revision 1.1
  1291. retrieving revision 1.2
  1292. diff  -r1.1 -r1.2
  1293. 302c302
  1294. <     local = (strcmp(ttname,CTTNAM) != 0); /* (better than old way) */
  1295. ---
  1296. >     local = (strcmp(ttname,dftty) != 0); /* (better than old way) */
  1297. ===================================================================
  1298. RCS file: RCS/ckutio.c,v
  1299. retrieving revision 1.2
  1300. retrieving revision 1.3
  1301. diff  -r1.2 -r1.3
  1302. 542,543c542,543
  1303. <     if (strcmp(ttname,CTTNAM) == 0) {   /* "/dev/tty" always remote */
  1304. <         debug(F110," Same as CTTNAM",ttname,0);
  1305. ---
  1306. >     if (strcmp(ttname,dftty) == 0) {   /* "/dev/tty" always remote */
  1307. >         debug(F110," Same as dftty",ttname,0);
  1308.  
  1309. ------------------------------
  1310.  
  1311. Date:     Mon, 1 Feb 88 15:23:59 EST
  1312. From:     Gary P Standorf <standorf@CECOM-2.ARPA>
  1313. Subject:  #ifdef problem with ckuus3.c
  1314.  
  1315. When I tried compiling C-Kermit 4E(070) on an Intel-310 running
  1316. SCO Xenix 3.4 it blew up in the ckuus3.c module.  It doesn't like the
  1317. #include <termio.h> line which follows the #ifdef UXIII in ckuus3.c.
  1318. I added an #ifndef XENIX before the include for termio.h and then it
  1319. compiled ok.
  1320.  
  1321. PS.  I hope that doing an #ifndef was the proper thing to do, since I'm not
  1322. sure what other versions of XENIX need.
  1323.  
  1324. Thanks,
  1325.  
  1326. Gary Standorf
  1327. <standorf@cecom-2.arpa>
  1328.  
  1329. -------
  1330.  
  1331. Date: 10 Feb 88 23:09:57 EST (Wed)
  1332. From: ames!netsys!len@ll-xn.ARPA (Len Rose)
  1333. Subject: C-Kermit 4E(070) Sys V R3 vs ATT 3Bx
  1334.  
  1335. One little note to people setting up this on an ATT 3B2 running under
  1336. SYSVR3...  They have two options in the makefile that sort of clash when you
  1337. are bringing up this software.. You either have to choose:
  1338.  
  1339. make att3bx or make sys5r3
  1340.  
  1341. If you don't choose att3bx,the code does not look for the LCK..ttyxx in
  1342. /usr/spool/locks ... However if you choose att3bx,it does not handle signals
  1343. correctly...  All I did to defeat this was just put a #define in ckutio.c for
  1344. att3bx...
  1345.  
  1346. Just thought I'd pass this on, no big deal with it...
  1347.  
  1348. Len
  1349.  
  1350. ------------------------------
  1351.  
  1352. Date: Wed, 2 Mar 88 17:23:47 EST
  1353. From: elsie!ado@ncifcrf.gov (Arthur David Olson)
  1354. Subject: MORE/bsd 4.3 (10/5/87) kermit does CR strips, not CR-LF->NL maps--w/fix
  1355.  
  1356. (This may be fixed in versions of C-Kermit later than version 4C(057), which
  1357. we're running.)
  1358.  
  1359. Description:
  1360.     The kermit command strips all carriage returns, rather than
  1361.     mapping CR-LF sequences to NL.  This causes problems when transferring
  1362.     (to the VAX) the output of programs that do underlining by outputing
  1363.     a line of characters, doing a return, then outputing underlines in
  1364.     the desired places.
  1365.  
  1366. Fix:
  1367.     Note that even with this fix in place, if a file has a CR as its very
  1368.     last character the CR will be (inappropriately) stripped.  Then again,
  1369.     we're not kermit gurus around here.
  1370.  
  1371. *** 1.1/ckcfns.c    Wed Mar  2 17:17:32 1988
  1372. --- 1.3/ckcfns.c    Wed Mar  2 17:17:43 1988
  1373. ***************
  1374. *** 131,136 ****
  1375. --- 131,140 ----
  1376.   /* Call with string to be decoded and an output function. */
  1377.   /* Returns 0 on success, -1 on failure (e.g. disk full).  */
  1378.   
  1379. + #ifdef NLCHAR
  1380. + static int    sawcr;
  1381. + #endif /* defined NLCHAR */
  1382.   decode(buf,fn) char *buf; int (*fn)(); {
  1383.       unsigned int a, a7, b8;        /* Low order 7 bits, and the 8th bit */
  1384.   
  1385. ***************
  1386. *** 158,172 ****
  1387.       }
  1388.       a |= b8;            /* OR in the 8th bit */
  1389.       if (rpt == 0) rpt = 1;        /* If no repeats, then one */
  1390. - #ifdef NLCHAR
  1391. -     if (!binary) {            /* If in text mode, */
  1392. -         if (a == CR) continue;    /* discard carriage returns, */
  1393. -             if (a == LF) a = NLCHAR;     /* convert LF to system's newline. */
  1394. -         }
  1395. - #endif
  1396.       for (; rpt > 0; rpt--) {    /* Output the char RPT times */
  1397. !         ffc++, tfc++;        /* Count the character */
  1398.           if ((*fn)(a) < 0) return(-1); /* Send it to the output function. */
  1399.       }
  1400.       }
  1401.       return(0);
  1402. --- 162,189 ----
  1403.       }
  1404.       a |= b8;            /* OR in the 8th bit */
  1405.       if (rpt == 0) rpt = 1;        /* If no repeats, then one */
  1406.       for (; rpt > 0; rpt--) {    /* Output the char RPT times */
  1407. !         ffc++;            /* Count the character */
  1408. ! #ifdef NLCHAR
  1409. !         if (!binary) {
  1410. !         if (a == CR) {
  1411. !             if (sawcr == 0) {
  1412. !             sawcr = 1;
  1413. !             continue;
  1414. !             }
  1415. !         } else {
  1416. !                 if (sawcr)
  1417. !             if (a == LF)
  1418. !                 a = NLCHAR;
  1419. !             else if ((*fn)(CR) < 0)
  1420. !                 return -1;
  1421. !             else ++tfc;
  1422. !             sawcr = 0;
  1423. !         }
  1424. !         }
  1425. ! #endif /* defined NLCHAR */
  1426.           if ((*fn)(a) < 0) return(-1); /* Send it to the output function. */
  1427. +         ++tfc;
  1428.       }
  1429.       }
  1430.       return(0);
  1431. ***************
  1432. *** 424,429 ****
  1433. --- 441,449 ----
  1434.   rcvfil() {
  1435.       int x;
  1436.       ffc = flci = flco = 0;        /* Init per-file counters */
  1437. + #ifdef NLCHAR
  1438. +     sawcr = 0;
  1439. + #endif /* defined NLCHAR */
  1440.       srvptr = srvcmd;            /* Decode file name from packet. */
  1441.       decode(data,putsrv);
  1442.       if (*srvcmd == '\0')        /* Watch out for null F packet. */
  1443. -- 
  1444. ado@vax2.nlm.nih.gov        ADO, VAX, and NIH are Ampex and DEC trademarks
  1445.  
  1446. ------------------------------
  1447.  
  1448. Subject: C-Kermit 4E(070) diffs for Apple Mac II's A/UX
  1449. Date: Thu, 07 Apr 88 15:57:22 PST
  1450. From: Marion Hakanson <hakanson@mist.cs.orst.edu>
  1451.  
  1452. Below are the changes necessary to make C-Kermit 4E(070) compile
  1453. and run properly on an Apple Mac II running A/UX (Apple's Unix).
  1454. A/UX is mostly System V, but with BSD compatibility grafted on
  1455. in some rather unique ways.  Here is a short description of the
  1456. changes I made (quite minor, really).
  1457.  
  1458. ckuker.mak:    Add an "aux" target, which is identical to the "sys3"
  1459.         target with an added "-DAUX" flag.  See below.
  1460.  
  1461. ckufio.c:    Near the top, in a #ifdef UXIII/#endif pair, is a
  1462.         #define MAXNAMLEN DIRSIZ.  Apparently A/UX has its own
  1463.         MAXNAMLEN definition, so surrounding the above #define
  1464.         in #ifndef MAXNAMLEN/#endif takes care of that problem
  1465.         in a "portable" manner.
  1466.  
  1467. ckutio.c:    I really wanted to avoid adding an AUX flag, but this
  1468.         is quite unique (i.e. "strange").  A/UX has SIGTSTP,
  1469.         so the job-control code in C-Kermit gets compiled in
  1470.         properly, but C-Kermit expects 4.2bsd signal semantics
  1471.         when this happens.  The easiest workaround seems to be
  1472.         to add to sysinit() a call to A/UX's set42sig() library
  1473.         routine, which enables BSD-style reliable signals, along
  1474.         with the corresponding TTY job control.  In other words,
  1475.         it allows C-Kermit to be suspended with ^Z and restarted
  1476.         with "fg" from the C-shell, instead of being killed when
  1477.         you try to restart it.
  1478.  
  1479. The only other trick I had to discover to use C-Kermit was that you
  1480. may need to "set line /dev/modem" (and not tty0) to use the modem port.
  1481. Note that I'm communicating with a hard-wired port selector, and not
  1482. a "real" modem, but modem control lines are used here (perhaps not
  1483. the correct ones, though).
  1484.  
  1485. Apple seems to distribute A/UX with C-Kermit 4E(066) installed in
  1486. the /usr/bin directory (this was the C-Kermit with the serious long
  1487. packet bug), and sources in /usr/src/kermit.  Other than a similar,
  1488. but less portable than mine, change to ckufio.c, I could detect no
  1489. modifications they made to the distribution 4E(066), which of course
  1490. did NOT do the right thing with ^Z, etc.
  1491.  
  1492. Please let me know if problems occur with these changes, or if other
  1493. modifications are indicated.  We've only had this A/UX system up for
  1494. a couple of days, and Kermit was a necessity for connecting it to
  1495. something other than itself.  Here are the patches:
  1496.  
  1497. =================cut here=================
  1498. *** /usr/src/local/comm/kermit/ckuker.mak    Thu Feb  4 15:37:03 1988
  1499. --- ./ckuker.mak    Thu Apr  7 16:11:37 1988
  1500. ***************
  1501. *** 8,13
  1502.   #
  1503.   # for Amdahl UTS 2.4 on IBM 370 series & compatible mainframes, "make uts24"
  1504.   # for Amdahl UTSV IBM 370 series & compatible mainframes, "make sys3"
  1505.   # for AT&T 3Bx systems, "make att3bx"
  1506.   # for AT&T generic System III/System V, "make sys3" or "make sys3nid"
  1507.   # for ATT System V R3, use "make sys5r3".  This is different from the above.
  1508.  
  1509. --- 8,14 -----
  1510.   #
  1511.   # for Amdahl UTS 2.4 on IBM 370 series & compatible mainframes, "make uts24"
  1512.   # for Amdahl UTSV IBM 370 series & compatible mainframes, "make sys3"
  1513. + # for Apple Mac II running A/UX, "make aux"
  1514.   # for AT&T 3Bx systems, "make att3bx"
  1515.   # for AT&T generic System III/System V, "make sys3" or "make sys3nid"
  1516.   # for ATT System V R3, use "make sys5r3".  This is different from the above.
  1517. ***************
  1518. *** 206,211
  1519.   # Make commands for specific systems:
  1520.   #
  1521.   #
  1522.   #Berkeley Unix 4.1 or 4.2 (and presumably also 4.3), also Ultrix-32 1.x, 2.0
  1523.   bsd:
  1524.       make wermit "CFLAGS= -DBSD4 -DDEBUG -DTLOG"
  1525.  
  1526. --- 207,216 -----
  1527.   # Make commands for specific systems:
  1528.   #
  1529.   #
  1530. + #Apple Mac II running A/UX
  1531. + aux:
  1532. +     make wermit "CFLAGS = -DAUX -DUXIII -DDEBUG -DTLOG -i -O" "LNKFLAGS = -i"
  1533.   #Berkeley Unix 4.1 or 4.2 (and presumably also 4.3), also Ultrix-32 1.x, 2.0
  1534.   bsd:
  1535.       make wermit "CFLAGS= -DBSD4 -DDEBUG -DTLOG"
  1536. *** /usr/src/local/comm/kermit/ckufio.c    Tue Feb  2 23:52:17 1988
  1537. --- ./ckufio.c    Thu Apr  7 16:16:06 1988
  1538. ***************
  1539. *** 190,195
  1540.   
  1541.   #ifdef UXIII
  1542.   #include <fcntl.h>
  1543.   #define MAXNAMLEN DIRSIZ
  1544.   #endif
  1545.   
  1546.  
  1547. --- 190,196 -----
  1548.   
  1549.   #ifdef UXIII
  1550.   #include <fcntl.h>
  1551. + #ifndef MAXNAMLEN
  1552.   #define MAXNAMLEN DIRSIZ
  1553.   #endif
  1554.   #endif
  1555. ***************
  1556. *** 191,196
  1557.   #ifdef UXIII
  1558.   #include <fcntl.h>
  1559.   #define MAXNAMLEN DIRSIZ
  1560.   #endif
  1561.   
  1562.   #ifndef O_RDONLY
  1563.  
  1564. --- 192,198 -----
  1565.   #include <fcntl.h>
  1566.   #ifndef MAXNAMLEN
  1567.   #define MAXNAMLEN DIRSIZ
  1568. + #endif
  1569.   #endif
  1570.   
  1571.   #ifndef O_RDONLY
  1572. *** /usr/src/local/comm/kermit/ckutio.c    Wed Feb  3 16:43:07 1988
  1573. --- ./ckutio.c    Thu Apr  7 16:22:11 1988
  1574. ***************
  1575. *** 466,471
  1576.   
  1577.   sysinit() {
  1578.   
  1579.   /* for now, nothing... */
  1580.       return(0);
  1581.   }
  1582.  
  1583. --- 466,474 -----
  1584.   
  1585.   sysinit() {
  1586.   
  1587. + #ifdef AUX
  1588. +     set42sig();    /* Don't ask! (hakanson@cs.orst.edu) */
  1589. + #endif /* aux */
  1590.   /* for now, nothing... */
  1591.       return(0);
  1592.   }
  1593. =================cut here=================
  1594.  
  1595. -- 
  1596. Marion Hakanson         Domain: hakanson@cs.orst.edu
  1597.                         CSNET : hakanson%cs.orst.edu@relay.cs.net
  1598.                         UUCP  : {hp-pcd,tektronix}!orstcs!hakanson
  1599.  
  1600. ------------------------------
  1601.  
  1602. Path: lamont!dalesys
  1603. From: dalesys%lamont.Columbia.edu@lamont (dale chayes)
  1604. Newsgroups: comp.protocols.kermit,comp.sys.masscomp
  1605. Subject: Masscomp C-kermit
  1606. Keywords: masscomp rtu 4.0b
  1607. Date: 15 Apr 88 13:59:27 GMT
  1608. Organization: Lamont-Doherty Geological Observatory N.Y.
  1609.  
  1610. I have butchered the recent release of C-Kermit to accomodate the notion
  1611. of "dir.h" in the beta version of Masscomp's RTU (RTU-4.0.b1) operating system.
  1612. (For RTU-3.1, "make rtu" with the distributed sources works fine.)
  1613.  
  1614. I did it in a rather crude way. It would be more appropriate to make a new
  1615. entry in the makefile "rtu4" and use ifdefs, but that's not how it 
  1616. happened.... (at least I put in some comments (:-))
  1617.  
  1618. Specificly, 
  1619. 1) In "ckutio.c" I commented out the include line:
  1620.     #include <sys/dir.h>
  1621.    because it is not used to if UXIII is defined.
  1622.  
  1623. 2) In "ckufio.c" I changed the following lines to conform with Masscomp's
  1624.    new notion of how "dir.h" should be:
  1625.  
  1626.  
  1627. #include <ufs/dir.h>            /* for rtu 4.0 dnc14april88 */ 
  1628. #define MAXNAMLEN UFS_DIRSIZ        /* for rtu4.0 14april88 dnc */
  1629.  struct ufs_direct dir_entry;            /*rtu4.0 add ufs_ 14apr88 dnc */
  1630.  struct ufs_direct *dirbuf = &dir_entry;    /*rtu4.0 add ufs_ 14apr88 dnc */
  1631.  
  1632. With these changes, "make rtu" appears to produce a working version of
  1633. C-kermit 04D(061) under RTU-4.0.b1.
  1634.  
  1635. I did not get this done in time to make the new MUS library tape, but I will
  1636. take it to the meeting with me, and make copies as time and resources allow. 
  1637.  
  1638. Disclaimers:
  1639. 1) I don't have a clue why Masscomp has changed dir.h. Maybe I can
  1640.    find out at the Users Society meeting next week...(Maybe I don't 
  1641.    want to know.)
  1642.  
  1643. 2) I haven't enough time to test all of the possible permutations that
  1644.    kermit can be used in, but I will be glad to entertain comments and 
  1645.    fix them as time and skill allows. (Please send e-mail, or post to 
  1646.    comp.sys.masscomp as I don't read comp.protocols.kermit regularly.)
  1647.  
  1648. Dale Chayes Lamont-Doherty Geological Observatory of Columbia University
  1649. usmail: Route 9W, Palisades, N.Y.  10964
  1650. voice:    (914) 359-2900 extension 434    fax: (914) 359-6817
  1651. usnet:    ...philabs!lamont!dale
  1652.  
  1653. ------------------------------
  1654.  
  1655. From: ray@j.cc.purdue.edu (Ray Moody)
  1656. To: info-kermit@cu20b.columbia.edu
  1657. Subject: Two more Kermit bugs
  1658. Date: Thu, 19 May 88 23:21:29 -0500
  1659.  
  1660.     1) Kermit sometimes forgets to send an error packet when required.  It
  1661.        prints the error message on the screen instead.  This is very
  1662.        confusing to the local kermit that wants an error packet.
  1663.  
  1664.        The first patch at the end of this message fixes this bug.  The patch
  1665.        needs to be applied to ckcfns.c
  1666.  
  1667.     2) Kermit sometimes forgets to print error messages.  This is very
  1668.        confusing to users.  This can occur when the "remote <whatever>"
  1669.        commands are used, and when file-display is off.
  1670.        
  1671.        The second patch at the end of this message fixes this bug.  The patch
  1672.        needs to be applied to ckuus3.c
  1673.  
  1674.                                 Ray
  1675. *****
  1676. 399c399,402
  1677. <         screen(SCR_EM,0,0l,"Too many files");
  1678. ---
  1679. >         if (server)
  1680. >         errpkt("Too many files");
  1681. >         else
  1682. >         screen(SCR_EM,0,0l,"Too many files");
  1683. *****
  1684. 653c653,654
  1685. <     if (!displa || quiet) return;    /* No update if display flag off */
  1686. ---
  1687. >     if (f != SCR_WM && f != SCR_EM)    /* Always update warning & errors */
  1688. >     if (!displa || quiet) return;    /* No update if display flag off */
  1689. -------
  1690.  
  1691. ------------------------------
  1692.  
  1693. Date: Thu, 25 Aug 88 18:11:52 PDT
  1694. From: vixie@decwrl.dec.com (Paul Vixie)
  1695. Subject: ultrix enhancements for latest version of c-kermit
  1696.  
  1697. *** ckutio.c.orig    Tue Jun 28 22:31:57 1988
  1698. --- ckutio.c    Wed Jun 29 00:34:42 1988
  1699. ***************
  1700. *** 513,518
  1701.       /* if modem connection, don't wait for carrier */
  1702.       ttyfd = open(ttname,O_RDWR | (modem ? O_NDELAY : 0) );
  1703.   #else
  1704.       ttyfd = open(ttname,2);        /* Try to open for read/write */
  1705.   #endif /* uxiii */
  1706.   
  1707.  
  1708. --- 513,521 -----
  1709.       /* if modem connection, don't wait for carrier */
  1710.       ttyfd = open(ttname,O_RDWR | (modem ? O_NDELAY : 0) );
  1711.   #else
  1712. + #ifdef ultrix
  1713. +     ttyfd = open(ttname, O_RDWR|O_NDELAY);
  1714. + #else
  1715.       ttyfd = open(ttname,2);        /* Try to open for read/write */
  1716.   #endif /* ultrix */
  1717.   #endif /* uxiii */
  1718. ***************
  1719. *** 514,519
  1720.       ttyfd = open(ttname,O_RDWR | (modem ? O_NDELAY : 0) );
  1721.   #else
  1722.       ttyfd = open(ttname,2);        /* Try to open for read/write */
  1723.   #endif /* uxiii */
  1724.   
  1725.       if (ttyfd < 0) {            /* If couldn't open, fail. */
  1726.  
  1727. --- 517,523 -----
  1728.       ttyfd = open(ttname, O_RDWR|O_NDELAY);
  1729.   #else
  1730.       ttyfd = open(ttname,2);        /* Try to open for read/write */
  1731. + #endif /* ultrix */
  1732.   #endif /* uxiii */
  1733.   
  1734.       if (ttyfd < 0) {            /* If couldn't open, fail. */
  1735. ***************
  1736. *** 605,610
  1737.   #endif /* tiocexcl */
  1738.   #endif /* xenix */
  1739.   
  1740.   /* Get tty device settings */
  1741.   
  1742.   #ifndef UXIII
  1743.  
  1744. --- 609,632 -----
  1745.   #endif /* tiocexcl */
  1746.   #endif /* xenix */
  1747.   
  1748. + #ifdef ultrix
  1749. +     {
  1750. +     int temp = 0;
  1751. +     if (ioctl(ttyfd, TIOCSINUSE, NULL) < 0) {
  1752. +         fprintf(stderr, "Can't set in-use flag on modem.\n");
  1753. +         perror("TIOCSINUSE");
  1754. +     }
  1755. +     if (modem) {
  1756. +         ioctl(ttyfd, TIOCMODEM, &temp);
  1757. +     } else {
  1758. +         ioctl(ttyfd, TIOCNMODEM, &temp);
  1759. +     }
  1760. +     ioctl(ttyfd, TIOCHPCL, 0);
  1761. +     }
  1762. + #endif /* ultrix */
  1763.   /* Get tty device settings */
  1764.   
  1765.   #ifndef UXIII
  1766. ***************
  1767. *** 648,653
  1768.   
  1769.   ttclos() {
  1770.       if (ttyfd < 0) return(0);        /* Wasn't open. */
  1771.       if (xlocal) {
  1772.       if (tthang())            /* Hang up phone line */
  1773.           fprintf(stderr,"Warning, problem hanging up the phone\n");
  1774.  
  1775. --- 670,678 -----
  1776.   
  1777.   ttclos() {
  1778.       if (ttyfd < 0) return(0);        /* Wasn't open. */
  1779. + #ifdef ultrix
  1780. +     ioctl(ttyfd, TIOCNCAR, NULL);
  1781. + #endif
  1782.       if (xlocal) {
  1783.   /* ultrix doesn't need tthang() because of TIOCHPCL */
  1784.   #ifndef ultrix
  1785. ***************
  1786. *** 649,654
  1787.   ttclos() {
  1788.       if (ttyfd < 0) return(0);        /* Wasn't open. */
  1789.       if (xlocal) {
  1790.       if (tthang())            /* Hang up phone line */
  1791.           fprintf(stderr,"Warning, problem hanging up the phone\n");
  1792.           if (ttunlck())            /* Release uucp-style lock */
  1793.  
  1794. --- 674,681 -----
  1795.       ioctl(ttyfd, TIOCNCAR, NULL);
  1796.   #endif
  1797.       if (xlocal) {
  1798. + /* ultrix doesn't need tthang() because of TIOCHPCL */
  1799. + #ifndef ultrix
  1800.       if (tthang())            /* Hang up phone line */
  1801.           fprintf(stderr,"Warning, problem hanging up the phone\n");
  1802.   #endif
  1803. ***************
  1804. *** 651,656
  1805.       if (xlocal) {
  1806.       if (tthang())            /* Hang up phone line */
  1807.           fprintf(stderr,"Warning, problem hanging up the phone\n");
  1808.           if (ttunlck())            /* Release uucp-style lock */
  1809.           fprintf(stderr,"Warning, problem releasing lock\n");
  1810.       }
  1811.  
  1812. --- 678,684 -----
  1813.   #ifndef ultrix
  1814.       if (tthang())            /* Hang up phone line */
  1815.           fprintf(stderr,"Warning, problem hanging up the phone\n");
  1816. + #endif
  1817.           if (ttunlck())            /* Release uucp-style lock */
  1818.           fprintf(stderr,"Warning, problem releasing lock\n");
  1819.       }
  1820.  
  1821. ------------------------------
  1822.  
  1823. Date: Fri, 27 Jan 89 11:52:25 EET DST
  1824. From: Markku Toijala <mto@kolvi.hut.fi>
  1825. Subject: Unix Kermit 4E(072) local mode
  1826.  
  1827. I tested the new version here (uVAX II running BSD 4.3) and found
  1828. a "feature" in local mode:
  1829.  
  1830. If you exit to command level with <esc>C and then give hangup command
  1831. all works fine.  You can issue another connect with no additional
  1832. command (a nice feature compared to 4E(070), thanks).
  1833.  
  1834. However, if you issue a hangup with <esc>H while connected, the line is
  1835. closed OK, BUT the lock for that line is left alone.  So with next
  1836. attempt to connect you get the "line occupied, use rm..." message.
  1837.  
  1838. Markku
  1839.  
  1840. Markku Toijala                         !   UUCP:     kolvi!mto
  1841. Helsinki University of Technology      !   Internet: mto@kolvi.hut.FI
  1842. Otakaari 5 A                           !   EARN:     MTO@FINHUTEE.BITNET
  1843. SF-02150 Espoo,  Finland               !   tel:      +358 0 4512467
  1844.  
  1845. ------------------------------
  1846.  
  1847. 28-Feb-89 17:22:31-GMT,4098;000000000011
  1848. Received: from cunixc.cc.columbia.edu by watsun.cc.columbia.edu (4.0/SMI-4.0)
  1849.     id AA09120; Tue, 28 Feb 89 12:22:29 EST
  1850. Received: from hera.cs.ucla.edu ([10.2.0.1]) by cunixc.cc.columbia.edu (5.54/5.10) id AA18940; Tue, 28 Feb 89 12:20:45 EST
  1851. Return-Path: <ucla-an!mlw>
  1852. Received: from EE.UCLA.EDU by hera.cs.ucla.edu (Sendmail 5.59/2.15)
  1853.     id AA14987; Tue, 28 Feb 89 09:21:24 PST
  1854. Received: by ee.UCLA.EDU (5.52/5.14)
  1855.     id AA06277; Tue, 28 Feb 89 09:20:43 PST
  1856. Received: by ucla-an.ANES (5.51/5.17)
  1857.     id AA28849; Tue, 28 Feb 89 09:21:03 PST
  1858. Date: Tue, 28 Feb 89 09:21:03 PST
  1859. From: ucla-an!mlw (Michael Williams)
  1860. Message-Id: <8902281721.AA28849@ucla-an.ANES>
  1861. To: @cs.ucla.edu:sy.fdc@cu20b.columbia.edu
  1862. Subject: UNIX Kermit Dialer mods
  1863.  
  1864.  
  1865. Frank,
  1866.  
  1867. I've made two minor mods to the dialing module (ckudia.c) of C-Kermit,
  1868. 4D(060) 18 Apr 86, 4.2 BSD running on a 4.3 system.  Principally, these
  1869. mods were made to allow HAYES MODEMS, both 1200 & 2400, to work as in/out
  1870. UUCP lines/devices as well as for users wanting to dial out using KERMIT.
  1871. The changes are:
  1872.  
  1873. 1.  To the 'wakeup prompt' for the Hayes modems.  The existing code assumes
  1874. result codes either verbose (English) or numeric are returned.  This is 
  1875. fine for the 1200 baud modems, but our 2400 Hayes are set for NO results.
  1876. To make it work I've changed the prompt to 'AT&F&D3' which sets the modem
  1877. to factory default mode (English result codes) and to reset to 'saved'
  1878. configuration on DTR transition, which the BSD code does.  BTW the 1200
  1879. Hayes indicates 'ERROR' with this wakeup prompt, but that has not caused us
  1880. any problems thus far, as the subsequent dial sequence clears the error
  1881. condition.
  1882.  
  1883. 2.  To the per/modem connect code for the hayes/usrobotics.  This code makes
  1884. no provision for line-speed changes when a local 2400 modem dialing out must
  1885. match a remote answering 1200 baud modem other than manually changing the
  1886. line-speed.  I don't know whether this is by design or just that nobody
  1887. uses 2400 Hayes.  Our problem is that we have naive users running scripts
  1888. which invoke kermit, and they get confused when they get the 'connected'
  1889. message followed by garbage.  This mod checks for the "CONNECT 1200" message,
  1890. conditions the line-speed accordingly, and announces the change to the
  1891. user.  If it's more in keeping with the KERMIT philosophy, this could easily
  1892. be changed to announce that the remote modem is 1200 baud, and give a hint
  1893. to change the line speed (i.e. set speed).
  1894.  
  1895. Anyway I've included the changes (11 lines) and please note these are only
  1896. for the HAYES modems and BSD4 machines.  If you cannot use these changes but
  1897. know of others who might, go ahead and give them out.
  1898.  
  1899. Thanx - Mike
  1900. ============================cut here======================================
  1901.  
  1902. *** ckudia.c.org    Tue Jan 24 11:32:49 1989
  1903. --- ckudia.c    Tue Jan 31 11:30:17 1989
  1904. ***************
  1905. *** 282,288 ****
  1906.       35,            /* dial_time */
  1907.       ",",        /* pause_chars */
  1908.       2,            /* pause_time */
  1909. !     "AT\r",        /* wake_str */
  1910.       0,            /* wake_rate */
  1911.       "",            /* wake_prompt */
  1912.       "",            /* dmode_str */
  1913. --- 282,288 ----
  1914.       35,            /* dial_time */
  1915.       ",",        /* pause_chars */
  1916.       2,            /* pause_time */
  1917. !     "AT&F&D3\r",    /* wake_str */
  1918.       0,            /* wake_rate */
  1919.       "",            /* wake_prompt */
  1920.       "",            /* dmode_str */
  1921. ***************
  1922. *** 786,791 ****
  1923. --- 786,801 ----
  1924.               break;
  1925.             case n_HAYES:
  1926.             case n_USROBOT:
  1927. +             if (didWeGet(lbuf,"CONNECT 1200"))  {
  1928. +             if ( ttpkt(1200,DIALING) < 0 )  {
  1929. +                 printf("Sorry, Can't reset line speed to 1200\r\n");
  1930. +                 } else  {
  1931. +             speed = 1200;
  1932. +             status = CONNECTED;
  1933. +                 if ( !quiet )
  1934. +                 printf("Speed reset to 1200!\07\r\n");
  1935. +             }
  1936. +             }
  1937.               if (didWeGet(lbuf,"CONNECT")) status = CONNECTED;
  1938.               if (didWeGet(lbuf,"NO CARRIER")) status = FAILED;
  1939.               break;
  1940. ==============================done cutting==============================
  1941.  
  1942. Mike Williams            ARPA: ucla-an!mlw@ee.UCLA.EDU
  1943. Dept. of Anesthesiology        UUCP: decvax!hermix!ucla-an!mlw 
  1944. School of Medicine, UCLA          {ucla-se,sdcrdcf,cepu}!ucla-an!mlw
  1945. Los Angeles, CA 90024        BELL: (213) 825-7073
  1946.  
  1947.  
  1948. **********************
  1949.  
  1950. From: jw@pan.uu.ch (Jamie Watson)
  1951. Date: Wed, 29 May 91 12:16:17 MET
  1952. To: fdc@watsun.cc.columbia.edu
  1953. Subject: Re: C-Kermit 4E(072) changes for IBM RS/6000
  1954.  
  1955. > If you can send a message containing context diffs, that would be useful 
  1956. > those who order C-Kermit, hoping to run it on the RS/6000, before 5A is
  1957. > for formally released.  Thanks!
  1958.  
  1959. The following are the changes I made to Kermit version 4E(072), for the
  1960. IBM RS/6000 running AIX 3.1, patch level 3003.  These changes assume the
  1961. use of the 'posix' serial line discipline, which is the default, and that
  1962. the program will be compiled with 'cc', not with 'xlc' or 'bsdcc'.  The
  1963. RS/6000 specific changes are bracketed by "#ifdef _IBMR2", which is a
  1964. symbol defined by the preprocessor phase of the RS/6000 C compiler.  The
  1965. command "make sys3nid" will compile everything appropriately.
  1966.  
  1967. In addition to the changes which are acutally "required" to get kermit
  1968. working on the RS/6000, I made one "convenience" change.  The serial port
  1969. can be selected on the command line with the "-l xxx" option; but if there
  1970. is a modem present, the modem type must be defined before kermit attempts
  1971. to open the serial line, in order to get it to use the O_NDELAY flag.  I
  1972. added a command line option of "-m xxx" to define the modem.  Thus, kermit
  1973. can be called with "kermit -m hayes -l /dev/tty12 -b 9600".
  1974.  
  1975. Also included with these diffs are two small changes necessary for the RT/PC
  1976. running AIX 2.2.1.  These changes are bracketed by "#ifdef aiws", which is
  1977. defined by that C compiler.
  1978.  
  1979. Modifications to ckutio.c:
  1980.  
  1981.     - Add a banner identifying the version for RS/6000 (and RT/PC AIX).
  1982.  
  1983.     - Do not attempt to use exclusive access mode (TIOCEXCL) on the
  1984.       RS/6000, even though the symbol is defined.  The ioctl always
  1985.       fails - I suppose this must be a bug in AIX 3.1/3003.
  1986.  
  1987.     - Setting 0 baud fails on the 64-port serial adapter (even though
  1988.       it works on the native serial ports and the 8-port adapter).  It
  1989.       not only doesn't hang up the modem, the ioctl returns -1, which
  1990.       causes kermit to complain about not being able to hang up the
  1991.       modem, and to refuse to dial (or to do much else of value).  There
  1992.       are two ioctl calls (TIOCMBIC and TIOCMBIS) specifically meant for
  1993.       manipulating serial line hardware signals, and a group of defines
  1994.       for the various lines (TIOCM_*).  So the call to set baud 0 has
  1995.       been replaced by calls to specifically drop, pause, and raise DTR.
  1996.       This works perfectly with the various modems we have, but I suppose
  1997.       for completeness it might be worthwhile to drop some of the other
  1998.       lines at the same time (RTS/CTS or such?), in case there were some
  1999.       really cranky modems or weird cables out there.
  2000.  
  2001.     - IBM has yet another different combination of directory and file
  2002.       names for lock files used by uucp/cu.  Sigh.
  2003.  
  2004.     - Alarm and signal trap setting were being lost whenever ttoc() was
  2005.       called.  This was a pretty serious problem, and was not unique to
  2006.       the RS/6000.  The symptom of this was that when dialing, if the
  2007.       modem did not return one of the expected strings, the dial command
  2008.       would never return - i.e. it did not time out after however many
  2009.       seconds claimed.  I simply saved the current settings of alarm()
  2010.       and signal() on entry to the routine, and restore them on exit.
  2011.  
  2012.     - The RS/6000 has the select() system call, and it can be used to
  2013.       give sub-second delays.  So I added the code to use it for msleep().
  2014.       Note that the RT/PC also has select, but its resolution is still
  2015.       only 1 second, so there it can not be used in this case.
  2016.  
  2017. *** old/ckutio.c    Wed May 29 11:41:42 1991
  2018. --- kermit/ckutio.c    Wed May 29 10:34:52 1991
  2019. ***************
  2020. *** 151,157 ****
  2021. --- 151,165 ----
  2022.   /* Changes by Joe R. Doupnik, jrd@usu.Bitnet, Utah State Univ */
  2023.   char *ckxsys = " AT&T 7300/Unix PC System III/System V\n";
  2024.   #else
  2025. + #ifdef aiws
  2026. + char *ckxsys = " IBM RT/PC AIX 2";
  2027. + #else
  2028. + #ifdef _IBMR2
  2029. + char *ckxsys = " IBM RS/6000 AIX 3";
  2030. + #else
  2031.   char *ckxsys = " AT&T System III/System V";
  2032. + #endif /* IBM RS/6000 */
  2033. + #endif /* IBM RT/PC */
  2034.   #endif /* att7300 */
  2035.   #endif /* vxve  */
  2036.   #endif /* zilog */
  2037. ***************
  2038. *** 666,676 ****
  2039. --- 674,686 ----
  2040.   /* Request exclusive access on systems that allow it. */
  2041.   
  2042.   #ifndef XENIX
  2043. + #ifndef _IBMR2
  2044.   /* Xenix exclusive access prevents open(close(...)) from working... */
  2045.   #ifdef TIOCEXCL
  2046.           if (ioctl(ttyfd,TIOCEXCL, NULL) < 0)
  2047.               fprintf(stderr,"Warning, problem getting exclusive access\n");
  2048.   #endif /* tiocexcl */
  2049. + #endif /* rs/6000 */
  2050.   #endif /* xenix */
  2051.   
  2052.   #ifdef ultrix
  2053. ***************
  2054. *** 749,754 ****
  2055. --- 759,765 ----
  2056.       ttres();                            /* Reset modes. */
  2057.   /* Relinquish exclusive access if we might have had it... */
  2058.   #ifndef XENIX
  2059. + #ifndef _IBMR2
  2060.   #ifdef TIOCEXCL
  2061.   #ifdef TIOCNXCL
  2062.       if (ioctl(ttyfd, TIOCNXCL, NULL) < 0)
  2063. ***************
  2064. *** 755,760 ****
  2065. --- 766,772 ----
  2066.           fprintf(stderr,"Warning, problem relinquishing exclusive access\n");
  2067.   #endif /* tiocnxcl */
  2068.   #endif /* tiocexcl */
  2069. + #endif /* not rs/6000 */
  2070.   #endif /* not xenix */
  2071.       if (ttyfd > -1) close(ttyfd);       /* Close it if tthang didn't */
  2072.       ttyfd = -1;                         /* Mark it as closed. */
  2073. ***************
  2074. *** 807,812 ****
  2075. --- 819,829 ----
  2076.       modem_rtn = MRTS | MDTR;                        /* bits for RTS & DTR  */
  2077.       if (ioctl(ttyfd,MCSETAF,&modem_rtn) < 0) return(-1);    /*  set lines  */
  2078.   #else
  2079. + #ifdef _IBMR2
  2080. +     if (ioctl(ttyfd,TIOCMBIC,TIOCM_DTR) < 0) return(-1);
  2081. +     msleep(100);
  2082. +     if (ioctl(ttyfd,TIOCMBIS,TIOCM_DTR) < 0) return(-1);
  2083. + #else
  2084.       ttc_save = ttraw.c_cflag;
  2085.       ttraw.c_cflag &= ~CBAUD;            /* swa: set baud rate to 0 to hangup */
  2086.       if (ioctl(ttyfd,TCSETAF,&ttraw) < 0) return(-1); /* do it */
  2087. ***************
  2088. *** 828,833 ****
  2089. --- 845,851 ----
  2090.       if ((ttyfd = open(ttnmsv, ttc_save)) < 0) return(-1);
  2091.   #endif /* not xenix */
  2092.       if (ioctl(ttyfd,TCSETAF,&ttraw) < 0) return(-1); /* un-do it */
  2093. + #endif /* not RS/6000 */
  2094.   #endif /* uxiii */
  2095.   #endif /* hpux  */
  2096.   #endif /* aegis */
  2097. ***************
  2098. *** 895,904 ****
  2099. --- 913,930 ----
  2100.   #ifdef ATT3BX
  2101.       char *lockdir = "/usr/spool/locks";
  2102.   #else
  2103. + #ifdef aiws
  2104. +     char *lockdir = "/etc/locks";
  2105. + #else
  2106. + #ifdef _IBMR2
  2107. +     char *lockdir = "/etc/locks";
  2108. + #else
  2109.   #ifdef LCKDIR
  2110.       char *lockdir = "/usr/spool/uucp/LCK";
  2111.   #else
  2112.       char *lockdir = "/usr/spool/uucp";
  2113. + #endif /* RS/6000 */
  2114. + #endif /* RT/PC */
  2115.   #endif /* newuucp */
  2116.   #endif /* att3bx */
  2117.   #endif /* isiii */
  2118. ***************
  2119. *** 1642,1656 ****
  2120.   
  2121.   ttoc(c) char c; {
  2122.       int x;
  2123.       if (ttyfd < 0) return(-1);          /* Check for not open. */
  2124. !     signal(SIGALRM,timerh);        /* Enable timer interrupt */
  2125. !     alarm(2);                /* for 2 seconds. */
  2126.       x = write(ttyfd,&c,1);        /* Try to write the character. */
  2127.       if (setjmp(sjbuf)) {        /* Timer went off? */
  2128.       x = -1;                /* Yes, set return code for failure */
  2129.       }
  2130. !     alarm(0);                /* Turn off timers, etc. */
  2131. !     signal(SIGALRM,SIG_DFL);
  2132.       return(x);
  2133.   }
  2134.   
  2135. --- 1668,1684 ----
  2136.   
  2137.   ttoc(c) char c; {
  2138.       int x;
  2139. +     void (*osig)();
  2140. +     unsigned oala;
  2141.       if (ttyfd < 0) return(-1);          /* Check for not open. */
  2142. !     osig = signal(SIGALRM,timerh);        /* Enable timer interrupt */
  2143. !     oala = alarm(2);                /* for 2 seconds. */
  2144.       x = write(ttyfd,&c,1);        /* Try to write the character. */
  2145.       if (setjmp(sjbuf)) {        /* Timer went off? */
  2146.       x = -1;                /* Yes, set return code for failure */
  2147.       }
  2148. !     alarm(oala > 0 ? oala : 0);        /* Reset or Turn off timers, etc. */
  2149. !     signal(SIGALRM,osig);
  2150.       return(x);
  2151.   }
  2152.   
  2153. ***************
  2154. *** 1872,1877 ****
  2155. --- 1900,1912 ----
  2156.   /* Maybe just for XENIX. */
  2157.   
  2158.   #ifdef UXIII
  2159. + #ifdef _IBMR2 /* RS/6000 can use select() */
  2160. + #include <sys/time.h>
  2161. +     struct timeval tv;
  2162. +     tv.tv_sec = 0;
  2163. +     tv.tv_usec = m * 1000L;
  2164. +     return(select( 0, (void *)0, (void *)0, (void *)0, &tv) );
  2165. + #else
  2166.   #ifdef XENIX
  2167.   /* Actually, watch out.  It's 50 on the AT, 20 on older PCs... */
  2168.   #define CLOCK_TICK 50                   /* millisecs per clock tick */
  2169. ***************
  2170. *** 1906,1911 ****
  2171. --- 1941,1947 ----
  2172.           t3 = (((ftp.time & 0xff) * 1000) + ftp.millitm) - t1;
  2173.           if (t3 > m) return (t3);
  2174.       }
  2175. + #endif
  2176.   #endif
  2177.   #endif
  2178.   }
  2179.  
  2180.  
  2181. Modifications to ckuusr.c:
  2182.  
  2183.   - Pick up the external definitions of the modem type table, the number
  2184.     of modems known, and the currently defined modem type.
  2185.  
  2186.   - Add a command line option to specify the modem type.
  2187.  
  2188.   - Add the modem type definition to the ttopen() call under "-l xxx", so
  2189.     the ttopen() routine knows if it should use O_NDELAY or not.
  2190.  
  2191. *** ckuusr.c    Wed May 29 11:48:55 1991
  2192. --- kermit/ckuusr.c    Thu May 23 19:40:13 1991
  2193. ***************
  2194. *** 206,211 ****
  2195. --- 206,212 ----
  2196.    
  2197.   doarg(x) char x; {
  2198.       int z; char *xp;
  2199. +     extern struct keytab mdmtab[]; extern int nmdm, mdmtyp;
  2200.    
  2201.       xp = *xargv+1;            /* Pointer for bundled args */
  2202.       while (x) {
  2203. ***************
  2204. *** 293,298 ****
  2205. --- 294,311 ----
  2206.       cmarg2 = *xargv;
  2207.       break;
  2208.    
  2209. + case 'm':
  2210. +     if (*(xp+1)) fatal("invalid argument bundling after -m");
  2211. +     *xargv++, xargc--;
  2212. +     if ((xargc < 1) || (**xargv == '-'))
  2213. +         fatal("modem name missing");
  2214. +     for (z = 0, mdmtyp = 0; z < nmdm && !mdmtyp; z++)
  2215. +     if (strcmp(*xargv,mdmtab[z].kwd) == 0)
  2216. +         mdmtyp = mdmtab[z].val;
  2217. +     if (!mdmtyp)
  2218. +     fatal("Unknown modem-dialer");
  2219. +     break;
  2220.   case 'l':                /* set line */
  2221.       if (*(xp+1)) fatal("invalid argument bundling after -l");
  2222.       *xargv++, xargc--;
  2223. ***************
  2224. *** 302,308 ****
  2225.   /*  if (strcmp(ttname,dftty) == 0) local = dfloc; else local = 1;  */
  2226.       local = (strcmp(ttname,CTTNAM) != 0); /* (better than old way) */
  2227.       debug(F101,"local","",local);
  2228. !     ttopen(ttname,&local,0);
  2229.       break;
  2230.    
  2231.   case 'b':                       /* set baud */
  2232. --- 315,321 ----
  2233.   /*  if (strcmp(ttname,dftty) == 0) local = dfloc; else local = 1;  */
  2234.       local = (strcmp(ttname,CTTNAM) != 0); /* (better than old way) */
  2235.       debug(F101,"local","",local);
  2236. !     ttopen(ttname,&local,mdmtyp);
  2237.       break;
  2238.    
  2239.   case 'b':                       /* set baud */
  2240.  
  2241.  
  2242.  
  2243. End of context diff.
  2244.  
  2245. jw
  2246.  
  2247. **********************
  2248.  
  2249. (End of ckuker.bwr)
  2250.