|
Lines 144-149
struct confirm_ctx {
Link Here
|
| 144 |
int want_agent_fwd; |
144 |
int want_agent_fwd; |
| 145 |
Buffer cmd; |
145 |
Buffer cmd; |
| 146 |
char *term; |
146 |
char *term; |
|
|
147 |
char *display; |
| 148 |
char *x_proto; |
| 149 |
char *x_data; |
| 147 |
struct termios tio; |
150 |
struct termios tio; |
| 148 |
char **env; |
151 |
char **env; |
| 149 |
}; |
152 |
}; |
|
Lines 633-639
static void
Link Here
|
| 633 |
client_extra_session2_setup(int id, void *arg) |
636 |
client_extra_session2_setup(int id, void *arg) |
| 634 |
{ |
637 |
{ |
| 635 |
struct confirm_ctx *cctx = arg; |
638 |
struct confirm_ctx *cctx = arg; |
| 636 |
const char *display; |
|
|
| 637 |
Channel *c; |
639 |
Channel *c; |
| 638 |
int i; |
640 |
int i; |
| 639 |
|
641 |
|
|
Lines 642-656
client_extra_session2_setup(int id, void
Link Here
|
| 642 |
if ((c = channel_lookup(id)) == NULL) |
644 |
if ((c = channel_lookup(id)) == NULL) |
| 643 |
fatal("%s: no channel for id %d", __func__, id); |
645 |
fatal("%s: no channel for id %d", __func__, id); |
| 644 |
|
646 |
|
| 645 |
display = getenv("DISPLAY"); |
647 |
if (cctx->want_x_fwd && options.forward_x11) { |
| 646 |
if (cctx->want_x_fwd && options.forward_x11 && display != NULL) { |
|
|
| 647 |
char *proto, *data; |
648 |
char *proto, *data; |
| 648 |
/* Get reasonable local authentication information. */ |
649 |
/* Get reasonable local authentication information. */ |
| 649 |
client_x11_get_proto(display, options.xauth_location, |
650 |
client_x11_get_proto(cctx->display, options.xauth_location, |
| 650 |
options.forward_x11_trusted, &proto, &data); |
651 |
options.forward_x11_trusted, &proto, &data); |
| 651 |
/* Request forwarding with authentication spoofing. */ |
652 |
/* Request forwarding with authentication spoofing. */ |
| 652 |
debug("Requesting X11 forwarding with authentication spoofing."); |
653 |
debug("Requesting X11 forwarding with authentication spoofing."); |
| 653 |
x11_request_forwarding_with_spoofing(id, display, proto, data); |
654 |
x11_request_forwarding_with_spoofing(id, cctx->display, |
|
|
655 |
cctx->x_proto, cctx->x_data); |
| 654 |
/* XXX wait for reply */ |
656 |
/* XXX wait for reply */ |
| 655 |
} |
657 |
} |
| 656 |
|
658 |
|
|
Lines 667-672
client_extra_session2_setup(int id, void
Link Here
|
| 667 |
c->confirm_ctx = NULL; |
670 |
c->confirm_ctx = NULL; |
| 668 |
buffer_free(&cctx->cmd); |
671 |
buffer_free(&cctx->cmd); |
| 669 |
xfree(cctx->term); |
672 |
xfree(cctx->term); |
|
|
673 |
if (cctx->display) { |
| 674 |
xfree(cctx->display); |
| 675 |
xfree(cctx->x_proto); |
| 676 |
xfree(cctx->x_data); |
| 677 |
} |
| 670 |
if (cctx->env != NULL) { |
678 |
if (cctx->env != NULL) { |
| 671 |
for (i = 0; cctx->env[i] != NULL; i++) |
679 |
for (i = 0; cctx->env[i] != NULL; i++) |
| 672 |
xfree(cctx->env[i]); |
680 |
xfree(cctx->env[i]); |
|
Lines 813-818
client_process_control(fd_set * readset)
Link Here
|
| 813 |
cctx->want_subsys = (flags & SSHMUX_FLAG_SUBSYS) != 0; |
819 |
cctx->want_subsys = (flags & SSHMUX_FLAG_SUBSYS) != 0; |
| 814 |
cctx->want_x_fwd = (flags & SSHMUX_FLAG_X11_FWD) != 0; |
820 |
cctx->want_x_fwd = (flags & SSHMUX_FLAG_X11_FWD) != 0; |
| 815 |
cctx->want_agent_fwd = (flags & SSHMUX_FLAG_AGENT_FWD) != 0; |
821 |
cctx->want_agent_fwd = (flags & SSHMUX_FLAG_AGENT_FWD) != 0; |
|
|
822 |
|
| 823 |
if (cctx->want_x_fwd) { |
| 824 |
cctx->display = buffer_get_string(&m, &len); |
| 825 |
cctx->x_proto = buffer_get_string(&m, &len); |
| 826 |
cctx->x_data = buffer_get_string(&m, &len); |
| 827 |
debug2("%s: got X11 display %s, auth proto %s, data %s.", |
| 828 |
__func__, cctx->display, cctx->x_proto, cctx->x_data); |
| 829 |
} |
| 816 |
cctx->term = buffer_get_string(&m, &len); |
830 |
cctx->term = buffer_get_string(&m, &len); |
| 817 |
|
831 |
|
| 818 |
cmd = buffer_get_string(&m, &len); |
832 |
cmd = buffer_get_string(&m, &len); |
|
Lines 854-864
client_process_control(fd_set * readset)
Link Here
|
| 854 |
close(new_fd[2]); |
866 |
close(new_fd[2]); |
| 855 |
buffer_free(&m); |
867 |
buffer_free(&m); |
| 856 |
xfree(cctx->term); |
868 |
xfree(cctx->term); |
|
|
869 |
if (cctx->display) { |
| 870 |
xfree(cctx->display); |
| 871 |
xfree(cctx->x_proto); |
| 872 |
xfree(cctx->x_data); |
| 873 |
} |
| 857 |
if (env_len != 0) { |
874 |
if (env_len != 0) { |
| 858 |
for (i = 0; i < env_len; i++) |
875 |
for (i = 0; i < env_len; i++) |
| 859 |
xfree(cctx->env[i]); |
876 |
xfree(cctx->env[i]); |
| 860 |
xfree(cctx->env); |
877 |
xfree(cctx->env); |
| 861 |
} |
878 |
} |
|
|
879 |
xfree(cctx); |
| 862 |
return; |
880 |
return; |
| 863 |
} |
881 |
} |
| 864 |
buffer_free(&m); |
882 |
buffer_free(&m); |