diff options
Diffstat (limited to 'networking/telnetd.c')
-rw-r--r-- | networking/telnetd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c index 5c011e15d..07c6a6a73 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -141,7 +141,7 @@ remove_iacs(struct tsession *ts, int *pnum_totty) | |||
141 | if (ptr[1] == SB && ptr[2] == TELOPT_NAWS) { | 141 | if (ptr[1] == SB && ptr[2] == TELOPT_NAWS) { |
142 | struct winsize ws; | 142 | struct winsize ws; |
143 | if ((ptr+8) >= end) | 143 | if ((ptr+8) >= end) |
144 | break; /* incomplete, can't process */ | 144 | break; /* incomplete, can't process */ |
145 | ws.ws_col = (ptr[3] << 8) | ptr[4]; | 145 | ws.ws_col = (ptr[3] << 8) | ptr[4]; |
146 | ws.ws_row = (ptr[5] << 8) | ptr[6]; | 146 | ws.ws_row = (ptr[5] << 8) | ptr[6]; |
147 | ioctl(ts->ptyfd, TIOCSWINSZ, (char *)&ws); | 147 | ioctl(ts->ptyfd, TIOCSWINSZ, (char *)&ws); |
@@ -273,8 +273,8 @@ make_new_session( | |||
273 | static const char iacs_to_send[] ALIGN1 = { | 273 | static const char iacs_to_send[] ALIGN1 = { |
274 | IAC, DO, TELOPT_ECHO, | 274 | IAC, DO, TELOPT_ECHO, |
275 | IAC, DO, TELOPT_NAWS, | 275 | IAC, DO, TELOPT_NAWS, |
276 | /* This requires telnetd.ctrlSQ.patch (incomplete) */ | 276 | /* This requires telnetd.ctrlSQ.patch (incomplete) */ |
277 | /* IAC, DO, TELOPT_LFLOW, */ | 277 | /*IAC, DO, TELOPT_LFLOW,*/ |
278 | IAC, WILL, TELOPT_ECHO, | 278 | IAC, WILL, TELOPT_ECHO, |
279 | IAC, WILL, TELOPT_SGA | 279 | IAC, WILL, TELOPT_SGA |
280 | }; | 280 | }; |
@@ -314,6 +314,8 @@ make_new_session( | |||
314 | /* Restore default signal handling ASAP */ | 314 | /* Restore default signal handling ASAP */ |
315 | bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL); | 315 | bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL); |
316 | 316 | ||
317 | pid = getpid(); | ||
318 | |||
317 | if (ENABLE_FEATURE_UTMP) { | 319 | if (ENABLE_FEATURE_UTMP) { |
318 | len_and_sockaddr *lsa = get_peer_lsa(sock); | 320 | len_and_sockaddr *lsa = get_peer_lsa(sock); |
319 | char *hostname = NULL; | 321 | char *hostname = NULL; |
@@ -335,7 +337,6 @@ make_new_session( | |||
335 | xopen(tty_name, O_RDWR); /* becomes our ctty */ | 337 | xopen(tty_name, O_RDWR); /* becomes our ctty */ |
336 | xdup2(0, 1); | 338 | xdup2(0, 1); |
337 | xdup2(0, 2); | 339 | xdup2(0, 2); |
338 | pid = getpid(); | ||
339 | tcsetpgrp(0, pid); /* switch this tty's process group to us */ | 340 | tcsetpgrp(0, pid); /* switch this tty's process group to us */ |
340 | 341 | ||
341 | /* The pseudo-terminal allocated to the client is configured to operate | 342 | /* The pseudo-terminal allocated to the client is configured to operate |