From owner-freebsd-net Fri May 12 21:20:10 2000 Delivered-To: freebsd-net@freebsd.org Received: from databus.databus.com (databus.databus.com [198.186.154.34]) by hub.freebsd.org (Postfix) with SMTP id 99A3D37BE46 for ; Fri, 12 May 2000 21:19:58 -0700 (PDT) (envelope-from barney@databus.databus.com) From: Barney Wolff To: freebsd-net@freebsd.org Date: Fri, 12 May 2000 23:56 EDT Subject: Re: socket programming Content-Length: 1095 Content-Type: text/plain Message-ID: <391cd7e80.3e9@databus.databus.com> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Well, telnet is a funny protocol. Both answers have been wrong. The telnet echo mode controls whether a telnet peer will echo *back along the tcp connection* not, as one might think, to the screen. So the way to tell the telnet client to stop echoing to the user is to send IAC WILL ECHO (255,251,1). The client, seeing that the server wants to echo, should reply IAC DO ECHO (255,253,1) and stop echoing itself. The server, in this case, lies, because it really is not going to echo. To avoid a race condition, do all this before sending the password prompt. You don't have to wait for the client's do-echo, but you do have to avoid taking it as part of the password. The above assumes that it is the telnet client that is doing the echoing, of course. If it's the server, then just stop. For example, in the customary case of logging into a shell on a remote host, it's the server host that's echoing, not the client. And if the client is not a real telnet client, but some custom program that doesn't understand the telnet protocol, you're sunk. Barney Wolff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message