Lines Matching +full:0 +full:x80000007
108 u_int muxclient_request_id = 0;
111 u_int muxclient_command = 0;
114 static volatile sig_atomic_t muxclient_terminate = 0;
117 static u_int muxserver_pid = 0;
126 #define MUX_MSG_HELLO 0x00000001
127 #define MUX_C_NEW_SESSION 0x10000002
128 #define MUX_C_ALIVE_CHECK 0x10000004
129 #define MUX_C_TERMINATE 0x10000005
130 #define MUX_C_OPEN_FWD 0x10000006
131 #define MUX_C_CLOSE_FWD 0x10000007
132 #define MUX_C_NEW_STDIO_FWD 0x10000008
133 #define MUX_C_STOP_LISTENING 0x10000009
134 #define MUX_C_PROXY 0x1000000f
135 #define MUX_S_OK 0x80000001
136 #define MUX_S_PERMISSION_DENIED 0x80000002
137 #define MUX_S_FAILURE 0x80000003
138 #define MUX_S_EXIT_MESSAGE 0x80000004
139 #define MUX_S_ALIVE 0x80000005
140 #define MUX_S_SESSION_OPENED 0x80000006
141 #define MUX_S_REMOTE_PORT 0x80000007
142 #define MUX_S_TTY_ALLOC_FAIL 0x80000008
143 #define MUX_S_PROXY 0x8000000f
186 { 0, NULL }
203 cc->ctl_child_id = 0; in mux_master_session_cleanup_cb()
204 cc->have_ctl_child_id = 0; in mux_master_session_cleanup_cb()
223 c->ctl_child_id = 0; in mux_master_control_cleanup_cb()
224 c->have_ctl_child_id = 0; in mux_master_control_cleanup_cb()
249 return 0; in env_permitted()
251 if (ret <= 0 || (size_t)ret >= sizeof(name)) { in env_permitted()
253 return 0; in env_permitted()
256 for (i = 0; i < options.num_send_env; i++) in env_permitted()
260 return 0; in env_permitted()
279 if ((r = sshbuf_get_u32(m, &ver)) != 0) { in mux_master_process_hello()
291 while (sshbuf_len(m) > 0) { in mux_master_process_hello()
293 size_t value_len = 0; in mux_master_process_hello()
295 if ((r = sshbuf_get_cstring(m, &name, NULL)) != 0 || in mux_master_process_hello()
296 (r = sshbuf_get_string_direct(m, NULL, &value_len)) != 0) { in mux_master_process_hello()
305 return 0; in mux_master_process_hello()
314 if ((r = sshbuf_put_u32(reply, MUX_S_OK)) != 0 || in reply_ok()
315 (r = sshbuf_put_u32(reply, rid)) != 0) in reply_ok()
325 if ((r = sshbuf_put_u32(reply, type)) != 0 || in reply_error()
326 (r = sshbuf_put_u32(reply, rid)) != 0 || in reply_error()
327 (r = sshbuf_put_cstring(reply, msg)) != 0) in reply_error()
347 env_len = 0; in mux_master_process_new_session()
348 if ((r = sshbuf_skip_string(m)) != 0 || /* reserved */ in mux_master_process_new_session()
349 (r = sshbuf_get_u32(m, &cctx->want_tty)) != 0 || in mux_master_process_new_session()
350 (r = sshbuf_get_u32(m, &cctx->want_x_fwd)) != 0 || in mux_master_process_new_session()
351 (r = sshbuf_get_u32(m, &cctx->want_agent_fwd)) != 0 || in mux_master_process_new_session()
352 (r = sshbuf_get_u32(m, &cctx->want_subsys)) != 0 || in mux_master_process_new_session()
353 (r = sshbuf_get_u32(m, &escape_char)) != 0 || in mux_master_process_new_session()
354 (r = sshbuf_get_cstring(m, &cctx->term, NULL)) != 0 || in mux_master_process_new_session()
355 (r = sshbuf_get_cstring(m, &cmd, NULL)) != 0) { in mux_master_process_new_session()
358 for (j = 0; j < env_len; j++) in mux_master_process_new_session()
368 while (sshbuf_len(m) > 0) { in mux_master_process_new_session()
369 if ((r = sshbuf_get_cstring(m, &cp, NULL)) != 0) in mux_master_process_new_session()
393 if ((r = sshbuf_put(cctx->cmd, cmd, strlen(cmd))) != 0) in mux_master_process_new_session()
399 for(i = 0; i < 3; i++) { in mux_master_process_new_session()
402 for (j = 0; j < i; j++) in mux_master_process_new_session()
404 for (j = 0; j < env_len; j++) in mux_master_process_new_session()
417 new_fd[0], new_fd[1], new_fd[2]); in mux_master_process_new_session()
425 close(new_fd[0]); in mux_master_process_new_session()
429 if (env_len != 0) { in mux_master_process_new_session()
430 for (i = 0; i < env_len; i++) in mux_master_process_new_session()
436 return 0; in mux_master_process_new_session()
450 if (cctx->want_tty && tcgetattr(new_fd[0], &cctx->tio) == -1) in mux_master_process_new_session()
461 new_fd[0], new_fd[1], new_fd[2], window, packetmax, in mux_master_process_new_session()
468 if (cctx->want_tty && escape_char != 0xffffffff) { in mux_master_process_new_session()
485 return 0; in mux_master_process_new_session()
497 if ((r = sshbuf_put_u32(reply, MUX_S_ALIVE)) != 0 || in mux_master_process_alive_check()
498 (r = sshbuf_put_u32(reply, rid)) != 0 || in mux_master_process_alive_check()
499 (r = sshbuf_put_u32(reply, (u_int)getpid())) != 0) in mux_master_process_alive_check()
502 return 0; in mux_master_process_alive_check()
518 return 0; in mux_master_process_terminate()
525 return 0; in mux_master_process_terminate()
570 return 0; in compare_host()
571 return strcmp(a, b) == 0; in compare_host()
578 return 0; in compare_forward()
580 return 0; in compare_forward()
582 return 0; in compare_forward()
584 return 0; in compare_forward()
586 return 0; in compare_forward()
588 return 0; in compare_forward()
623 if (rfwd->listen_port == 0) { in mux_confirm_remote_forward()
624 if ((r = sshpkt_get_u32(ssh, &port)) != 0) in mux_confirm_remote_forward()
636 MUX_S_REMOTE_PORT)) != 0 || in mux_confirm_remote_forward()
637 (r = sshbuf_put_u32(out, fctx->rid)) != 0 || in mux_confirm_remote_forward()
639 rfwd->allocated_port)) != 0) in mux_confirm_remote_forward()
648 if (rfwd->listen_port == 0) in mux_confirm_remote_forward()
666 memset(rfwd, 0, sizeof(*rfwd)); in mux_confirm_remote_forward()
673 if ((r = sshbuf_put_stringb(c->output, out)) != 0) in mux_confirm_remote_forward()
676 if (c->mux_pause <= 0) in mux_confirm_remote_forward()
678 c->mux_pause = 0; /* start processing messages again */ in mux_confirm_remote_forward()
690 int r, i, ret = 0, freefwd = 1; in mux_master_process_open_fwd()
692 memset(&fwd, 0, sizeof(fwd)); in mux_master_process_open_fwd()
695 if ((r = sshbuf_get_u32(m, &ftype)) != 0 || in mux_master_process_open_fwd()
696 (r = sshbuf_get_cstring(m, &listen_addr, NULL)) != 0 || in mux_master_process_open_fwd()
697 (r = sshbuf_get_u32(m, &lport)) != 0 || in mux_master_process_open_fwd()
698 (r = sshbuf_get_cstring(m, &connect_addr, NULL)) != 0 || in mux_master_process_open_fwd()
699 (r = sshbuf_get_u32(m, &cport)) != 0 || in mux_master_process_open_fwd()
706 if (*listen_addr == '\0') { in mux_master_process_open_fwd()
710 if (*connect_addr == '\0') { in mux_master_process_open_fwd()
715 memset(&fwd, 0, sizeof(fwd)); in mux_master_process_open_fwd()
738 return 0; in mux_master_process_open_fwd()
752 fwd.connect_port == 0)) { in mux_master_process_open_fwd()
767 for (i = 0; i < options.num_local_forwards; i++) { in mux_master_process_open_fwd()
778 for (i = 0; i < options.num_remote_forwards; i++) { in mux_master_process_open_fwd()
781 if (fwd.listen_port != 0) in mux_master_process_open_fwd()
785 MUX_S_REMOTE_PORT)) != 0 || in mux_master_process_open_fwd()
786 (r = sshbuf_put_u32(reply, rid)) != 0 || in mux_master_process_open_fwd()
788 options.remote_forwards[i].allocated_port)) != 0) in mux_master_process_open_fwd()
815 freefwd = 0; in mux_master_process_open_fwd()
820 if (fwd.handle < 0) in mux_master_process_open_fwd()
829 freefwd = 0; in mux_master_process_open_fwd()
855 int r, i, ret = 0; in mux_master_process_close_fwd()
858 memset(&fwd, 0, sizeof(fwd)); in mux_master_process_close_fwd()
860 if ((r = sshbuf_get_u32(m, &ftype)) != 0 || in mux_master_process_close_fwd()
861 (r = sshbuf_get_cstring(m, &listen_addr, NULL)) != 0 || in mux_master_process_close_fwd()
862 (r = sshbuf_get_u32(m, &lport)) != 0 || in mux_master_process_close_fwd()
863 (r = sshbuf_get_cstring(m, &connect_addr, NULL)) != 0 || in mux_master_process_close_fwd()
864 (r = sshbuf_get_u32(m, &cport)) != 0 || in mux_master_process_close_fwd()
872 if (*listen_addr == '\0') { in mux_master_process_close_fwd()
876 if (*connect_addr == '\0') { in mux_master_process_close_fwd()
881 memset(&fwd, 0, sizeof(fwd)); in mux_master_process_close_fwd()
901 for (i = 0; i < options.num_local_forwards; i++) { in mux_master_process_close_fwd()
910 for (i = 0; i < options.num_remote_forwards; i++) { in mux_master_process_close_fwd()
948 found_fwd->listen_port = found_fwd->connect_port = 0; in mux_master_process_close_fwd()
965 int ok = 0, cport, r, new_fd[2]; in mux_master_process_stdio_fwd()
968 if ((r = sshbuf_skip_string(m)) != 0 || /* reserved */ in mux_master_process_stdio_fwd()
969 (r = sshbuf_get_cstring(m, &chost, NULL)) != 0 || in mux_master_process_stdio_fwd()
970 (r = sshbuf_get_u32(m, &_cport)) != 0) { in mux_master_process_stdio_fwd()
981 error_f("invalid port 0x%x", _cport); in mux_master_process_stdio_fwd()
988 for(i = 0; i < 2; i++) { in mux_master_process_stdio_fwd()
991 for (j = 0; j < i; j++) in mux_master_process_stdio_fwd()
1002 debug3_f("got fds stdin %d, stdout %d", new_fd[0], new_fd[1]); in mux_master_process_stdio_fwd()
1010 close(new_fd[0]); in mux_master_process_stdio_fwd()
1013 return 0; in mux_master_process_stdio_fwd()
1032 nc = channel_connect_stdio_fwd(ssh, chost, cport, new_fd[0], new_fd[1], in mux_master_process_stdio_fwd()
1051 return 0; in mux_master_process_stdio_fwd()
1083 if ((r = sshbuf_put_u32(reply, MUX_S_SESSION_OPENED)) != 0 || in mux_stdio_confirm()
1084 (r = sshbuf_put_u32(reply, cctx->rid)) != 0 || in mux_stdio_confirm()
1085 (r = sshbuf_put_u32(reply, c->self)) != 0) in mux_stdio_confirm()
1090 if ((r = sshbuf_put_stringb(cc->output, reply)) != 0) in mux_stdio_confirm()
1094 if (cc->mux_pause <= 0) in mux_stdio_confirm()
1096 cc->mux_pause = 0; /* start processing messages again */ in mux_stdio_confirm()
1114 return 0; in mux_master_process_stop_listening()
1128 return 0; in mux_master_process_stop_listening()
1140 if ((r = sshbuf_put_u32(reply, MUX_S_PROXY)) != 0 || in mux_master_process_proxy()
1141 (r = sshbuf_put_u32(reply, rid)) != 0) in mux_master_process_proxy()
1144 return 0; in mux_master_process_proxy()
1164 mux_master_control_cleanup_cb, 0); in mux_master_read_cb()
1167 if ((r = sshbuf_put_u32(out, MUX_MSG_HELLO)) != 0 || in mux_master_read_cb()
1168 (r = sshbuf_put_u32(out, SSHMUX_VER)) != 0) in mux_master_read_cb()
1171 if ((r = sshbuf_put_stringb(c->output, out)) != 0) in mux_master_read_cb()
1174 ret = 0; in mux_master_read_cb()
1179 if ((r = sshbuf_froms(c->input, &in)) != 0) { in mux_master_read_cb()
1185 if ((r = sshbuf_get_u32(in, &type)) != 0) in mux_master_read_cb()
1187 debug3_f("channel %d packet type 0x%08x len %zu", c->self, in mux_master_read_cb()
1191 rid = 0; in mux_master_read_cb()
1194 error_f("expected MUX_MSG_HELLO(0x%08x), " in mux_master_read_cb()
1195 "received 0x%08x", MUX_MSG_HELLO, type); in mux_master_read_cb()
1198 if ((r = sshbuf_get_u32(in, &rid)) != 0) in mux_master_read_cb()
1202 for (i = 0; mux_master_handlers[i].handler != NULL; i++) { in mux_master_read_cb()
1210 error_f("unsupported mux message 0x%08x", type); in mux_master_read_cb()
1212 ret = 0; in mux_master_read_cb()
1215 if (sshbuf_len(out) != 0 && in mux_master_read_cb()
1216 (r = sshbuf_put_stringb(c->output, out)) != 0) in mux_master_read_cb()
1239 if ((r = sshbuf_put_u32(m, MUX_S_EXIT_MESSAGE)) != 0 || in mux_exit_message()
1240 (r = sshbuf_put_u32(m, c->self)) != 0 || in mux_exit_message()
1241 (r = sshbuf_put_u32(m, exitval)) != 0 || in mux_exit_message()
1242 (r = sshbuf_put_stringb(mux_chan->output, m)) != 0) in mux_exit_message()
1262 if ((r = sshbuf_put_u32(m, MUX_S_TTY_ALLOC_FAIL)) != 0 || in mux_tty_alloc_failed()
1263 (r = sshbuf_put_u32(m, c->self)) != 0 || in mux_tty_alloc_failed()
1264 (r = sshbuf_put_stringb(mux_chan->output, m)) != 0) in mux_tty_alloc_failed()
1291 for (i = 0; i < sizeof(rbuf) - 1; i++) { in muxserver_listen()
1295 '0' + r - 26 - 26; in muxserver_listen()
1297 rbuf[sizeof(rbuf) - 1] = '\0'; in muxserver_listen()
1303 muxserver_sock = unix_listener(options.control_path, 64, 0); in muxserver_listen()
1306 if (muxserver_sock < 0) { in muxserver_listen()
1327 if (link(options.control_path, orig_control_path) != 0) { in muxserver_listen()
1347 0, options.control_path, 1); in muxserver_listen()
1387 &proto, &data) == 0) { in mux_session_confirm()
1401 channel_request_start(ssh, id, "auth-agent-req@openssh.com", 0); in mux_session_confirm()
1402 if ((r = sshpkt_send(ssh)) != 0) in mux_session_confirm()
1411 if ((r = sshbuf_put_u32(reply, MUX_S_SESSION_OPENED)) != 0 || in mux_session_confirm()
1412 (r = sshbuf_put_u32(reply, cctx->rid)) != 0 || in mux_session_confirm()
1413 (r = sshbuf_put_u32(reply, c->self)) != 0) in mux_session_confirm()
1418 if ((r = sshbuf_put_stringb(cc->output, reply)) != 0) in mux_session_confirm()
1422 if (cc->mux_pause <= 0) in mux_session_confirm()
1424 cc->mux_pause = 0; /* start processing messages again */ in mux_session_confirm()
1429 for (i = 0; cctx->env[i] != NULL; i++) in mux_session_confirm()
1468 if ((r = sshbuf_reserve(b, need, &p)) != 0) in mux_client_read()
1470 for (have = 0; have < need; ) { in mux_client_read()
1493 if (len == 0) { in mux_client_read()
1499 return 0; in mux_client_read()
1515 if ((r = sshbuf_put_stringb(queue, m)) != 0) in mux_client_write_packet()
1521 for (have = 0; have < need; ) { in mux_client_write_packet()
1545 if (len == 0) { in mux_client_write_packet()
1553 return 0; in mux_client_write_packet()
1566 if (mux_client_read(fd, queue, 4, timeout_ms) != 0) { in mux_client_read_packet_timeout()
1575 if (mux_client_read(fd, queue, need, timeout_ms) != 0) { in mux_client_read_packet_timeout()
1582 if ((r = sshbuf_get_string_direct(queue, &ptr, &have)) != 0 || in mux_client_read_packet_timeout()
1583 (r = sshbuf_put(m, ptr, have)) != 0) in mux_client_read_packet_timeout()
1586 return 0; in mux_client_read_packet_timeout()
1604 if ((r = sshbuf_put_u32(m, MUX_MSG_HELLO)) != 0 || in mux_client_hello_exchange()
1605 (r = sshbuf_put_u32(m, SSHMUX_VER)) != 0) in mux_client_hello_exchange()
1609 if (mux_client_write_packet(fd, m) != 0) { in mux_client_hello_exchange()
1617 if (mux_client_read_packet_timeout(fd, m, timeout_ms) != 0) { in mux_client_hello_exchange()
1622 if ((r = sshbuf_get_u32(m, &type)) != 0) in mux_client_hello_exchange()
1628 if ((r = sshbuf_get_u32(m, &ver)) != 0) in mux_client_hello_exchange()
1637 while (sshbuf_len(m) > 0) { in mux_client_hello_exchange()
1640 if ((r = sshbuf_get_cstring(m, &name, NULL)) != 0 || in mux_client_hello_exchange()
1641 (r = sshbuf_skip_string(m)) != 0) { /* value */ in mux_client_hello_exchange()
1649 ret = 0; in mux_client_hello_exchange()
1667 if ((r = sshbuf_put_u32(m, MUX_C_ALIVE_CHECK)) != 0 || in mux_client_request_alive()
1668 (r = sshbuf_put_u32(m, muxclient_request_id)) != 0) in mux_client_request_alive()
1671 if (mux_client_write_packet(fd, m) != 0) in mux_client_request_alive()
1677 if (mux_client_read_packet(fd, m) != 0) { in mux_client_request_alive()
1679 return 0; in mux_client_request_alive()
1682 if ((r = sshbuf_get_u32(m, &type)) != 0) in mux_client_request_alive()
1685 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_request_alive()
1690 if ((r = sshbuf_get_u32(m, &rid)) != 0) in mux_client_request_alive()
1695 if ((r = sshbuf_get_u32(m, &pid)) != 0) in mux_client_request_alive()
1718 if ((r = sshbuf_put_u32(m, MUX_C_TERMINATE)) != 0 || in mux_client_request_terminate()
1719 (r = sshbuf_put_u32(m, muxclient_request_id)) != 0) in mux_client_request_terminate()
1722 if (mux_client_write_packet(fd, m) != 0) in mux_client_request_terminate()
1728 if (mux_client_read_packet(fd, m) != 0) { in mux_client_request_terminate()
1737 if ((r = sshbuf_get_u32(m, &type)) != 0 || in mux_client_request_terminate()
1738 (r = sshbuf_get_u32(m, &rid)) != 0) in mux_client_request_terminate()
1747 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_request_terminate()
1751 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_request_terminate()
1755 fatal_f("unexpected response from master 0x%08x", type); in mux_client_request_terminate()
1780 else if (*fwd->listen_host == '\0') in mux_client_forward()
1794 if ((r = sshbuf_put_u32(m, type)) != 0 || in mux_client_forward()
1795 (r = sshbuf_put_u32(m, muxclient_request_id)) != 0 || in mux_client_forward()
1796 (r = sshbuf_put_u32(m, ftype)) != 0 || in mux_client_forward()
1797 (r = sshbuf_put_cstring(m, lhost)) != 0 || in mux_client_forward()
1798 (r = sshbuf_put_u32(m, fwd->listen_port)) != 0 || in mux_client_forward()
1799 (r = sshbuf_put_cstring(m, chost)) != 0 || in mux_client_forward()
1800 (r = sshbuf_put_u32(m, fwd->connect_port)) != 0) in mux_client_forward()
1803 if (mux_client_write_packet(fd, m) != 0) in mux_client_forward()
1809 if (mux_client_read_packet(fd, m) != 0) { in mux_client_forward()
1814 if ((r = sshbuf_get_u32(m, &type)) != 0 || in mux_client_forward()
1815 (r = sshbuf_get_u32(m, &rid)) != 0) in mux_client_forward()
1827 if ((r = sshbuf_get_u32(m, &fwd->allocated_port)) != 0) in mux_client_forward()
1837 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_forward()
1843 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_forward()
1849 fatal_f("unexpected response from master 0x%08x", type); in mux_client_forward()
1854 return 0; in mux_client_forward()
1860 int i, ret = 0; in mux_client_forwards()
1867 for (i = 0; i < options.num_local_forwards; i++) { in mux_client_forwards()
1869 options.local_forwards[i].connect_port == 0 ? in mux_client_forwards()
1871 options.local_forwards + i) != 0) in mux_client_forwards()
1874 for (i = 0; i < options.num_remote_forwards; i++) { in mux_client_forwards()
1876 options.remote_forwards + i) != 0) in mux_client_forwards()
1890 int r, rawmode = 0; in mux_client_request_session()
1894 if ((muxserver_pid = mux_client_request_alive(fd)) == 0) { in mux_client_request_session()
1901 if (options.stdin_null && stdfd_devnull(1, 0, 0) == -1) in mux_client_request_session()
1905 options.num_setenv)) == NULL || *term == '\0') in mux_client_request_session()
1908 echar = 0xffffffff; in mux_client_request_session()
1914 if ((r = sshbuf_put_u32(m, MUX_C_NEW_SESSION)) != 0 || in mux_client_request_session()
1915 (r = sshbuf_put_u32(m, muxclient_request_id)) != 0 || in mux_client_request_session()
1916 (r = sshbuf_put_string(m, NULL, 0)) != 0 || /* reserved */ in mux_client_request_session()
1917 (r = sshbuf_put_u32(m, tty_flag)) != 0 || in mux_client_request_session()
1918 (r = sshbuf_put_u32(m, options.forward_x11)) != 0 || in mux_client_request_session()
1919 (r = sshbuf_put_u32(m, options.forward_agent)) != 0 || in mux_client_request_session()
1920 (r = sshbuf_put_u32(m, options.session_type == SESSION_TYPE_SUBSYSTEM)) != 0 || in mux_client_request_session()
1921 (r = sshbuf_put_u32(m, echar)) != 0 || in mux_client_request_session()
1922 (r = sshbuf_put_cstring(m, term == NULL ? "" : term)) != 0 || in mux_client_request_session()
1923 (r = sshbuf_put_stringb(m, command)) != 0) in mux_client_request_session()
1927 if (options.num_send_env > 0 && environ != NULL) { in mux_client_request_session()
1928 for (i = 0; environ[i] != NULL; i++) { in mux_client_request_session()
1931 if ((r = sshbuf_put_cstring(m, environ[i])) != 0) in mux_client_request_session()
1935 for (i = 0; i < options.num_setenv; i++) { in mux_client_request_session()
1936 if ((r = sshbuf_put_cstring(m, options.setenv[i])) != 0) in mux_client_request_session()
1940 if (mux_client_write_packet(fd, m) != 0) in mux_client_request_session()
1953 if (mux_client_read_packet(fd, m) != 0) { in mux_client_request_session()
1959 if ((r = sshbuf_get_u32(m, &type)) != 0 || in mux_client_request_session()
1960 (r = sshbuf_get_u32(m, &rid)) != 0) in mux_client_request_session()
1968 if ((r = sshbuf_get_u32(m, &sid)) != 0) in mux_client_request_session()
1973 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_request_session()
1979 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_request_session()
1986 error_f("unexpected response from master 0x%08x", type); in mux_client_request_session()
2017 for (exitval = 255, exitval_seen = 0;;) { in mux_client_request_session()
2019 if (mux_client_read_packet(fd, m) != 0) in mux_client_request_session()
2021 if ((r = sshbuf_get_u32(m, &type)) != 0) in mux_client_request_session()
2025 if ((r = sshbuf_get_u32(m, &esid)) != 0) in mux_client_request_session()
2032 rawmode = 0; in mux_client_request_session()
2035 if ((r = sshbuf_get_u32(m, &esid)) != 0) in mux_client_request_session()
2042 if ((r = sshbuf_get_u32(m, &exitval)) != 0) in mux_client_request_session()
2047 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_request_session()
2082 if ((r = sshbuf_put_u32(m, MUX_C_PROXY)) != 0 || in mux_client_proxy()
2083 (r = sshbuf_put_u32(m, muxclient_request_id)) != 0) in mux_client_proxy()
2085 if (mux_client_write_packet(fd, m) != 0) in mux_client_proxy()
2091 if (mux_client_read_packet(fd, m) != 0) { in mux_client_proxy()
2093 return 0; in mux_client_proxy()
2095 if ((r = sshbuf_get_u32(m, &type)) != 0 || in mux_client_proxy()
2096 (r = sshbuf_get_u32(m, &rid)) != 0) in mux_client_proxy()
2102 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_proxy()
2110 return 0; in mux_client_proxy()
2123 if ((muxserver_pid = mux_client_request_alive(fd)) == 0) { in mux_client_request_stdio_fwd()
2130 if (options.stdin_null && stdfd_devnull(1, 0, 0) == -1) in mux_client_request_stdio_fwd()
2135 if ((r = sshbuf_put_u32(m, MUX_C_NEW_STDIO_FWD)) != 0 || in mux_client_request_stdio_fwd()
2136 (r = sshbuf_put_u32(m, muxclient_request_id)) != 0 || in mux_client_request_stdio_fwd()
2137 (r = sshbuf_put_string(m, NULL, 0)) != 0 || /* reserved */ in mux_client_request_stdio_fwd()
2138 (r = sshbuf_put_cstring(m, options.stdio_forward_host)) != 0 || in mux_client_request_stdio_fwd()
2139 (r = sshbuf_put_u32(m, options.stdio_forward_port)) != 0) in mux_client_request_stdio_fwd()
2142 if (mux_client_write_packet(fd, m) != 0) in mux_client_request_stdio_fwd()
2159 if (mux_client_read_packet(fd, m) != 0) { in mux_client_request_stdio_fwd()
2165 if ((r = sshbuf_get_u32(m, &type)) != 0 || in mux_client_request_stdio_fwd()
2166 (r = sshbuf_get_u32(m, &rid)) != 0) in mux_client_request_stdio_fwd()
2173 if ((r = sshbuf_get_u32(m, &sid)) != 0) in mux_client_request_stdio_fwd()
2178 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_request_stdio_fwd()
2183 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_request_stdio_fwd()
2189 error_f("unexpected response from master 0x%08x", type); in mux_client_request_stdio_fwd()
2203 if (mux_client_read_packet(fd, m) != 0) { in mux_client_request_stdio_fwd()
2205 (errno == EINTR && muxclient_terminate != 0)) in mux_client_request_stdio_fwd()
2206 return 0; in mux_client_request_stdio_fwd()
2224 if ((r = sshbuf_put_u32(m, MUX_C_STOP_LISTENING)) != 0 || in mux_client_request_stop_listening()
2225 (r = sshbuf_put_u32(m, muxclient_request_id)) != 0) in mux_client_request_stop_listening()
2228 if (mux_client_write_packet(fd, m) != 0) in mux_client_request_stop_listening()
2234 if (mux_client_read_packet(fd, m) != 0) in mux_client_request_stop_listening()
2237 if ((r = sshbuf_get_u32(m, &type)) != 0 || in mux_client_request_stop_listening()
2238 (r = sshbuf_get_u32(m, &rid)) != 0) in mux_client_request_stop_listening()
2248 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_request_stop_listening()
2252 if ((r = sshbuf_get_cstring(m, &e, NULL)) != 0) in mux_client_request_stop_listening()
2256 fatal_f("unexpected response from master 0x%08x", type); in mux_client_request_stop_listening()
2270 if (muxclient_command == 0) { in muxclient()
2288 memset(&addr, '\0', sizeof(addr)); in muxclient()
2296 if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) == -1) in muxclient()
2324 if (timeout > 0 && timeout < INT_MAX / 1000) in muxclient()
2327 if (mux_client_hello_exchange(sock, timeout_ms) != 0) { in muxclient()
2335 if ((pid = mux_client_request_alive(sock)) == 0) in muxclient()
2338 exit(0); in muxclient()
2343 exit(0); in muxclient()
2345 if (mux_client_forwards(sock, 0) != 0) in muxclient()
2347 exit(0); in muxclient()
2349 if (mux_client_forwards(sock, 0) != 0) { in muxclient()
2357 exit(0); in muxclient()
2362 exit(0); in muxclient()
2364 if (mux_client_forwards(sock, 1) != 0) in muxclient()
2366 exit(0); in muxclient()