version 1.128, 2004/06/18 11:11:54 |
version 1.129, 2004/07/11 17:48:47 |
|
|
|
|
if (options.server_alive_interval == 0 || !compat20) |
if (options.server_alive_interval == 0 || !compat20) |
tvp = NULL; |
tvp = NULL; |
else { |
else { |
tv.tv_sec = options.server_alive_interval; |
tv.tv_sec = options.server_alive_interval; |
tv.tv_usec = 0; |
tv.tv_usec = 0; |
tvp = &tv; |
tvp = &tv; |
|
|
{ |
{ |
int id; |
int id; |
Channel *c; |
Channel *c; |
|
|
id = packet_get_int(); |
id = packet_get_int(); |
packet_check_eom(); |
packet_check_eom(); |
|
|
|
|
struct confirm_ctx *cctx = arg; |
struct confirm_ctx *cctx = arg; |
Channel *c; |
Channel *c; |
int i; |
int i; |
|
|
if (cctx == NULL) |
if (cctx == NULL) |
fatal("%s: cctx == NULL", __func__); |
fatal("%s: cctx == NULL", __func__); |
if ((c = channel_lookup(id)) == NULL) |
if ((c = channel_lookup(id)) == NULL) |
fatal("%s: no channel for id %d", __func__, id); |
fatal("%s: no channel for id %d", __func__, id); |
|
|
client_session2_setup(id, cctx->want_tty, cctx->want_subsys, |
client_session2_setup(id, cctx->want_tty, cctx->want_subsys, |
cctx->term, &cctx->tio, c->rfd, &cctx->cmd, cctx->env, |
cctx->term, &cctx->tio, c->rfd, &cctx->cmd, cctx->env, |
client_subsystem_reply); |
client_subsystem_reply); |
|
|
|
|
for (i = 0; cctx->env[i] != NULL; i++) |
for (i = 0; cctx->env[i] != NULL; i++) |
xfree(cctx->env[i]); |
xfree(cctx->env[i]); |
xfree(cctx->env); |
xfree(cctx->env); |
} |
} |
xfree(cctx); |
xfree(cctx); |
} |
} |
|
|
|
|
* Accept empty responses and responses consisting |
* Accept empty responses and responses consisting |
* of the word "yes" as affirmative. |
* of the word "yes" as affirmative. |
*/ |
*/ |
if (*p == '\0' || *p == '\n' || |
if (*p == '\0' || *p == '\n' || |
strcasecmp(p, "yes") == 0) |
strcasecmp(p, "yes") == 0) |
allowed = 1; |
allowed = 1; |
xfree(p); |
xfree(p); |
|
|
|
|
set_nonblock(client_fd); |
set_nonblock(client_fd); |
|
|
c = channel_new("session", SSH_CHANNEL_OPENING, |
c = channel_new("session", SSH_CHANNEL_OPENING, |
new_fd[0], new_fd[1], new_fd[2], |
new_fd[0], new_fd[1], new_fd[2], |
CHAN_SES_WINDOW_DEFAULT, CHAN_SES_PACKET_DEFAULT, |
CHAN_SES_WINDOW_DEFAULT, CHAN_SES_PACKET_DEFAULT, |
CHAN_EXTENDED_WRITE, "client-session", /*nonblock*/0); |
CHAN_EXTENDED_WRITE, "client-session", /*nonblock*/0); |
|
|
} |
} |
|
|
void |
void |
client_session2_setup(int id, int want_tty, int want_subsystem, |
client_session2_setup(int id, int want_tty, int want_subsystem, |
const char *term, struct termios *tiop, int in_fd, Buffer *cmd, char **env, |
const char *term, struct termios *tiop, int in_fd, Buffer *cmd, char **env, |
dispatch_fn *subsys_repl) |
dispatch_fn *subsys_repl) |
{ |
{ |