home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / question / 13570 < prev    next >
Encoding:
Text File  |  1992-11-18  |  2.5 KB  |  63 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!munnari.oz.au!metro!mama!philip
  3. From: philip@research.canon.oz.au (Philip Craig)
  4. Subject: I/O mapping from /bin/login
  5. Message-ID: <BxwJ4M.DI1@research.canon.oz.au>
  6. Sender: news@research.canon.oz.au
  7. Organization: Canon Information Systems Research Australia
  8. Date: Wed, 18 Nov 1992 07:50:46 GMT
  9. Lines: 52
  10.  
  11. Hi. I'm trying to write a program which will call up a remote modem
  12. and let the user login (as a dial back security measure).
  13.  
  14. I have it almost working (thanks for source contributions guys), but now
  15. something *very weird* is happening.
  16.  
  17. The program runs very successfully, calling up my remote modem and
  18. displaying "login:" on the terminal. It then awaits input from the
  19. remote modem and upon getting <cr> prints "Password:" on the remote
  20. modem.
  21.  
  22. All is good up to this point, but now things go strangely. Somehow,
  23. /bin/login changes where it expects its input from at this point. It
  24. awaits input from the starting terminal of the dialout program. If it
  25. is given a bad password, the program will then print "login:" on the
  26. correct remote terminal again, and *again await input* from the correct,
  27. remote, location. This can be repeated for as many bad logins as /bin/login
  28. allows.
  29.  
  30. If a correct password is supplied (from the wrong terminal, of course) then
  31. the user's login shell is started, any .cshrc output appears in the correct,
  32. remote, location, then the shell freezes awaiting input from the starting
  33. terminal of the dial program. Not helpful.
  34.  
  35. The terminal is having /bin/login pointed at it by the following lines:
  36.  
  37.     /*
  38.      * Redirect /bin/login's stdin, stdout and stderr (no error
  39.      * checking here.)
  40.      */
  41.     dup2( fd, 0);
  42.     dup2( fd, 1 );
  43.     dup2( fd, 2 );
  44.     dup2( fd, 3 );
  45.     
  46.     /*
  47.      * Execute /bin/login with the serial line as its stdin, stdout
  48.      * and stderr.
  49.      */
  50.     execl("/usr/etc/getty", "usr/etc/getty", "D2400", "-", (char *) 0);
  51.  
  52. Any problem here. The descriptor in fd is the one that successfully
  53. read and wrote characters to the modem for the dialing command.
  54.  
  55. Please reply by e-mail--I can't keep up with the volume in here.
  56.  
  57. Thanks in advance,
  58. -- 
  59.    _/_/_/ _/  _/ _/ _/     _/ _/_/_/ _p_h_i_l_i_p_@_r_e_s_e_a_r_c_h_._c_a_n_o_n_._o_z_._a_u   _--_|\
  60.   _/  _/ _/  _/ _/ _/     _/ _/  _/  Phone: +61 2 805 2951        /      \
  61.  _/_/_/ _/_/_/ _/ _/     _/ _/_/_/   Fax:   +61 2 805 2929        \_.--._/
  62. _/     _/  _/ _/ _/_/_/ _/ _/     PO Box 313 North Ryde 2113 AUSTRALIA  v
  63.