home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / ultrix / 8119 < prev    next >
Encoding:
Text File  |  1992-11-06  |  2.2 KB  |  48 lines

  1. Newsgroups: comp.unix.ultrix
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!munnari.oz.au!bruce.cs.monash.edu.au!monu6!dibbler.cs.monash.edu.au!tym
  3. From: tym@dibbler.cs.monash.edu.au (Tim MacKenzie)
  4. Subject: Re: problem with rlogind from mjr's bsd-login
  5. Message-ID: <1992Nov6.020313.18631@monu6.cc.monash.edu.au>
  6. Sender: news@monu6.cc.monash.edu.au (Usenet system)
  7. Organization: Computer Science, Monash University, Australia
  8. X-Newsreader: TIN [version 1.1 PL6]
  9. References: <1992Nov4.001002.9128@colorado.edu>
  10. Date: Fri, 6 Nov 1992 02:03:13 GMT
  11. Lines: 35
  12.  
  13. Todd C. Miller (millert@nordsieck.cs.Colorado.EDU) wrote:
  14. >In article <1992Nov3.235004.8649@colorado.edu> millert@nordsieck.cs.Colorado.EDU (Todd C. Miller) writes:
  15. >>I'm running ultrix 4.2a and just installed mjr's bsd-login.  Now I find that
  16. >>when I rlogin to the machine, I cannot open /dev/tty:
  17. >>    nordsieck [~] % echo foo | cat > /dev/tty
  18. >>    /dev/tty: No such device or address.
  19. >incidentally, this doesn't happen when I telnet in, so I naturally suspect
  20. >rlogind :-)
  21.  
  22. I queried mjr about this one a couple of months ago (he didn't have a fix).
  23. I do get the problem with both rlogind and telnetd incidentally.
  24.  
  25. I tracked the problem down just last week. It is in the code that tries to 
  26. clean up the terminal by doing a vhangup. The approximate sequence of events
  27. is: 
  28.   1) find a pty that we can have.
  29.   2) Disassociate ourself from our current controlling terminal (just in case)
  30.   3) open(2) the tty: this makes that tty our controlling terminal.
  31.   4) ignore HUP, vhangup(). This dumps all file descriptors that refer to the
  32.       tty's inode (and loses our current connection to the terminal).
  33.   5) open(2) the tty again.
  34.  
  35. The final step should make the terminal our controlling terminal, thus making
  36. it possible to use /dev/tty and making 'ps' show the terminal that a process
  37. is on.
  38.  
  39. It seems that Ultrix is preventing you from gaining a controlling terminal 
  40. once you have had controlling terminal that was vhangup'd. Could someone at
  41. DEC please confirm this: it is _not_ in any of the relevant man pages.
  42.  
  43. My current solution is to dump steps 4 and 5 from the rlogind and telnetd.
  44. I'm not sure if this opens a security hole, (could anyone advise?) but it
  45. does work!
  46. --
  47. -Tim MacKenzie (tym@dibbler.cs.monash.edu.au)
  48.