version 1.87, 2021/04/03 06:18:40 |
version 1.88, 2021/05/19 01:24:05 |
|
|
if (cctx->want_tty && tcgetattr(new_fd[0], &cctx->tio) == -1) |
if (cctx->want_tty && tcgetattr(new_fd[0], &cctx->tio) == -1) |
error_f("tcgetattr: %s", strerror(errno)); |
error_f("tcgetattr: %s", strerror(errno)); |
|
|
/* enable nonblocking unless tty */ |
|
if (!isatty(new_fd[0])) |
|
set_nonblock(new_fd[0]); |
|
if (!isatty(new_fd[1])) |
|
set_nonblock(new_fd[1]); |
|
if (!isatty(new_fd[2])) |
|
set_nonblock(new_fd[2]); |
|
|
|
window = CHAN_SES_WINDOW_DEFAULT; |
window = CHAN_SES_WINDOW_DEFAULT; |
packetmax = CHAN_SES_PACKET_DEFAULT; |
packetmax = CHAN_SES_PACKET_DEFAULT; |
if (cctx->want_tty) { |
if (cctx->want_tty) { |
|
|
|
|
nc = channel_new(ssh, "session", SSH_CHANNEL_OPENING, |
nc = channel_new(ssh, "session", SSH_CHANNEL_OPENING, |
new_fd[0], new_fd[1], new_fd[2], window, packetmax, |
new_fd[0], new_fd[1], new_fd[2], window, packetmax, |
CHAN_EXTENDED_WRITE, "client-session", /*nonblock*/0); |
CHAN_EXTENDED_WRITE, "client-session", CHANNEL_NONBLOCK_STDIO); |
|
|
nc->ctl_chan = c->self; /* link session -> control channel */ |
nc->ctl_chan = c->self; /* link session -> control channel */ |
c->remote_id = nc->self; /* link control -> session channel */ |
c->remote_id = nc->self; /* link control -> session channel */ |
|
|
} |
} |
} |
} |
|
|
/* enable nonblocking unless tty */ |
nc = channel_connect_stdio_fwd(ssh, chost, cport, new_fd[0], new_fd[1], |
if (!isatty(new_fd[0])) |
CHANNEL_NONBLOCK_STDIO); |
set_nonblock(new_fd[0]); |
|
if (!isatty(new_fd[1])) |
|
set_nonblock(new_fd[1]); |
|
|
|
nc = channel_connect_stdio_fwd(ssh, chost, cport, new_fd[0], new_fd[1]); |
|
free(chost); |
free(chost); |
|
|
nc->ctl_chan = c->self; /* link session -> control channel */ |
nc->ctl_chan = c->self; /* link session -> control channel */ |