read from the network. Second, if a wont ttype was coming in it was
not causing the ttypopt clock to be set since 1) the setting was in
dontoption rather than wontoption and 2) we were leaving hisopts[ttype]
equal to OPT_NO.
SCCS-vsn: libexec/telnetd/telnetd.c 5.18
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)telnetd.c 5.17 (Berkeley) %G%";
+static char sccsid[] = "@(#)telnetd.c 5.18 (Berkeley) %G%";
ncc = read(net, netibuf, sizeof netibuf);
if (ncc < 0) {
syslog(LOG_INFO, "ttloop: read: %m\n");
ncc = read(net, netibuf, sizeof netibuf);
if (ncc < 0) {
syslog(LOG_INFO, "ttloop: read: %m\n");
+ exit(1);
+ } else if (ncc == 0) {
+ syslog(LOG_INFO, "ttloop: peer died: %m\n");
+ exit(1);
}
netip = netibuf;
telrcv(); /* state machine */
}
netip = netibuf;
telrcv(); /* state machine */
settimer(getterminal);
bcopy(sbuf, nfrontp, sizeof sbuf);
nfrontp += sizeof sbuf;
settimer(getterminal);
bcopy(sbuf, nfrontp, sizeof sbuf);
nfrontp += sizeof sbuf;
+ hisopts[TELOPT_TTYPE] = OPT_YES_BUT_ALWAYS_LOOK;
while (sequenceIs(ttypeopt, getterminal)) {
ttloop();
}
while (sequenceIs(ttypeopt, getterminal)) {
ttloop();
}
case TELOPT_BINARY:
mode(0, RAW);
break;
case TELOPT_BINARY:
mode(0, RAW);
break;
+
+ case TELOPT_TTYPE:
+ settimer(ttypeopt);
+ break;
fmt = dont;
hisopts[option] = OPT_NO;
sprintf(nfrontp, fmt, option);
fmt = dont;
hisopts[option] = OPT_NO;
sprintf(nfrontp, fmt, option);
- case TELOPT_TTYPE:
- fmt = wont;
- settimer(ttypeopt);
- break;
-
default:
fmt = wont;
break;
default:
fmt = wont;
break;