diff options
author | pst <pst@FreeBSD.org> | 1995-09-05 17:34:29 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1995-09-05 17:34:29 +0000 |
commit | e7519fbb2baae042c7670e7c6db5e4f70767a9a0 (patch) | |
tree | 129b4c41aa0c32655b959f1694ff06a0a3eb556a /libexec/telnetd | |
parent | 1946a609dcf322bb2959db2075db4c43cd9f8b4f (diff) | |
download | FreeBSD-src-e7519fbb2baae042c7670e7c6db5e4f70767a9a0.zip FreeBSD-src-e7519fbb2baae042c7670e7c6db5e4f70767a9a0.tar.gz |
Delay starting login process until option negotiation is complete to
avoid race condition on connections with larger round-trip-times.
Submitted by: John Capo & Peter Wemm
Diffstat (limited to 'libexec/telnetd')
-rw-r--r-- | libexec/telnetd/telnetd.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c index 87e017d..155ef56 100644 --- a/libexec/telnetd/telnetd.c +++ b/libexec/telnetd/telnetd.c @@ -740,11 +740,7 @@ char *hostname; 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 /* * Get a pty, scan input lines. @@ -834,12 +830,6 @@ doit(who) level = getterminaltype(user_name); setenv("TERM", terminaltype ? terminaltype : "network", 1); - /* - * 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) if (secflag) { if (setulvl(dv.dv_actlvl) < 0) @@ -849,10 +839,8 @@ doit(who) } #endif /* _SC_CRAY_SECURE_SYS */ - telnet(net, pty); /* begin server processing */ -#else - telnet(net, pty, host); -#endif + telnet(net, pty, host); /* begin server process */ + /*NOTREACHED*/ } /* end of doit */ @@ -876,15 +864,9 @@ Xterm_output(ibufp, obuf, icountp, ocount) * 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 { int on = 1; #define TABBUFSIZ 512 @@ -1120,9 +1102,12 @@ telnet(f, p, host) {sprintf(nfrontp, "td: Entering processing loop\r\n"); nfrontp += strlen(nfrontp);}); -#ifdef convex + /* + * Startup the login process on the slave side of the terminal + * now. We delay this until here to insure option negotiation + * is complete. + */ startslave(host); -#endif for (;;) { fd_set ibits, obits, xbits; |