version 1.214, 2004/06/13 15:03:02 |
version 1.215, 2004/06/17 14:52:48 |
|
|
static void |
static void |
ssh_session2_setup(int id, void *arg) |
ssh_session2_setup(int id, void *arg) |
{ |
{ |
|
extern char **environ; |
|
|
int interactive = tty_flag; |
int interactive = tty_flag; |
if (options.forward_x11 && getenv("DISPLAY") != NULL) { |
if (options.forward_x11 && getenv("DISPLAY") != NULL) { |
char *proto, *data; |
char *proto, *data; |
|
|
} |
} |
|
|
client_session2_setup(id, tty_flag, subsystem_flag, getenv("TERM"), |
client_session2_setup(id, tty_flag, subsystem_flag, getenv("TERM"), |
NULL, fileno(stdin), &command, &ssh_subsystem_reply); |
NULL, fileno(stdin), &command, environ, &ssh_subsystem_reply); |
|
|
packet_set_interactive(interactive); |
packet_set_interactive(interactive); |
} |
} |
|
|
control_client(const char *path) |
control_client(const char *path) |
{ |
{ |
struct sockaddr_un addr; |
struct sockaddr_un addr; |
int r, sock, exitval; |
int i, r, sock, exitval; |
Buffer m; |
Buffer m; |
char *cp; |
char *cp; |
|
extern char **environ; |
|
|
memset(&addr, '\0', sizeof(addr)); |
memset(&addr, '\0', sizeof(addr)); |
addr.sun_family = AF_UNIX; |
addr.sun_family = AF_UNIX; |
|
|
fatal("%s: wrong version", __func__); |
fatal("%s: wrong version", __func__); |
control_server_pid = buffer_get_int(&m); |
control_server_pid = buffer_get_int(&m); |
|
|
/* XXX: env passing */ |
|
|
|
buffer_clear(&m); |
buffer_clear(&m); |
buffer_put_int(&m, tty_flag); |
buffer_put_int(&m, tty_flag); |
buffer_put_int(&m, subsystem_flag); |
buffer_put_int(&m, subsystem_flag); |
|
|
|
|
buffer_append(&command, "\0", 1); |
buffer_append(&command, "\0", 1); |
buffer_put_cstring(&m, buffer_ptr(&command)); |
buffer_put_cstring(&m, buffer_ptr(&command)); |
|
|
|
/* Pass environment */ |
|
for (i = 0; environ != NULL && environ[i] != NULL; i++) |
|
; |
|
buffer_put_int(&m, i); |
|
for (i = 0; environ != NULL && environ[i] != NULL; i++) |
|
buffer_put_cstring(&m, environ[i]); |
|
|
if (ssh_msg_send(sock, /* version */0, &m) == -1) |
if (ssh_msg_send(sock, /* version */0, &m) == -1) |
fatal("%s: msg_send", __func__); |
fatal("%s: msg_send", __func__); |