home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!munnari.oz.au!metro!mama!philip
- From: philip@research.canon.oz.au (Philip Craig)
- Subject: I/O mapping from /bin/login
- Message-ID: <BxwJ4M.DI1@research.canon.oz.au>
- Sender: news@research.canon.oz.au
- Organization: Canon Information Systems Research Australia
- Date: Wed, 18 Nov 1992 07:50:46 GMT
- Lines: 52
-
- Hi. I'm trying to write a program which will call up a remote modem
- and let the user login (as a dial back security measure).
-
- I have it almost working (thanks for source contributions guys), but now
- something *very weird* is happening.
-
- The program runs very successfully, calling up my remote modem and
- displaying "login:" on the terminal. It then awaits input from the
- remote modem and upon getting <cr> prints "Password:" on the remote
- modem.
-
- All is good up to this point, but now things go strangely. Somehow,
- /bin/login changes where it expects its input from at this point. It
- awaits input from the starting terminal of the dialout program. If it
- is given a bad password, the program will then print "login:" on the
- correct remote terminal again, and *again await input* from the correct,
- remote, location. This can be repeated for as many bad logins as /bin/login
- allows.
-
- If a correct password is supplied (from the wrong terminal, of course) then
- the user's login shell is started, any .cshrc output appears in the correct,
- remote, location, then the shell freezes awaiting input from the starting
- terminal of the dial program. Not helpful.
-
- The terminal is having /bin/login pointed at it by the following lines:
-
- /*
- * Redirect /bin/login's stdin, stdout and stderr (no error
- * checking here.)
- */
- dup2( fd, 0);
- dup2( fd, 1 );
- dup2( fd, 2 );
- dup2( fd, 3 );
-
- /*
- * Execute /bin/login with the serial line as its stdin, stdout
- * and stderr.
- */
- execl("/usr/etc/getty", "usr/etc/getty", "D2400", "-", (char *) 0);
-
- Any problem here. The descriptor in fd is the one that successfully
- read and wrote characters to the modem for the dialing command.
-
- Please reply by e-mail--I can't keep up with the volume in here.
-
- Thanks in advance,
- --
- _/_/_/ _/ _/ _/ _/ _/ _/_/_/ _p_h_i_l_i_p_@_r_e_s_e_a_r_c_h_._c_a_n_o_n_._o_z_._a_u _--_|\
- _/ _/ _/ _/ _/ _/ _/ _/ _/ Phone: +61 2 805 2951 / \
- _/_/_/ _/_/_/ _/ _/ _/ _/_/_/ Fax: +61 2 805 2929 \_.--._/
- _/ _/ _/ _/ _/_/_/ _/ _/ PO Box 313 North Ryde 2113 AUSTRALIA v
-