Bugzilla – Attachment 1317 Details for
Bug 1328
Support multiple X11 forwarding in multiplexing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
pass display information through controlclient socket
openssh-4.2p1-controldisplay.patch (text/plain), 4.20 KB, created by
David Woodhouse
on 2007-07-06 01:17:12 AEST
(
hide
)
Description:
pass display information through controlclient socket
Filename:
MIME Type:
Creator:
David Woodhouse
Created:
2007-07-06 01:17:12 AEST
Size:
4.20 KB
patch
obsolete
>--- openssh-4.2p1/clientloop.c~ 2005-09-04 14:09:30.000000000 +0100 >+++ openssh-4.2p1/clientloop.c 2005-09-04 15:00:09.000000000 +0100 >@@ -144,6 +144,9 @@ struct confirm_ctx { > int want_agent_fwd; > Buffer cmd; > char *term; >+ char *display; >+ char *x_proto; >+ char *x_data; > struct termios tio; > char **env; > }; >@@ -633,7 +636,6 @@ static void > client_extra_session2_setup(int id, void *arg) > { > struct confirm_ctx *cctx = arg; >- const char *display; > Channel *c; > int i; > >@@ -642,15 +644,15 @@ client_extra_session2_setup(int id, void > if ((c = channel_lookup(id)) == NULL) > fatal("%s: no channel for id %d", __func__, id); > >- display = getenv("DISPLAY"); >- if (cctx->want_x_fwd && options.forward_x11 && display != NULL) { >+ if (cctx->want_x_fwd && options.forward_x11) { > char *proto, *data; > /* Get reasonable local authentication information. */ >- client_x11_get_proto(display, options.xauth_location, >+ client_x11_get_proto(cctx->display, options.xauth_location, > options.forward_x11_trusted, &proto, &data); > /* Request forwarding with authentication spoofing. */ > debug("Requesting X11 forwarding with authentication spoofing."); >- x11_request_forwarding_with_spoofing(id, display, proto, data); >+ x11_request_forwarding_with_spoofing(id, cctx->display, >+ cctx->x_proto, cctx->x_data); > /* XXX wait for reply */ > } > >@@ -667,6 +670,11 @@ client_extra_session2_setup(int id, void > c->confirm_ctx = NULL; > buffer_free(&cctx->cmd); > xfree(cctx->term); >+ if (cctx->display) { >+ xfree(cctx->display); >+ xfree(cctx->x_proto); >+ xfree(cctx->x_data); >+ } > if (cctx->env != NULL) { > for (i = 0; cctx->env[i] != NULL; i++) > xfree(cctx->env[i]); >@@ -813,6 +819,14 @@ client_process_control(fd_set * readset) > cctx->want_subsys = (flags & SSHMUX_FLAG_SUBSYS) != 0; > cctx->want_x_fwd = (flags & SSHMUX_FLAG_X11_FWD) != 0; > cctx->want_agent_fwd = (flags & SSHMUX_FLAG_AGENT_FWD) != 0; >+ >+ if (cctx->want_x_fwd) { >+ cctx->display = buffer_get_string(&m, &len); >+ cctx->x_proto = buffer_get_string(&m, &len); >+ cctx->x_data = buffer_get_string(&m, &len); >+ debug2("%s: got X11 display %s, auth proto %s, data %s.", >+ __func__, cctx->display, cctx->x_proto, cctx->x_data); >+ } > cctx->term = buffer_get_string(&m, &len); > > cmd = buffer_get_string(&m, &len); >@@ -854,11 +866,17 @@ client_process_control(fd_set * readset) > close(new_fd[2]); > buffer_free(&m); > xfree(cctx->term); >+ if (cctx->display) { >+ xfree(cctx->display); >+ xfree(cctx->x_proto); >+ xfree(cctx->x_data); >+ } > if (env_len != 0) { > for (i = 0; i < env_len; i++) > xfree(cctx->env[i]); > xfree(cctx->env); > } >+ xfree(cctx); > return; > } > buffer_free(&m); >--- openssh-4.2p1/clientloop.h~ 2005-07-06 00:44:19.000000000 +0100 >+++ openssh-4.2p1/clientloop.h 2005-09-04 14:18:31.000000000 +0100 >@@ -44,7 +44,7 @@ void client_session2_setup(int, int, in > int, Buffer *, char **, dispatch_fn *); > > /* Multiplexing protocol version */ >-#define SSHMUX_VER 1 >+#define SSHMUX_VER 2 > > /* Multiplexing control protocol flags */ > #define SSHMUX_COMMAND_OPEN 1 /* Open new connection */ >--- openssh-4.2p1/ssh.c~ 2005-08-12 13:10:56.000000000 +0100 >+++ openssh-4.2p1/ssh.c 2005-09-04 14:45:50.000000000 +0100 >@@ -1211,6 +1211,7 @@ control_client(const char *path) > Buffer m; > char *term; > extern char **environ; >+ char *display = NULL, *x_proto, *x_data; > u_int flags; > > if (mux_command == 0) >@@ -1270,8 +1271,12 @@ control_client(const char *path) > flags |= SSHMUX_FLAG_TTY; > if (subsystem_flag) > flags |= SSHMUX_FLAG_SUBSYS; >- if (options.forward_x11) >+ if (options.forward_x11 && (display = getenv("DISPLAY")) != NULL) { >+ /* Get reasonable local authentication information. */ >+ client_x11_get_proto(display, options.xauth_location, >+ options.forward_x11_trusted, &x_proto, &x_data); > flags |= SSHMUX_FLAG_X11_FWD; >+ } > if (options.forward_agent) > flags |= SSHMUX_FLAG_AGENT_FWD; > >@@ -1311,6 +1316,11 @@ control_client(const char *path) > } > > /* SSHMUX_COMMAND_OPEN */ >+ if (display) { >+ buffer_put_cstring(&m, display); >+ buffer_put_cstring(&m, x_proto); >+ buffer_put_cstring(&m, x_data); >+ } > buffer_put_cstring(&m, term ? term : ""); > buffer_append(&command, "\0", 1); > buffer_put_cstring(&m, buffer_ptr(&command));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1328
:
1316
|
1317
|
1856
|
1857