version 1.239, 2008/06/14 18:33:43 |
version 1.240, 2008/06/15 20:06:26 |
|
|
/* func */ |
/* func */ |
|
|
Session *session_new(void); |
Session *session_new(void); |
void session_set_fds(Session *, int, int, int); |
void session_set_fds(Session *, int, int, int, int); |
void session_pty_cleanup(Session *); |
void session_pty_cleanup(Session *); |
void session_proctitle(Session *); |
void session_proctitle(Session *); |
int session_setup_x11fwd(Session *); |
int session_setup_x11fwd(Session *); |
|
|
close(perr[0]); |
close(perr[0]); |
perr[0] = -1; |
perr[0] = -1; |
} |
} |
session_set_fds(s, pin[1], pout[0], perr[0]); |
session_set_fds(s, pin[1], pout[0], perr[0], 0); |
} else { |
} else { |
/* Enter the interactive session. */ |
/* Enter the interactive session. */ |
server_loop(pid, pin[1], pout[0], perr[0]); |
server_loop(pid, pin[1], pout[0], perr[0]); |
|
|
*/ |
*/ |
if (compat20) { |
if (compat20) { |
session_set_fds(s, inout[1], inout[1], |
session_set_fds(s, inout[1], inout[1], |
s->is_subsystem ? -1 : err[1]); |
s->is_subsystem ? -1 : err[1], 0); |
if (s->is_subsystem) |
if (s->is_subsystem) |
close(err[1]); |
close(err[1]); |
} else { |
} else { |
|
|
s->ptymaster = ptymaster; |
s->ptymaster = ptymaster; |
packet_set_interactive(1); |
packet_set_interactive(1); |
if (compat20) { |
if (compat20) { |
session_set_fds(s, ptyfd, fdout, -1); |
session_set_fds(s, ptyfd, fdout, -1, 1); |
} else { |
} else { |
server_loop(pid, ptyfd, fdout, -1); |
server_loop(pid, ptyfd, fdout, -1); |
/* server_loop _has_ closed ptyfd and fdout. */ |
/* server_loop _has_ closed ptyfd and fdout. */ |
|
|
} |
} |
|
|
void |
void |
session_set_fds(Session *s, int fdin, int fdout, int fderr) |
session_set_fds(Session *s, int fdin, int fdout, int fderr, int isatty) |
{ |
{ |
if (!compat20) |
if (!compat20) |
fatal("session_set_fds: called for proto != 2.0"); |
fatal("session_set_fds: called for proto != 2.0"); |
|
|
channel_set_fds(s->chanid, |
channel_set_fds(s->chanid, |
fdout, fdin, fderr, |
fdout, fdin, fderr, |
fderr == -1 ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ, |
fderr == -1 ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ, |
1, |
1, isatty, CHAN_SES_WINDOW_DEFAULT); |
CHAN_SES_WINDOW_DEFAULT); |
|
} |
} |
|
|
/* |
/* |