home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!wupost!usc!news!netlabs!lwall
- From: lwall@netlabs.com (Larry Wall)
- Newsgroups: comp.lang.perl
- Subject: Re: How do I make 'stty -echo' work from a net service
- Message-ID: <1992Aug15.201559.10614@netlabs.com>
- Date: 15 Aug 92 20:15:59 GMT
- References: <1992Jul29.073546.4419@id.dth.dk>
- Sender: news@netlabs.com
- Organization: NetLabs, Inc.
- Lines: 26
- Nntp-Posting-Host: scalpel.netlabs.com
-
- In article <1992Jul29.073546.4419@id.dth.dk> ej@id.dth.dk (Erik Johansen) writes:
- : In a perl program I need to request a username without
- : echoing it. This works fine when I am running it from a shell.
- :
- : I intend to run it from a tcp net service (/etc/services) but
- : here it will not disable echoing ("Not a tty").
- :
- : I suppose that solving the above problem involves creating a pty
- : but I do not know how to do it.
- :
- : Any ideas of how to code this ?
-
- Well, ask yourself who's doing the echoing? With most network services,
- the client is doing the echoing, and sending entire lines to the server.
- So it's not the server's responsibility to turn off echoing--it's usually
- the clients. If, on the other hand, you're doing a character-oriented
- protocol like telnet, then either you're doing the echoing yourself, and
- you have perfect control over what you send back, or you're running
- it on a pty, as you say. In general you don't have to open a pty--they're
- already there. For some sample pty code, look at Randal's chat2.pl
- that comes with the Perl library. If you do this then you can suppress
- "echo" by simply refusing to forward what you get from the pty back to
- the client. Or run something on the pty that turns off echo itself,
- and then you don't have to worry about it. Those are your options.
-
- Larry
-