|
Lines 97-103
Link Here
|
| 97 |
/* func */ |
97 |
/* func */ |
| 98 |
|
98 |
|
| 99 |
Session *session_new(void); |
99 |
Session *session_new(void); |
| 100 |
void session_set_fds(Session *, int, int, int); |
100 |
void session_set_fds(Session *, int, int, int, int); |
| 101 |
void session_pty_cleanup(Session *); |
101 |
void session_pty_cleanup(Session *); |
| 102 |
void session_proctitle(Session *); |
102 |
void session_proctitle(Session *); |
| 103 |
int session_setup_x11fwd(Session *); |
103 |
int session_setup_x11fwd(Session *); |
|
Lines 510-516
Link Here
|
| 510 |
close(perr[0]); |
510 |
close(perr[0]); |
| 511 |
perr[0] = -1; |
511 |
perr[0] = -1; |
| 512 |
} |
512 |
} |
| 513 |
session_set_fds(s, pin[1], pout[0], perr[0]); |
513 |
session_set_fds(s, pin[1], pout[0], perr[0], 0); |
| 514 |
} else { |
514 |
} else { |
| 515 |
/* Enter the interactive session. */ |
515 |
/* Enter the interactive session. */ |
| 516 |
server_loop(pid, pin[1], pout[0], perr[0]); |
516 |
server_loop(pid, pin[1], pout[0], perr[0]); |
|
Lines 533-539
Link Here
|
| 533 |
* handle the case that fdin and fdout are the same. |
533 |
* handle the case that fdin and fdout are the same. |
| 534 |
*/ |
534 |
*/ |
| 535 |
if (compat20) { |
535 |
if (compat20) { |
| 536 |
session_set_fds(s, inout[1], inout[1], s->is_subsystem ? -1 : err[1]); |
536 |
session_set_fds(s, inout[1], inout[1], |
|
|
537 |
s->is_subsystem ? -1 : err[1], 0); |
| 537 |
} else { |
538 |
} else { |
| 538 |
server_loop(pid, inout[1], inout[1], err[1]); |
539 |
server_loop(pid, inout[1], inout[1], err[1]); |
| 539 |
/* server_loop has closed inout[1] and err[1]. */ |
540 |
/* server_loop has closed inout[1] and err[1]. */ |
|
Lines 631-637
Link Here
|
| 631 |
/* Enter interactive session. */ |
632 |
/* Enter interactive session. */ |
| 632 |
packet_set_interactive(1); |
633 |
packet_set_interactive(1); |
| 633 |
if (compat20) { |
634 |
if (compat20) { |
| 634 |
session_set_fds(s, ptyfd, fdout, -1); |
635 |
session_set_fds(s, ptyfd, fdout, -1, 1); |
| 635 |
} else { |
636 |
} else { |
| 636 |
server_loop(pid, ptyfd, fdout, -1); |
637 |
server_loop(pid, ptyfd, fdout, -1); |
| 637 |
/* server_loop _has_ closed ptyfd and fdout. */ |
638 |
/* server_loop _has_ closed ptyfd and fdout. */ |
|
Lines 2137-2143
Link Here
|
| 2137 |
} |
2138 |
} |
| 2138 |
|
2139 |
|
| 2139 |
void |
2140 |
void |
| 2140 |
session_set_fds(Session *s, int fdin, int fdout, int fderr) |
2141 |
session_set_fds(Session *s, int fdin, int fdout, int fderr, int forcetty) |
| 2141 |
{ |
2142 |
{ |
| 2142 |
if (!compat20) |
2143 |
if (!compat20) |
| 2143 |
fatal("session_set_fds: called for proto != 2.0"); |
2144 |
fatal("session_set_fds: called for proto != 2.0"); |
|
Lines 2150-2156
Link Here
|
| 2150 |
channel_set_fds(s->chanid, |
2151 |
channel_set_fds(s->chanid, |
| 2151 |
fdout, fdin, fderr, |
2152 |
fdout, fdin, fderr, |
| 2152 |
fderr == -1 ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ, |
2153 |
fderr == -1 ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ, |
| 2153 |
1, |
2154 |
1, forcetty, |
| 2154 |
CHAN_SES_WINDOW_DEFAULT); |
2155 |
CHAN_SES_WINDOW_DEFAULT); |
| 2155 |
} |
2156 |
} |
| 2156 |
|
2157 |
|