diff options
author | Colin Watson <cjwatson@debian.org> | 2016-02-29 12:15:15 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-03-08 11:51:22 +0000 |
commit | 46961f5704f8e86cea3e99253faad55aef4d8f35 (patch) | |
tree | 0dd97fa4fb649a62b4639fe2674380872b1f3e98 /mux.c | |
parent | c753fe267efb1b027424fa8706cf0385fc3d14c1 (diff) | |
parent | 85e40e87a75fb80a0bf893ac05a417d6c353537d (diff) |
New upstream release (7.2).
Diffstat (limited to 'mux.c')
-rw-r--r-- | mux.c | 34 |
1 files changed, 22 insertions, 12 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mux.c,v 1.54 2015/08/19 23:18:26 djm Exp $ */ | 1 | /* $OpenBSD: mux.c,v 1.58 2016/01/13 23:04:47 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> | 3 | * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> |
4 | * | 4 | * |
@@ -1354,16 +1354,18 @@ mux_session_confirm(int id, int success, void *arg) | |||
1354 | char *proto, *data; | 1354 | char *proto, *data; |
1355 | 1355 | ||
1356 | /* Get reasonable local authentication information. */ | 1356 | /* Get reasonable local authentication information. */ |
1357 | client_x11_get_proto(display, options.xauth_location, | 1357 | if (client_x11_get_proto(display, options.xauth_location, |
1358 | options.forward_x11_trusted, options.forward_x11_timeout, | 1358 | options.forward_x11_trusted, options.forward_x11_timeout, |
1359 | &proto, &data); | 1359 | &proto, &data) == 0) { |
1360 | /* Request forwarding with authentication spoofing. */ | 1360 | /* Request forwarding with authentication spoofing. */ |
1361 | debug("Requesting X11 forwarding with authentication " | 1361 | debug("Requesting X11 forwarding with authentication " |
1362 | "spoofing."); | 1362 | "spoofing."); |
1363 | x11_request_forwarding_with_spoofing(id, display, proto, | 1363 | x11_request_forwarding_with_spoofing(id, display, proto, |
1364 | data, 1); | 1364 | data, 1); |
1365 | client_expect_confirm(id, "X11 forwarding", CONFIRM_WARN); | 1365 | /* XXX exit_on_forward_failure */ |
1366 | /* XXX exit_on_forward_failure */ | 1366 | client_expect_confirm(id, "X11 forwarding", |
1367 | CONFIRM_WARN); | ||
1368 | } | ||
1367 | } | 1369 | } |
1368 | 1370 | ||
1369 | if (cctx->want_agent_fwd && options.forward_agent) { | 1371 | if (cctx->want_agent_fwd && options.forward_agent) { |
@@ -1744,7 +1746,7 @@ mux_client_forward(int fd, int cancel_flag, u_int ftype, struct Forward *fwd) | |||
1744 | fwd->connect_host ? fwd->connect_host : "", | 1746 | fwd->connect_host ? fwd->connect_host : "", |
1745 | fwd->connect_port); | 1747 | fwd->connect_port); |
1746 | if (muxclient_command == SSHMUX_COMMAND_FORWARD) | 1748 | if (muxclient_command == SSHMUX_COMMAND_FORWARD) |
1747 | fprintf(stdout, "%u\n", fwd->allocated_port); | 1749 | fprintf(stdout, "%i\n", fwd->allocated_port); |
1748 | break; | 1750 | break; |
1749 | case MUX_S_PERMISSION_DENIED: | 1751 | case MUX_S_PERMISSION_DENIED: |
1750 | e = buffer_get_string(&m, NULL); | 1752 | e = buffer_get_string(&m, NULL); |
@@ -1889,6 +1891,10 @@ mux_client_request_session(int fd) | |||
1889 | } | 1891 | } |
1890 | muxclient_request_id++; | 1892 | muxclient_request_id++; |
1891 | 1893 | ||
1894 | if (pledge("stdio proc tty", NULL) == -1) | ||
1895 | fatal("%s pledge(): %s", __func__, strerror(errno)); | ||
1896 | platform_pledge_mux(); | ||
1897 | |||
1892 | signal(SIGHUP, control_client_sighandler); | 1898 | signal(SIGHUP, control_client_sighandler); |
1893 | signal(SIGINT, control_client_sighandler); | 1899 | signal(SIGINT, control_client_sighandler); |
1894 | signal(SIGTERM, control_client_sighandler); | 1900 | signal(SIGTERM, control_client_sighandler); |
@@ -1996,6 +2002,10 @@ mux_client_request_stdio_fwd(int fd) | |||
1996 | mm_send_fd(fd, STDOUT_FILENO) == -1) | 2002 | mm_send_fd(fd, STDOUT_FILENO) == -1) |
1997 | fatal("%s: send fds failed", __func__); | 2003 | fatal("%s: send fds failed", __func__); |
1998 | 2004 | ||
2005 | if (pledge("stdio proc tty", NULL) == -1) | ||
2006 | fatal("%s pledge(): %s", __func__, strerror(errno)); | ||
2007 | platform_pledge_mux(); | ||
2008 | |||
1999 | debug3("%s: stdio forward request sent", __func__); | 2009 | debug3("%s: stdio forward request sent", __func__); |
2000 | 2010 | ||
2001 | /* Read their reply */ | 2011 | /* Read their reply */ |
@@ -2169,7 +2179,7 @@ muxclient(const char *path) | |||
2169 | case SSHMUX_COMMAND_ALIVE_CHECK: | 2179 | case SSHMUX_COMMAND_ALIVE_CHECK: |
2170 | if ((pid = mux_client_request_alive(sock)) == 0) | 2180 | if ((pid = mux_client_request_alive(sock)) == 0) |
2171 | fatal("%s: master alive check failed", __func__); | 2181 | fatal("%s: master alive check failed", __func__); |
2172 | fprintf(stderr, "Master running (pid=%d)\r\n", pid); | 2182 | fprintf(stderr, "Master running (pid=%u)\r\n", pid); |
2173 | exit(0); | 2183 | exit(0); |
2174 | case SSHMUX_COMMAND_TERMINATE: | 2184 | case SSHMUX_COMMAND_TERMINATE: |
2175 | mux_client_request_terminate(sock); | 2185 | mux_client_request_terminate(sock); |