From owner-freebsd-current Mon Apr 17 07:43:18 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id HAA01734 for current-outgoing; Mon, 17 Apr 1995 07:43:18 -0700 Received: from irbs.com (irbs.com [199.182.75.129]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id HAA01718 for ; Mon, 17 Apr 1995 07:43:04 -0700 Received: (from jc@localhost) by irbs.com (8.6.11/8.6.6) id KAA26207 for freebsd-current@freefall.cdrom.com; Mon, 17 Apr 1995 10:42:54 -0400 From: John Capo Message-Id: <199504171442.KAA26207@irbs.com> Subject: Re: Missing telent login prompt To: freebsd-current@freefall.cdrom.com (freebsd-current) Date: Mon, 17 Apr 1995 10:42:52 -0400 (EDT) In-Reply-To: <9504150736.AA01776@cs.weber.edu> from "Terry Lambert" at Apr 15, 95 01:36:20 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 5378 Sender: current-owner@FreeBSD.org Precedence: bulk Terry Lambert writes: > > > > > > > No, the prompt fell on the floor. login is running and waiting > > > for a user name. Terry says its a option negotiation problem. > > > > Hmmmm, haven't seen that problem here then. My problem is simply > > a delayed login prompt or password (i.e., happens whether I use telnet > > or rlogin to contact the FreeBSD box). > > Terry introduced this problem in a prerelease version of a commercial > telnet client, which is why he thinks it's option negotiation. 8-(. > > The missing login prompt depends on the erase character. Script started on Mon Apr 17 10:02:41 1995 irbs 1% stty erase '^H' irbs 2% telnet freefall.cdrom.com Trying 192.216.222.4... Connected to freefall.cdrom.com. Escape character is '^]'. FreeBSD (freefall.cdrom.com) (ttyp6) ^] telnet> ^DConnection closed. irbs 3% stty erase '^?' irbs 4% telnet freefall.cdrom.com Trying 192.216.222.4... Connected to freefall.cdrom.com. Escape character is '^]'. FreeBSD (freefall.cdrom.com) (ttyp6) login: ^] telnet> ^DConnection closed. irbs 5% ^Dexit I _NEVER_ get a prompt from freefall if my erase character is ^H and I _ALWAYS_ get a prompt if my erase character is ^?. I have not been able to determine what is eating the login prompt. The slave side of the pty, login then a shell, is started in the middle of option negotiation. Starting the slave pty after option negotation works. Code compiled for Convex does this. Another problem was that when the slave pty is started the erase character for the slave is CERASE from sys/ttydefaults.h. This is set after telnet has negotiated an erase character. Telnetd notices that the erase character has changed and it notifies the other side of that fact. Your erase character has now been changed to CERASE rather than what your tty is set for. After login the erase character is set back to what the tty is set for. You only loose proper erase during login. I have an ISP friend that needed reliable telnet prompts from a 2.X machine for his naive users. This patch works if anyone else is interested. John Capo *** telnetd.c.orig Fri Aug 12 19:00:02 1994 --- telnetd.c Wed Apr 12 11:46:21 1995 *************** *** 740,749 **** char host_name[MAXHOSTNAMELEN]; char remote_host_name[MAXHOSTNAMELEN]; ! #ifndef convex ! extern void telnet P((int, int)); ! #else extern void telnet P((int, int, char *)); #endif /* --- 740,749 ---- char host_name[MAXHOSTNAMELEN]; char remote_host_name[MAXHOSTNAMELEN]; ! #if defined(convex) || defined(__FreeBSD__) extern void telnet P((int, int, char *)); + #else + extern void telnet P((int, int)); #endif /* *************** *** 837,843 **** /* * Start up the login process on the slave side of the terminal */ ! #ifndef convex startslave(host, level, user_name); #if defined(_SC_CRAY_SECURE_SYS) --- 837,843 ---- /* * Start up the login process on the slave side of the terminal */ ! #if !defined(convex) && !defined(__FreeBSD__) startslave(host, level, user_name); #if defined(_SC_CRAY_SECURE_SYS) *************** *** 849,855 **** --- 849,859 ---- } #endif /* _SC_CRAY_SECURE_SYS */ + #if __FreeBSD__ + telnet(net, pty, host); /* begin server processing */ + #else telnet(net, pty); /* begin server processing */ + #endif #else telnet(net, pty, host); #endif *************** *** 876,888 **** * hand data to telnet receiver finite state machine. */ void ! #ifndef convex ! telnet(f, p) ! #else telnet(f, p, host) #endif int f, p; ! #ifdef convex char *host; #endif { --- 880,892 ---- * hand data to telnet receiver finite state machine. */ void ! #if defined(convex) || defined(__FreeBSD__) telnet(f, p, host) + #else + telnet(f, p) #endif int f, p; ! #if defined(convex) || defined(__FreeBSD__) char *host; #endif { *************** *** 1120,1126 **** {sprintf(nfrontp, "td: Entering processing loop\r\n"); nfrontp += strlen(nfrontp);}); ! #ifdef convex startslave(host); #endif --- 1124,1130 ---- {sprintf(nfrontp, "td: Entering processing loop\r\n"); nfrontp += strlen(nfrontp);}); ! #if defined(convex) || defined(__FreeBSD__) startslave(host); #endif *** sys_term.c.orig Thu Feb 9 10:17:32 1995 --- sys_term.c Thu Apr 13 13:10:34 1995 *************** *** 1025,1030 **** --- 1025,1031 ---- getptyslave() { register int t = -1; + char erase; #if !defined(CRAY) || !defined(NEWINIT) # ifdef LINEMODE *************** *** 1046,1052 **** # ifdef LINEMODE waslm = tty_linemode(); # endif ! /* * Make sure that we don't have a controlling tty, and --- 1047,1053 ---- # ifdef LINEMODE waslm = tty_linemode(); # endif ! erase = termbuf.c_cc[VERASE]; /* * Make sure that we don't have a controlling tty, and *************** *** 1090,1095 **** --- 1091,1097 ---- * set up the tty modes as we like them to be. */ init_termbuf(); + # ifdef TIOCGWINSZ if (def_row || def_col) { bzero((char *)&ws, sizeof(ws)); *************** *** 1133,1138 **** --- 1135,1143 ---- tty_rspeed((def_rspeed > 0) ? def_rspeed : 9600); tty_tspeed((def_tspeed > 0) ? def_tspeed : 9600); # ifdef LINEMODE + if (erase) + termbuf.c_cc[VERASE] = erase; + if (waslm) tty_setlinemode(1); # endif /* LINEMODE */