View | Details | Raw Unified | Return to bug 1328 | Differences between
and this patch

Collapse All | Expand All

(-)openssh-4.2p1/clientloop.c~ (-5 / +26 lines)
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);
(-)openssh-4.2p1/clientloop.h~ (-1 / +1 lines)
Lines 44-50 void client_session2_setup(int, int, in Link Here
44
	    int, Buffer *, char **, dispatch_fn *);
44
	    int, Buffer *, char **, dispatch_fn *);
45
45
46
/* Multiplexing protocol version */
46
/* Multiplexing protocol version */
47
#define SSHMUX_VER			1
47
#define SSHMUX_VER			2
48
48
49
/* Multiplexing control protocol flags */
49
/* Multiplexing control protocol flags */
50
#define SSHMUX_COMMAND_OPEN		1	/* Open new connection */
50
#define SSHMUX_COMMAND_OPEN		1	/* Open new connection */
(-)openssh-4.2p1/ssh.c~ (-1 / +11 lines)
Lines 1211-1216 control_client(const char *path) Link Here
1211
	Buffer m;
1211
	Buffer m;
1212
	char *term;
1212
	char *term;
1213
	extern char **environ;
1213
	extern char **environ;
1214
	char *display = NULL, *x_proto, *x_data;
1214
	u_int  flags;
1215
	u_int  flags;
1215
1216
1216
	if (mux_command == 0)
1217
	if (mux_command == 0)
Lines 1270-1277 control_client(const char *path) Link Here
1270
		flags |= SSHMUX_FLAG_TTY;
1271
		flags |= SSHMUX_FLAG_TTY;
1271
	if (subsystem_flag)
1272
	if (subsystem_flag)
1272
		flags |= SSHMUX_FLAG_SUBSYS;
1273
		flags |= SSHMUX_FLAG_SUBSYS;
1273
	if (options.forward_x11)
1274
	if (options.forward_x11 && (display = getenv("DISPLAY")) != NULL) {
1275
		/* Get reasonable local authentication information. */
1276
		client_x11_get_proto(display, options.xauth_location,
1277
		    options.forward_x11_trusted, &x_proto, &x_data);
1274
		flags |= SSHMUX_FLAG_X11_FWD;
1278
		flags |= SSHMUX_FLAG_X11_FWD;
1279
	}
1275
	if (options.forward_agent)
1280
	if (options.forward_agent)
1276
		flags |= SSHMUX_FLAG_AGENT_FWD;
1281
		flags |= SSHMUX_FLAG_AGENT_FWD;
1277
1282
Lines 1311-1316 control_client(const char *path) Link Here
1311
	}
1316
	}
1312
1317
1313
	/* SSHMUX_COMMAND_OPEN */
1318
	/* SSHMUX_COMMAND_OPEN */
1319
	if (display) {
1320
		buffer_put_cstring(&m, display);
1321
		buffer_put_cstring(&m, x_proto);
1322
		buffer_put_cstring(&m, x_data);
1323
	}
1314
	buffer_put_cstring(&m, term ? term : "");
1324
	buffer_put_cstring(&m, term ? term : "");
1315
	buffer_append(&command, "\0", 1);
1325
	buffer_append(&command, "\0", 1);
1316
	buffer_put_cstring(&m, buffer_ptr(&command));
1326
	buffer_put_cstring(&m, buffer_ptr(&command));

Return to bug 1328