version 1.88, 2001/02/04 15:32:26 |
version 1.89, 2001/02/06 22:07:42 |
|
|
#include "readconf.h" |
#include "readconf.h" |
#include "sshconnect.h" |
#include "sshconnect.h" |
#include "tildexpand.h" |
#include "tildexpand.h" |
|
#include "dispatch.h" |
#include "misc.h" |
#include "misc.h" |
|
|
extern char *__progname; |
extern char *__progname; |
|
|
} |
} |
|
|
void |
void |
|
client_subsystem_reply(int type, int plen, void *ctxt) |
|
{ |
|
int id, len; |
|
|
|
id = packet_get_int(); |
|
len = buffer_len(&command); |
|
len = MAX(len, 900); |
|
packet_done(); |
|
if (type == SSH2_MSG_CHANNEL_FAILURE) |
|
fatal("Request for subsystem '%.*s' failed on channel %d", |
|
len, buffer_ptr(&command), id); |
|
} |
|
|
|
void |
ssh_session2_callback(int id, void *arg) |
ssh_session2_callback(int id, void *arg) |
{ |
{ |
int len; |
int len; |
|
|
len = 900; |
len = 900; |
if (subsystem_flag) { |
if (subsystem_flag) { |
debug("Sending subsystem: %.*s", len, buffer_ptr(&command)); |
debug("Sending subsystem: %.*s", len, buffer_ptr(&command)); |
channel_request_start(id, "subsystem", 0); |
channel_request_start(id, "subsystem", /*want reply*/ 1); |
|
/* register callback for reply */ |
|
/* XXX we asume that client_loop has already been called */ |
|
dispatch_set(SSH2_MSG_CHANNEL_FAILURE, &client_subsystem_reply); |
|
dispatch_set(SSH2_MSG_CHANNEL_SUCCESS, &client_subsystem_reply); |
} else { |
} else { |
debug("Sending command: %.*s", len, buffer_ptr(&command)); |
debug("Sending command: %.*s", len, buffer_ptr(&command)); |
channel_request_start(id, "exec", 0); |
channel_request_start(id, "exec", 0); |