OpenCoverage

mux.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssh/src/mux.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17extern int tty_flag;-
18extern Options options;-
19extern int stdin_null_flag;-
20extern char *host;-
21extern int subsystem_flag;-
22extern struct sshbuf *command;-
23extern volatile sig_atomic_t quit_pending;-
24-
25-
26struct mux_session_confirm_ctx {-
27 u_int want_tty;-
28 u_int want_subsys;-
29 u_int want_x_fwd;-
30 u_int want_agent_fwd;-
31 struct sshbuf *cmd;-
32 char *term;-
33 struct termios tio;-
34 char **env;-
35 u_int rid;-
36};-
37-
38-
39struct mux_stdio_confirm_ctx {-
40 u_int rid;-
41};-
42-
43-
44struct mux_channel_confirm_ctx {-
45 u_int cid;-
46 u_int rid;-
47 int fid;-
48};-
49-
50-
51int muxserver_sock = -1;-
52-
53-
54u_int muxclient_request_id = 0;-
55-
56-
57u_int muxclient_command = 0;-
58-
59-
60static volatile sig_atomic_t muxclient_terminate = 0;-
61-
62-
63static u_int muxserver_pid = 0;-
64-
65static Channel *mux_listener_channel = -
66 ((void *)0)-
67 ;-
68-
69struct mux_master_state {-
70 int hello_rcvd;-
71};-
72static void mux_session_confirm(struct ssh *, int, int, void *);-
73static void mux_stdio_confirm(struct ssh *, int, int, void *);-
74-
75static int process_mux_master_hello(struct ssh *, u_int,-
76 Channel *, struct sshbuf *, struct sshbuf *);-
77static int process_mux_new_session(struct ssh *, u_int,-
78 Channel *, struct sshbuf *, struct sshbuf *);-
79static int process_mux_alive_check(struct ssh *, u_int,-
80 Channel *, struct sshbuf *, struct sshbuf *);-
81static int process_mux_terminate(struct ssh *, u_int,-
82 Channel *, struct sshbuf *, struct sshbuf *);-
83static int process_mux_open_fwd(struct ssh *, u_int,-
84 Channel *, struct sshbuf *, struct sshbuf *);-
85static int process_mux_close_fwd(struct ssh *, u_int,-
86 Channel *, struct sshbuf *, struct sshbuf *);-
87static int process_mux_stdio_fwd(struct ssh *, u_int,-
88 Channel *, struct sshbuf *, struct sshbuf *);-
89static int process_mux_stop_listening(struct ssh *, u_int,-
90 Channel *, struct sshbuf *, struct sshbuf *);-
91static int process_mux_proxy(struct ssh *, u_int,-
92 Channel *, struct sshbuf *, struct sshbuf *);-
93-
94static const struct {-
95 u_int type;-
96 int (*handler)(struct ssh *, u_int, Channel *,-
97 struct sshbuf *, struct sshbuf *);-
98} mux_master_handlers[] = {-
99 { 0x00000001, process_mux_master_hello },-
100 { 0x10000002, process_mux_new_session },-
101 { 0x10000004, process_mux_alive_check },-
102 { 0x10000005, process_mux_terminate },-
103 { 0x10000006, process_mux_open_fwd },-
104 { 0x10000007, process_mux_close_fwd },-
105 { 0x10000008, process_mux_stdio_fwd },-
106 { 0x10000009, process_mux_stop_listening },-
107 { 0x1000000f, process_mux_proxy },-
108 { 0, -
109 ((void *)0) -
110 }-
111};-
112-
113-
114-
115static void-
116mux_master_session_cleanup_cb(struct ssh *ssh, int cid, void *unused)-
117{-
118 Channel *cc, *c = channel_by_id(ssh, cid);-
119-
120 debug3("%s: entering for channel %d", __func__, cid);-
121 if (c ==
c == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
122 ((void *)0)
c == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
123 )-
124 fatal("%s: channel_by_id(%i) == NULL", __func__, cid);
never executed: fatal("%s: channel_by_id(%i) == NULL", __func__, cid);
0
125 if (c->ctl_chan != -1
c->ctl_chan != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
126 if ((
(cc = channel_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
cc = channel_by_id(ssh, c->ctl_chan)) ==
(cc = channel_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
127 ((void *)0)
(cc = channel_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
128 )-
129 fatal("%s: channel %d missing control channel %d",
never executed: fatal("%s: channel %d missing control channel %d", __func__, c->self, c->ctl_chan);
0
130 __func__, c->self, c->ctl_chan);
never executed: fatal("%s: channel %d missing control channel %d", __func__, c->self, c->ctl_chan);
0
131 c->ctl_chan = -1;-
132 cc->remote_id = 0;-
133 cc->have_remote_id = 0;-
134 chan_rcvd_oclose(ssh, cc);-
135 }
never executed: end of block
0
136 channel_cancel_cleanup(ssh, c->self);-
137}
never executed: end of block
0
138-
139-
140-
141static void-
142mux_master_control_cleanup_cb(struct ssh *ssh, int cid, void *unused)-
143{-
144 Channel *sc, *c = channel_by_id(ssh, cid);-
145-
146 debug3("%s: entering for channel %d", __func__, cid);-
147 if (c ==
c == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
148 ((void *)0)
c == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
149 )-
150 fatal("%s: channel_by_id(%i) == NULL", __func__, cid);
never executed: fatal("%s: channel_by_id(%i) == NULL", __func__, cid);
0
151 if (c->have_remote_id
c->have_remote_idDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
152 if ((
(sc = channel_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
sc = channel_by_id(ssh, c->remote_id)) ==
(sc = channel_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
153 ((void *)0)
(sc = channel_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
154 )-
155 fatal("%s: channel %d missing session channel %u",
never executed: fatal("%s: channel %d missing session channel %u", __func__, c->self, c->remote_id);
0
156 __func__, c->self, c->remote_id);
never executed: fatal("%s: channel %d missing session channel %u", __func__, c->self, c->remote_id);
0
157 c->remote_id = 0;-
158 c->have_remote_id = 0;-
159 sc->ctl_chan = -1;-
160 if (sc->type != 4
sc->type != 4Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
161 sc->type != 3
sc->type != 3Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
162 debug2("%s: channel %d: not open", __func__, sc->self);-
163 chan_mark_dead(ssh, sc);-
164 }
never executed: end of block
else {
0
165 if (sc->istate == 0
sc->istate == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
166 chan_read_failed(ssh, sc);
never executed: chan_read_failed(ssh, sc);
0
167 if (sc->ostate == 0
sc->ostate == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
168 chan_write_failed(ssh, sc);
never executed: chan_write_failed(ssh, sc);
0
169 }
never executed: end of block
0
170 }-
171 channel_cancel_cleanup(ssh, c->self);-
172}
never executed: end of block
0
173-
174-
175static int-
176env_permitted(char *env)-
177{-
178 int i, ret;-
179 char name[1024], *cp;-
180-
181 if ((
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
cp =
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
182 (__extension__ (__builtin_constant_p (
__builtin_constant_p ( '=' )Description
TRUEnever evaluated
FALSEnever evaluated
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
183 '='
__builtin_constant_p ( '=' )Description
TRUEnever evaluated
FALSEnever evaluated
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
184 )
__builtin_constant_p ( '=' )Description
TRUEnever evaluated
FALSEnever evaluated
&& !__builtin_constant_p (
!__builtin_constant_p ( env )Description
TRUEnever evaluated
FALSEnever evaluated
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
185 env
!__builtin_constant_p ( env )Description
TRUEnever evaluated
FALSEnever evaluated
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
186 )
!__builtin_constant_p ( env )Description
TRUEnever evaluated
FALSEnever evaluated
&& (
( '=' ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
187 '='
( '=' ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
188 ) == '\0'
( '=' ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
? (char *) __rawmemchr (
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
189 env
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
190 ,
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
191 '='
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
192 ) : __builtin_strchr (
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
193 env
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
194 ,
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
195 '='
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
196 )))
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
197 ) ==
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
198 ((void *)0)
(cp = (__exten...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
199 || cp == env
cp == envDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
200 return
never executed: return 0;
0;
never executed: return 0;
0
201 ret = snprintf(name, sizeof(name), "%.*s", (int)(cp - env), env);-
202 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(size_t)ret >= sizeof(name)Description
TRUEnever evaluated
FALSEnever evaluated
size_t)ret >= sizeof(name)
(size_t)ret >= sizeof(name)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
203 error("env_permitted: name '%.100s...' too long", env);-
204 return
never executed: return 0;
0;
never executed: return 0;
0
205 }-
206-
207 for (i = 0; i < options.num_send_env
i < options.num_send_envDescription
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
208 if (match_pattern(name, options.send_env[i])
match_pattern(...s.send_env[i])Description
TRUEnever evaluated
FALSEnever evaluated
)
0
209 return
never executed: return 1;
1;
never executed: return 1;
0
210-
211 return
never executed: return 0;
0;
never executed: return 0;
0
212}-
213-
214-
215-
216static int-
217process_mux_master_hello(struct ssh *ssh, u_int rid,-
218 Channel *c, struct sshbuf *m, struct sshbuf *reply)-
219{-
220 u_int ver;-
221 struct mux_master_state *state = (struct mux_master_state *)c->mux_ctx;-
222 int r;-
223-
224 if (state ==
state == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
225 ((void *)0)
state == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
226 )-
227 fatal("%s: channel %d: c->mux_ctx == NULL", __func__, c->self);
never executed: fatal("%s: channel %d: c->mux_ctx == NULL", __func__, c->self);
0
228 if (state->hello_rcvd
state->hello_rcvdDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
229 error("%s: HELLO received twice", __func__);-
230 return
never executed: return -1;
-1;
never executed: return -1;
0
231 }-
232 if ((
(r = sshbuf_ge...m, &ver)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &ver)) != 0
(r = sshbuf_ge...m, &ver)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
233 error("%s: malformed message: %s", __func__, ssh_err(r));-
234 return
never executed: return -1;
-1;
never executed: return -1;
0
235 }-
236 if (ver != 4
ver != 4Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
237 error("Unsupported multiplexing protocol version %d "-
238 "(expected %d)", ver, 4);-
239 return
never executed: return -1;
-1;
never executed: return -1;
0
240 }-
241 debug2("%s: channel %d slave version %u", __func__, c->self, ver);-
242-
243-
244 while (sshbuf_len(m) > 0
sshbuf_len(m) > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
245 char *name = -
246 ((void *)0)-
247 ;-
248-
249 if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &name,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
250 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
251 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
252 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_string_direct(m,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
253 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
254 ,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
255 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
256 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
257 error("%s: malformed extension: %s",-
258 __func__, ssh_err(r));-
259 return
never executed: return -1;
-1;
never executed: return -1;
0
260 }-
261 debug2("Unrecognised slave extension \"%s\"", name);-
262 free(name);-
263 }
never executed: end of block
0
264 state->hello_rcvd = 1;-
265 return
never executed: return 0;
0;
never executed: return 0;
0
266}-
267-
268-
269static void-
270reply_ok(struct sshbuf *reply, u_int rid)-
271{-
272 int r;-
273-
274 if ((
(r = sshbuf_pu...0000001)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, 0x80000001)) != 0
(r = sshbuf_pu...0000001)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
275 (
(r = sshbuf_pu...ly, rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, rid)) != 0
(r = sshbuf_pu...ly, rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
276 fatal("%s: reply: %s", __func__, ssh_err(r));
never executed: fatal("%s: reply: %s", __func__, ssh_err(r));
0
277}
never executed: end of block
0
278-
279-
280static void-
281reply_error(struct sshbuf *reply, u_int type, u_int rid, const char *msg)-
282{-
283 int r;-
284-
285 if ((
(r = sshbuf_pu...y, type)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, type)) != 0
(r = sshbuf_pu...y, type)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
286 (
(r = sshbuf_pu...ly, rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, rid)) != 0
(r = sshbuf_pu...ly, rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
287 (
(r = sshbuf_pu...ly, msg)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(reply, msg)) != 0
(r = sshbuf_pu...ly, msg)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
288 fatal("%s: reply: %s", __func__, ssh_err(r));
never executed: fatal("%s: reply: %s", __func__, ssh_err(r));
0
289}
never executed: end of block
0
290-
291static int-
292process_mux_new_session(struct ssh *ssh, u_int rid,-
293 Channel *c, struct sshbuf *m, struct sshbuf *reply)-
294{-
295 Channel *nc;-
296 struct mux_session_confirm_ctx *cctx;-
297 char *cmd, *cp;-
298 u_int i, j, env_len, escape_char, window, packetmax;-
299 int r, new_fd[3];-
300-
301-
302 cctx = xcalloc(1, sizeof(*cctx));-
303 cctx->term = -
304 ((void *)0)-
305 ;-
306 cctx->rid = rid;-
307 cmd = -
308 ((void *)0)-
309 ;-
310 cctx->env = -
311 ((void *)0)-
312 ;-
313 env_len = 0;-
314 if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_string_direct(m,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
315 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
316 ,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
317 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
318 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
319 (
(r = sshbuf_ge...ant_tty)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &cctx->want_tty)) != 0
(r = sshbuf_ge...ant_tty)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
320 (
(r = sshbuf_ge...t_x_fwd)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &cctx->want_x_fwd)) != 0
(r = sshbuf_ge...t_x_fwd)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
321 (
(r = sshbuf_ge...ent_fwd)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &cctx->want_agent_fwd)) != 0
(r = sshbuf_ge...ent_fwd)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
322 (
(r = sshbuf_ge..._subsys)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &cctx->want_subsys)) != 0
(r = sshbuf_ge..._subsys)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
323 (
(r = sshbuf_ge...pe_char)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &escape_char)) != 0
(r = sshbuf_ge...pe_char)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
324 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &cctx->term,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
325 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
326 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
327 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &cmd,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
328 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
329 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
330 malf:-
331 free(cmd);-
332 for (j = 0; j < env_len
j < env_lenDescription
TRUEnever evaluated
FALSEnever evaluated
; j++)
0
333 free(cctx->env[j]);
never executed: free(cctx->env[j]);
0
334 free(cctx->env);-
335 free(cctx->term);-
336 free(cctx);-
337 error("%s: malformed message", __func__);-
338 return
never executed: return -1;
-1;
never executed: return -1;
0
339 }-
340-
341-
342 while (sshbuf_len(m) > 0
sshbuf_len(m) > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
343 if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &cp,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
344 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
345 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
346 goto
never executed: goto malf;
malf;
never executed: goto malf;
0
347 if (!env_permitted(cp)
!env_permitted(cp)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
348 free(cp);-
349 continue;
never executed: continue;
0
350 }-
351 cctx->env = xreallocarray(cctx->env, env_len + 2,-
352 sizeof(*cctx->env));-
353 cctx->env[env_len++] = cp;-
354 cctx->env[env_len] = -
355 ((void *)0)-
356 ;-
357 if (env_len > 4096
env_len > 4096Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
358 error(">%d environment variables received, ignoring "-
359 "additional", 4096);-
360 break;
never executed: break;
0
361 }-
362 }
never executed: end of block
0
363-
364 debug2("%s: channel %d: request tty %d, X %d, agent %d, subsys %d, "-
365 "term \"%s\", cmd \"%s\", env %u", __func__, c->self,-
366 cctx->want_tty, cctx->want_x_fwd, cctx->want_agent_fwd,-
367 cctx->want_subsys, cctx->term, cmd, env_len);-
368-
369 if ((
(cctx->cmd = s...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
cctx->cmd = sshbuf_new()) ==
(cctx->cmd = s...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
370 ((void *)0)
(cctx->cmd = s...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
371 )-
372 fatal("%s: sshbuf_new", __func__);
never executed: fatal("%s: sshbuf_new", __func__);
0
373 if ((
(r = sshbuf_pu...en(cmd))) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put(cctx->cmd, cmd, strlen(cmd))) != 0
(r = sshbuf_pu...en(cmd))) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
374 fatal("%s: sshbuf_put: %s", __func__, ssh_err(r));
never executed: fatal("%s: sshbuf_put: %s", __func__, ssh_err(r));
0
375 free(cmd);-
376 cmd = -
377 ((void *)0)-
378 ;-
379-
380-
381 for(i = 0; i < 3
i < 3Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
382 if ((
(new_fd[i] = m...->sock)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
new_fd[i] = mm_receive_fd(c->sock)) == -1
(new_fd[i] = m...->sock)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
383 error("%s: failed to receive fd %d from slave",-
384 __func__, i);-
385 for (j = 0; j < i
j < iDescription
TRUEnever evaluated
FALSEnever evaluated
; j++)
0
386 close(new_fd[j]);
never executed: close(new_fd[j]);
0
387 for (j = 0; j < env_len
j < env_lenDescription
TRUEnever evaluated
FALSEnever evaluated
; j++)
0
388 free(cctx->env[j]);
never executed: free(cctx->env[j]);
0
389 free(cctx->env);-
390 free(cctx->term);-
391 sshbuf_free(cctx->cmd);-
392 free(cctx);-
393 reply_error(reply, 0x80000003, rid,-
394 "did not receive file descriptors");-
395 return
never executed: return -1;
-1;
never executed: return -1;
0
396 }-
397 }
never executed: end of block
0
398-
399 debug3("%s: got fds stdin %d, stdout %d, stderr %d", __func__,-
400 new_fd[0], new_fd[1], new_fd[2]);-
401-
402-
403 if (c->have_remote_id
c->have_remote_idDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
404 debug2("%s: session already open", __func__);-
405 reply_error(reply, 0x80000003, rid,-
406 "Multiple sessions not supported");-
407 cleanup:
code before this statement never executed: cleanup:
0
408 close(new_fd[0]);-
409 close(new_fd[1]);-
410 close(new_fd[2]);-
411 free(cctx->term);-
412 if (env_len != 0
env_len != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
413 for (i = 0; i < env_len
i < env_lenDescription
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
414 free(cctx->env[i]);
never executed: free(cctx->env[i]);
0
415 free(cctx->env);-
416 }
never executed: end of block
0
417 sshbuf_free(cctx->cmd);-
418 free(cctx);-
419 return
never executed: return 0;
0;
never executed: return 0;
0
420 }-
421-
422 if (options.control_master == 3
options.control_master == 3Description
TRUEnever evaluated
FALSEnever evaluated
||
0
423 options.control_master == 4
options.control_master == 4Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
424 if (!ask_permission("Allow shared connection to %s? ", host)
!ask_permissio...o %s? ", host)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
425 debug2("%s: session refused by user", __func__);-
426 reply_error(reply, 0x80000002, rid,-
427 "Permission denied");-
428 goto
never executed: goto cleanup;
cleanup;
never executed: goto cleanup;
0
429 }-
430 }
never executed: end of block
0
431-
432-
433 if (cctx->want_tty
cctx->want_ttyDescription
TRUEnever evaluated
FALSEnever evaluated
&& tcgetattr(new_fd[0], &cctx->tio) == -1
tcgetattr(new_...tx->tio) == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
434 error("%s: tcgetattr: %s", __func__, strerror(
never executed: error("%s: tcgetattr: %s", __func__, strerror( (*__errno_location ()) ));
0
435 (*__errno_location ())
never executed: error("%s: tcgetattr: %s", __func__, strerror( (*__errno_location ()) ));
0
436 ));
never executed: error("%s: tcgetattr: %s", __func__, strerror( (*__errno_location ()) ));
0
437-
438-
439 if (!isatty(new_fd[0])
!isatty(new_fd[0])Description
TRUEnever evaluated
FALSEnever evaluated
)
0
440 set_nonblock(new_fd[0]);
never executed: set_nonblock(new_fd[0]);
0
441 if (!isatty(new_fd[1])
!isatty(new_fd[1])Description
TRUEnever evaluated
FALSEnever evaluated
)
0
442 set_nonblock(new_fd[1]);
never executed: set_nonblock(new_fd[1]);
0
443 if (!isatty(new_fd[2])
!isatty(new_fd[2])Description
TRUEnever evaluated
FALSEnever evaluated
)
0
444 set_nonblock(new_fd[2]);
never executed: set_nonblock(new_fd[2]);
0
445-
446 window = (64*(32*1024));-
447 packetmax = (32*1024);-
448 if (cctx->want_tty
cctx->want_ttyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
449 window >>= 1;-
450 packetmax >>= 1;-
451 }
never executed: end of block
0
452-
453 nc = channel_new(ssh, "session", 3,-
454 new_fd[0], new_fd[1], new_fd[2], window, packetmax,-
455 2, "client-session", 0);-
456-
457 nc->ctl_chan = c->self;-
458 c->remote_id = nc->self;-
459 c->have_remote_id = 1;-
460-
461 if (cctx->want_tty
cctx->want_ttyDescription
TRUEnever evaluated
FALSEnever evaluated
&& escape_char != 0xffffffff
escape_char != 0xffffffffDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
462 channel_register_filter(ssh, nc->self,-
463 client_simple_escape_filter, -
464 ((void *)0)-
465 ,-
466 client_filter_cleanup,-
467 client_new_escape_filter_ctx((int)escape_char));-
468 }
never executed: end of block
0
469-
470 debug2("%s: channel_new: %d linked to control channel %d",-
471 __func__, nc->self, nc->ctl_chan);-
472-
473 channel_send_open(ssh, nc->self);-
474 channel_register_open_confirm(ssh, nc->self, mux_session_confirm, cctx);-
475 c->mux_pause = 1;-
476 channel_register_cleanup(ssh, nc->self,-
477 mux_master_session_cleanup_cb, 1);-
478-
479-
480 return
never executed: return 0;
0;
never executed: return 0;
0
481}-
482-
483static int-
484process_mux_alive_check(struct ssh *ssh, u_int rid,-
485 Channel *c, struct sshbuf *m, struct sshbuf *reply)-
486{-
487 int r;-
488-
489 debug2("%s: channel %d: alive check", __func__, c->self);-
490-
491-
492 if ((
(r = sshbuf_pu...0000005)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, 0x80000005)) != 0
(r = sshbuf_pu...0000005)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
493 (
(r = sshbuf_pu...ly, rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, rid)) != 0
(r = sshbuf_pu...ly, rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
494 (
(r = sshbuf_pu...etpid())) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, (u_int)getpid())) != 0
(r = sshbuf_pu...etpid())) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
495 fatal("%s: reply: %s", __func__, ssh_err(r));
never executed: fatal("%s: reply: %s", __func__, ssh_err(r));
0
496-
497 return
never executed: return 0;
0;
never executed: return 0;
0
498}-
499-
500static int-
501process_mux_terminate(struct ssh *ssh, u_int rid,-
502 Channel *c, struct sshbuf *m, struct sshbuf *reply)-
503{-
504 debug2("%s: channel %d: terminate request", __func__, c->self);-
505-
506 if (options.control_master == 3
options.control_master == 3Description
TRUEnever evaluated
FALSEnever evaluated
||
0
507 options.control_master == 4
options.control_master == 4Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
508 if (!ask_permission("Terminate shared connection to %s? ",
!ask_permissio...o %s? ", host)Description
TRUEnever evaluated
FALSEnever evaluated
0
509 host)
!ask_permissio...o %s? ", host)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
510 debug2("%s: termination refused by user", __func__);-
511 reply_error(reply, 0x80000002, rid,-
512 "Permission denied");-
513 return
never executed: return 0;
0;
never executed: return 0;
0
514 }-
515 }
never executed: end of block
0
516-
517 quit_pending = 1;-
518 reply_ok(reply, rid);-
519-
520 return
never executed: return 0;
0;
never executed: return 0;
0
521}-
522-
523static char *-
524format_forward(u_int ftype, struct Forward *fwd)-
525{-
526 char *ret;-
527-
528 switch (ftype) {-
529 case
never executed: case 1:
1:
never executed: case 1:
0
530 xasprintf(&ret, "local forward %.200s:%d -> %.200s:%d",-
531 (fwd->listen_path != -
532 ((void *)0)-
533 ) ? fwd->listen_path :-
534 (fwd->listen_host == -
535 ((void *)0)-
536 ) ?-
537 (options.fwd_opts.gateway_ports ? "*" : "LOCALHOST") :-
538 fwd->listen_host, fwd->listen_port,-
539 (fwd->connect_path != -
540 ((void *)0)-
541 ) ? fwd->connect_path :-
542 fwd->connect_host, fwd->connect_port);-
543 break;
never executed: break;
0
544 case
never executed: case 3:
3:
never executed: case 3:
0
545 xasprintf(&ret, "dynamic forward %.200s:%d -> *",-
546 (fwd->listen_host == -
547 ((void *)0)-
548 ) ?-
549 (options.fwd_opts.gateway_ports ? "*" : "LOCALHOST") :-
550 fwd->listen_host, fwd->listen_port);-
551 break;
never executed: break;
0
552 case
never executed: case 2:
2:
never executed: case 2:
0
553 xasprintf(&ret, "remote forward %.200s:%d -> %.200s:%d",-
554 (fwd->listen_path != -
555 ((void *)0)-
556 ) ? fwd->listen_path :-
557 (fwd->listen_host == -
558 ((void *)0)-
559 ) ?-
560 "LOCALHOST" : fwd->listen_host,-
561 fwd->listen_port,-
562 (fwd->connect_path != -
563 ((void *)0)-
564 ) ? fwd->connect_path :-
565 fwd->connect_host, fwd->connect_port);-
566 break;
never executed: break;
0
567 default
never executed: default:
:
never executed: default:
0
568 fatal("%s: unknown forward type %u", __func__, ftype);-
569 }
never executed: end of block
0
570 return
never executed: return ret;
ret;
never executed: return ret;
0
571}-
572-
573static int-
574compare_host(const char *a, const char *b)-
575{-
576 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
577 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
578 && b ==
b == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
579 ((void *)0)
b == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
580 )-
581 return
never executed: return 1;
1;
never executed: return 1;
0
582 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
583 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
584 || b ==
b == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
585 ((void *)0)
b == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
586 )-
587 return
never executed: return 0;
0;
never executed: return 0;
0
588 return
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
589 __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
590 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
591 ) && __builtin_constant_p (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
592 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
593 ) && (__s1_len = __builtin_strlen (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
594 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
595 ), __s2_len = __builtin_strlen (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
596 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
597 ), (!((size_t)(const void *)((
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
598 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
599 ) + 1) - (size_t)(const void *)(
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
600 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
601 ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
602 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
603 ) + 1) - (size_t)(const void *)(
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
604 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
605 ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
606 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
607 ,
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
608 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
609 ) : (__builtin_constant_p (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
610 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
611 ) && ((size_t)(const void *)((
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
612 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
613 ) + 1) - (size_t)(const void *)(
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
614 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
615 ) == 1) && (__s1_len = __builtin_strlen (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
616 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
617 ), __s1_len < 4) ? (__builtin_constant_p (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
618 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
619 ) && ((size_t)(const void *)((
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
620 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
621 ) + 1) - (size_t)(const void *)(
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
622 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
623 ) == 1) ? __builtin_strcmp (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
624 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
625 ,
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
626 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
627 ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
628 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
629 ); int __result = (((const unsigned char *) (const char *) (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
630 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
631 ))[0] - __s2[0]); if (__s1_len > 0
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
632 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
633 ))[1] - __s2[1]); if (__s1_len > 1
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
634 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
635 ))[2] - __s2[2]); if (__s1_len > 2
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( a ))[3] - __s2[3]);
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
636 a
never executed: __result = (((const unsigned char *) (const char *) ( a ))[3] - __s2[3]);
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
637 ))[3] - __s2[3]);
never executed: __result = (((const unsigned char *) (const char *) ( a ))[3] - __s2[3]);
}
never executed: end of block
}
never executed: end of block
__result; }))) : (__builtin_constant_p (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
638 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
639 ) && ((size_t)(const void *)((
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
640 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
641 ) + 1) - (size_t)(const void *)(
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
642 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
643 ) == 1) && (__s2_len = __builtin_strlen (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
644 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
645 ), __s2_len < 4) ? (__builtin_constant_p (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
646 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
647 ) && ((size_t)(const void *)((
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
648 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
649 ) + 1) - (size_t)(const void *)(
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
650 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
651 ) == 1) ? __builtin_strcmp (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
652 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
653 ,
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
654 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
655 ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
656 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
657 ); int __result = (((const unsigned char *) (const char *) (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
658 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
659 ))[0] - __s2[0]); if (__s2_len > 0
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
660 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
661 ))[1] - __s2[1]); if (__s2_len > 1
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
662 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
663 ))[2] - __s2[2]); if (__s2_len > 2
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]);
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
664 b
never executed: __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]);
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
665 ))[3] - __s2[3]);
never executed: __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]);
}
never executed: end of block
}
never executed: end of block
__result; }))) : __builtin_strcmp (
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
666 a
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
667 ,
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
668 b
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
669 )))); })
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
670 == 0;
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( a ) && __builtin_constant_p ( b ) && (__s1_len = __builtin_strlen ( a ), __s2_len = __builtin_strlen ( b ), (!((size_t)(const void *)(( a ) + 1) - (size_t)(const void *)( a ) == 1)...ult == 0) { __result = (((const unsigned char *) (const char *) ( b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( a , b )))); }) == 0;
0
671}-
672-
673static int-
674compare_forward(struct Forward *a, struct Forward *b)-
675{-
676 if (!compare_host(a->listen_host, b->listen_host)
!compare_host(...->listen_host)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
677 return
never executed: return 0;
0;
never executed: return 0;
0
678 if (!compare_host(a->listen_path, b->listen_path)
!compare_host(...->listen_path)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
679 return
never executed: return 0;
0;
never executed: return 0;
0
680 if (a->listen_port != b->listen_port
a->listen_port...b->listen_portDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
681 return
never executed: return 0;
0;
never executed: return 0;
0
682 if (!compare_host(a->connect_host, b->connect_host)
!compare_host(...>connect_host)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
683 return
never executed: return 0;
0;
never executed: return 0;
0
684 if (!compare_host(a->connect_path, b->connect_path)
!compare_host(...>connect_path)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
685 return
never executed: return 0;
0;
never executed: return 0;
0
686 if (a->connect_port != b->connect_port
a->connect_por...->connect_portDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
687 return
never executed: return 0;
0;
never executed: return 0;
0
688-
689 return
never executed: return 1;
1;
never executed: return 1;
0
690}-
691-
692static void-
693mux_confirm_remote_forward(struct ssh *ssh, int type, u_int32_t seq, void *ctxt)-
694{-
695 struct mux_channel_confirm_ctx *fctx = ctxt;-
696 char *failmsg = -
697 ((void *)0)-
698 ;-
699 struct Forward *rfwd;-
700 Channel *c;-
701 struct sshbuf *out;-
702 int r;-
703-
704 if ((
(c = channel_b...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
c = channel_by_id(ssh, fctx->cid)) ==
(c = channel_b...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
705 ((void *)0)
(c = channel_b...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
706 ) {-
707-
708 error("%s: unknown channel", __func__);-
709 return;
never executed: return;
0
710 }-
711 if ((
(out = sshbuf_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
out = sshbuf_new()) ==
(out = sshbuf_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
712 ((void *)0)
(out = sshbuf_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
713 )-
714 fatal("%s: sshbuf_new", __func__);
never executed: fatal("%s: sshbuf_new", __func__);
0
715 if (fctx->fid >= options.num_remote_forwards
fctx->fid >= o...emote_forwardsDescription
TRUEnever evaluated
FALSEnever evaluated
||
0
716 (options.remote_forwards[fctx->fid].connect_path ==
options.remote...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
717 ((void *)0)
options.remote...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
718 &&-
719 options.remote_forwards[fctx->fid].connect_host ==
options.remote...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
720 ((void *)0)
options.remote...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
721 )) {-
722 xasprintf(&failmsg, "unknown forwarding id %d", fctx->fid);-
723 goto
never executed: goto fail;
fail;
never executed: goto fail;
0
724 }-
725 rfwd = &options.remote_forwards[fctx->fid];-
726 debug("%s: %s for: listen %d, connect %s:%d", __func__,-
727 type == 81 ? "success" : "failure",-
728 rfwd->listen_port, rfwd->connect_path ? rfwd->connect_path :-
729 rfwd->connect_host, rfwd->connect_port);-
730 if (type == 81
type == 81Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
731 if (rfwd->listen_port == 0
rfwd->listen_port == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
732 rfwd->allocated_port = packet_get_int();-
733 debug("Allocated port %u for mux remote forward"-
734 " to %s:%d", rfwd->allocated_port,-
735 rfwd->connect_host, rfwd->connect_port);-
736 if ((
(r = sshbuf_pu...0000007)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(out,
(r = sshbuf_pu...0000007)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
737 0x80000007)) != 0
(r = sshbuf_pu...0000007)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
738 (
(r = sshbuf_pu...tx->rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(out, fctx->rid)) != 0
(r = sshbuf_pu...tx->rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
739 (
(r = sshbuf_pu...ed_port)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(out,
(r = sshbuf_pu...ed_port)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
740 rfwd->allocated_port)) != 0
(r = sshbuf_pu...ed_port)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
741 fatal("%s: reply: %s", __func__, ssh_err(r));
never executed: fatal("%s: reply: %s", __func__, ssh_err(r));
0
742 channel_update_permission(ssh, rfwd->handle,-
743 rfwd->allocated_port);-
744 }
never executed: end of block
else {
0
745 reply_ok(out, fctx->rid);-
746 }
never executed: end of block
0
747 goto
never executed: goto out;
out;
never executed: goto out;
0
748 } else {-
749 if (rfwd->listen_port == 0
rfwd->listen_port == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
750 channel_update_permission(ssh, rfwd->handle, -1);
never executed: channel_update_permission(ssh, rfwd->handle, -1);
0
751 if (rfwd->listen_path !=
rfwd->listen_p...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
752 ((void *)0)
rfwd->listen_p...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
753 )-
754 xasprintf(&failmsg, "remote port forwarding failed for "
never executed: xasprintf(&failmsg, "remote port forwarding failed for " "listen path %s", rfwd->listen_path);
0
755 "listen path %s", rfwd->listen_path);
never executed: xasprintf(&failmsg, "remote port forwarding failed for " "listen path %s", rfwd->listen_path);
0
756 else-
757 xasprintf(&failmsg, "remote port forwarding failed for "
never executed: xasprintf(&failmsg, "remote port forwarding failed for " "listen port %d", rfwd->listen_port);
0
758 "listen port %d", rfwd->listen_port);
never executed: xasprintf(&failmsg, "remote port forwarding failed for " "listen port %d", rfwd->listen_port);
0
759-
760 debug2("%s: clearing registered forwarding for listen %d, "-
761 "connect %s:%d", __func__, rfwd->listen_port,-
762 rfwd->connect_path ? rfwd->connect_path :-
763 rfwd->connect_host, rfwd->connect_port);-
764-
765 free(rfwd->listen_host);-
766 free(rfwd->listen_path);-
767 free(rfwd->connect_host);-
768 free(rfwd->connect_path);-
769 memset(rfwd, 0, sizeof(*rfwd));-
770 }
never executed: end of block
0
771 fail:
code before this statement never executed: fail:
0
772 error("%s: %s", __func__, failmsg);-
773 reply_error(out, 0x80000003, fctx->rid, failmsg);-
774 free(failmsg);-
775 out:
code before this statement never executed: out:
0
776 if ((
(r = sshbuf_pu...ut, out)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_stringb(c->output, out)) != 0
(r = sshbuf_pu...ut, out)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
777 fatal("%s: sshbuf_put_stringb: %s", __func__, ssh_err(r));
never executed: fatal("%s: sshbuf_put_stringb: %s", __func__, ssh_err(r));
0
778 sshbuf_free(out);-
779 if (c->mux_pause <= 0
c->mux_pause <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
780 fatal("%s: mux_pause %d", __func__, c->mux_pause);
never executed: fatal("%s: mux_pause %d", __func__, c->mux_pause);
0
781 c->mux_pause = 0;-
782}
never executed: end of block
0
783-
784static int-
785process_mux_open_fwd(struct ssh *ssh, u_int rid,-
786 Channel *c, struct sshbuf *m, struct sshbuf *reply)-
787{-
788 struct Forward fwd;-
789 char *fwd_desc = -
790 ((void *)0)-
791 ;-
792 char *listen_addr, *connect_addr;-
793 u_int ftype;-
794 u_int lport, cport;-
795 int r, i, ret = 0, freefwd = 1;-
796-
797 memset(&fwd, 0, sizeof(fwd));-
798-
799-
800 if ((
(r = sshbuf_ge... &ftype)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &ftype)) != 0
(r = sshbuf_ge... &ftype)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
801 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &listen_addr,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
802 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
803 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
804 (
(r = sshbuf_ge... &lport)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &lport)) != 0
(r = sshbuf_ge... &lport)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
805 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &connect_addr,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
806 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
807 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
808 (
(r = sshbuf_ge... &cport)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &cport)) != 0
(r = sshbuf_ge... &cport)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
809 (lport != (u_int)-2
lport != (u_int)-2Description
TRUEnever evaluated
FALSEnever evaluated
&& lport > 65535
lport > 65535Description
TRUEnever evaluated
FALSEnever evaluated
) ||
0
810 (cport != (u_int)-2
cport != (u_int)-2Description
TRUEnever evaluated
FALSEnever evaluated
&& cport > 65535
cport > 65535Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
811 error("%s: malformed message", __func__);-
812 ret = -1;-
813 goto
never executed: goto out;
out;
never executed: goto out;
0
814 }-
815 if (*
*listen_addr == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
listen_addr == '\0'
*listen_addr == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
816 free(listen_addr);-
817 listen_addr = -
818 ((void *)0)-
819 ;-
820 }
never executed: end of block
0
821 if (*
*connect_addr == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
connect_addr == '\0'
*connect_addr == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
822 free(connect_addr);-
823 connect_addr = -
824 ((void *)0)-
825 ;-
826 }
never executed: end of block
0
827-
828 memset(&fwd, 0, sizeof(fwd));-
829 fwd.listen_port = lport;-
830 if (fwd.listen_port == -2
fwd.listen_port == -2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
831 fwd.listen_path = listen_addr;
never executed: fwd.listen_path = listen_addr;
0
832 else-
833 fwd.listen_host = listen_addr;
never executed: fwd.listen_host = listen_addr;
0
834 fwd.connect_port = cport;-
835 if (fwd.connect_port == -2
fwd.connect_port == -2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
836 fwd.connect_path = connect_addr;
never executed: fwd.connect_path = connect_addr;
0
837 else-
838 fwd.connect_host = connect_addr;
never executed: fwd.connect_host = connect_addr;
0
839-
840 debug2("%s: channel %d: request %s", __func__, c->self,-
841 (fwd_desc = format_forward(ftype, &fwd)));-
842-
843 if (ftype != 1
ftype != 1Description
TRUEnever evaluated
FALSEnever evaluated
&& ftype != 2
ftype != 2Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
844 ftype != 3
ftype != 3Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
845 logit("%s: invalid forwarding type %u", __func__, ftype);-
846 invalid:
code before this statement never executed: invalid:
0
847 free(listen_addr);-
848 free(connect_addr);-
849 reply_error(reply, 0x80000003, rid,-
850 "Invalid forwarding request");-
851 return
never executed: return 0;
0;
never executed: return 0;
0
852 }-
853 if (ftype == 3
ftype == 3Description
TRUEnever evaluated
FALSEnever evaluated
&& fwd.listen_path
fwd.listen_pathDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
854 logit("%s: streamlocal and dynamic forwards "-
855 "are mutually exclusive", __func__);-
856 goto
never executed: goto invalid;
invalid;
never executed: goto invalid;
0
857 }-
858 if (fwd.listen_port != -2
fwd.listen_port != -2Description
TRUEnever evaluated
FALSEnever evaluated
&& fwd.listen_port >= 65536
fwd.listen_port >= 65536Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
859 logit("%s: invalid listen port %u", __func__,-
860 fwd.listen_port);-
861 goto
never executed: goto invalid;
invalid;
never executed: goto invalid;
0
862 }-
863 if ((fwd.connect_port != -2
fwd.connect_port != -2Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
864 fwd.connect_port >= 65536
fwd.connect_port >= 65536Description
TRUEnever evaluated
FALSEnever evaluated
) ||
0
865 (ftype != 3
ftype != 3Description
TRUEnever evaluated
FALSEnever evaluated
&& ftype != 2
ftype != 2Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
866 fwd.connect_port == 0
fwd.connect_port == 0Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
867 logit("%s: invalid connect port %u", __func__,-
868 fwd.connect_port);-
869 goto
never executed: goto invalid;
invalid;
never executed: goto invalid;
0
870 }-
871 if (ftype != 3
ftype != 3Description
TRUEnever evaluated
FALSEnever evaluated
&& fwd.connect_host ==
fwd.connect_ho...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
872 ((void *)0)
fwd.connect_ho...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
873 &&-
874 fwd.connect_path ==
fwd.connect_pa...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
875 ((void *)0)
fwd.connect_pa...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
876 ) {-
877 logit("%s: missing connect host", __func__);-
878 goto
never executed: goto invalid;
invalid;
never executed: goto invalid;
0
879 }-
880-
881-
882 switch (ftype) {-
883 case
never executed: case 1:
1:
never executed: case 1:
0
884 case
never executed: case 3:
3:
never executed: case 3:
0
885 for (i = 0; i < options.num_local_forwards
i < options.num_local_forwardsDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
886 if (compare_forward(&fwd,
compare_forwar..._forwards + i)Description
TRUEnever evaluated
FALSEnever evaluated
0
887 options.local_forwards + i)
compare_forwar..._forwards + i)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
888 exists:-
889 debug2("%s: found existing forwarding",-
890 __func__);-
891 reply_ok(reply, rid);-
892 goto
never executed: goto out;
out;
never executed: goto out;
0
893 }-
894 }
never executed: end of block
0
895 break;
never executed: break;
0
896 case
never executed: case 2:
2:
never executed: case 2:
0
897 for (i = 0; i < options.num_remote_forwards
i < options.nu...emote_forwardsDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
898 if (!compare_forward(&fwd, options.remote_forwards + i)
!compare_forwa..._forwards + i)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
899 continue;
never executed: continue;
0
900 if (fwd.listen_port != 0
fwd.listen_port != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
901 goto
never executed: goto exists;
exists;
never executed: goto exists;
0
902 debug2("%s: found allocated port", __func__);-
903 if ((
(r = sshbuf_pu...0000007)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply,
(r = sshbuf_pu...0000007)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
904 0x80000007)) != 0
(r = sshbuf_pu...0000007)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
905 (
(r = sshbuf_pu...ly, rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, rid)) != 0
(r = sshbuf_pu...ly, rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
906 (
(r = sshbuf_pu...ed_port)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply,
(r = sshbuf_pu...ed_port)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
907 options.remote_forwards[i].allocated_port)) != 0
(r = sshbuf_pu...ed_port)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
908 fatal("%s: reply: %s", __func__, ssh_err(r));
never executed: fatal("%s: reply: %s", __func__, ssh_err(r));
0
909 goto
never executed: goto out;
out;
never executed: goto out;
0
910 }-
911 break;
never executed: break;
0
912 }-
913-
914 if (options.control_master == 3
options.control_master == 3Description
TRUEnever evaluated
FALSEnever evaluated
||
0
915 options.control_master == 4
options.control_master == 4Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
916 if (!ask_permission("Open %s on %s?", fwd_desc, host)
!ask_permissio...wd_desc, host)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
917 debug2("%s: forwarding refused by user", __func__);-
918 reply_error(reply, 0x80000002, rid,-
919 "Permission denied");-
920 goto
never executed: goto out;
out;
never executed: goto out;
0
921 }-
922 }
never executed: end of block
0
923-
924 if (ftype == 1
ftype == 1Description
TRUEnever evaluated
FALSEnever evaluated
|| ftype == 3
ftype == 3Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
925 if (!channel_setup_local_fwd_listener(ssh, &fwd,
!channel_setup...ions.fwd_opts)Description
TRUEnever evaluated
FALSEnever evaluated
0
926 &options.fwd_opts)
!channel_setup...ions.fwd_opts)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
927 fail:-
928 logit("slave-requested %s failed", fwd_desc);-
929 reply_error(reply, 0x80000003, rid,-
930 "Port forwarding failed");-
931 goto
never executed: goto out;
out;
never executed: goto out;
0
932 }-
933 add_local_forward(&options, &fwd);-
934 freefwd = 0;-
935 }
never executed: end of block
else {
0
936 struct mux_channel_confirm_ctx *fctx;-
937-
938 fwd.handle = channel_request_remote_forwarding(ssh, &fwd);-
939 if (fwd.handle < 0
fwd.handle < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
940 goto
never executed: goto fail;
fail;
never executed: goto fail;
0
941 add_remote_forward(&options, &fwd);-
942 fctx = xcalloc(1, sizeof(*fctx));-
943 fctx->cid = c->self;-
944 fctx->rid = rid;-
945 fctx->fid = options.num_remote_forwards - 1;-
946 client_register_global_confirm(mux_confirm_remote_forward,-
947 fctx);-
948 freefwd = 0;-
949 c->mux_pause = 1;-
950-
951 goto
never executed: goto out;
out;
never executed: goto out;
0
952 }-
953 reply_ok(reply, rid);-
954 out:
code before this statement never executed: out:
0
955 free(fwd_desc);-
956 if (freefwd
freefwdDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
957 free(fwd.listen_host);-
958 free(fwd.listen_path);-
959 free(fwd.connect_host);-
960 free(fwd.connect_path);-
961 }
never executed: end of block
0
962 return
never executed: return ret;
ret;
never executed: return ret;
0
963}-
964-
965static int-
966process_mux_close_fwd(struct ssh *ssh, u_int rid,-
967 Channel *c, struct sshbuf *m, struct sshbuf *reply)-
968{-
969 struct Forward fwd, *found_fwd;-
970 char *fwd_desc = -
971 ((void *)0)-
972 ;-
973 const char *error_reason = -
974 ((void *)0)-
975 ;-
976 char *listen_addr = -
977 ((void *)0)-
978 , *connect_addr = -
979 ((void *)0)-
980 ;-
981 u_int ftype;-
982 int r, i, ret = 0;-
983 u_int lport, cport;-
984-
985 memset(&fwd, 0, sizeof(fwd));-
986-
987 if ((
(r = sshbuf_ge... &ftype)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &ftype)) != 0
(r = sshbuf_ge... &ftype)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
988 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &listen_addr,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
989 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
990 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
991 (
(r = sshbuf_ge... &lport)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &lport)) != 0
(r = sshbuf_ge... &lport)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
992 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &connect_addr,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
993 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
994 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
995 (
(r = sshbuf_ge... &cport)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &cport)) != 0
(r = sshbuf_ge... &cport)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
996 (lport != (u_int)-2
lport != (u_int)-2Description
TRUEnever evaluated
FALSEnever evaluated
&& lport > 65535
lport > 65535Description
TRUEnever evaluated
FALSEnever evaluated
) ||
0
997 (cport != (u_int)-2
cport != (u_int)-2Description
TRUEnever evaluated
FALSEnever evaluated
&& cport > 65535
cport > 65535Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
998 error("%s: malformed message", __func__);-
999 ret = -1;-
1000 goto
never executed: goto out;
out;
never executed: goto out;
0
1001 }-
1002-
1003 if (*
*listen_addr == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
listen_addr == '\0'
*listen_addr == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1004 free(listen_addr);-
1005 listen_addr = -
1006 ((void *)0)-
1007 ;-
1008 }
never executed: end of block
0
1009 if (*
*connect_addr == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
connect_addr == '\0'
*connect_addr == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1010 free(connect_addr);-
1011 connect_addr = -
1012 ((void *)0)-
1013 ;-
1014 }
never executed: end of block
0
1015-
1016 memset(&fwd, 0, sizeof(fwd));-
1017 fwd.listen_port = lport;-
1018 if (fwd.listen_port == -2
fwd.listen_port == -2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1019 fwd.listen_path = listen_addr;
never executed: fwd.listen_path = listen_addr;
0
1020 else-
1021 fwd.listen_host = listen_addr;
never executed: fwd.listen_host = listen_addr;
0
1022 fwd.connect_port = cport;-
1023 if (fwd.connect_port == -2
fwd.connect_port == -2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1024 fwd.connect_path = connect_addr;
never executed: fwd.connect_path = connect_addr;
0
1025 else-
1026 fwd.connect_host = connect_addr;
never executed: fwd.connect_host = connect_addr;
0
1027-
1028 debug2("%s: channel %d: request cancel %s", __func__, c->self,-
1029 (fwd_desc = format_forward(ftype, &fwd)));-
1030-
1031-
1032 found_fwd = -
1033 ((void *)0)-
1034 ;-
1035 switch (ftype) {-
1036 case
never executed: case 1:
1:
never executed: case 1:
0
1037 case
never executed: case 3:
3:
never executed: case 3:
0
1038 for (i = 0; i < options.num_local_forwards
i < options.num_local_forwardsDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
1039 if (compare_forward(&fwd,
compare_forwar..._forwards + i)Description
TRUEnever evaluated
FALSEnever evaluated
0
1040 options.local_forwards + i)
compare_forwar..._forwards + i)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1041 found_fwd = options.local_forwards + i;-
1042 break;
never executed: break;
0
1043 }-
1044 }
never executed: end of block
0
1045 break;
never executed: break;
0
1046 case
never executed: case 2:
2:
never executed: case 2:
0
1047 for (i = 0; i < options.num_remote_forwards
i < options.nu...emote_forwardsDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
1048 if (compare_forward(&fwd,
compare_forwar..._forwards + i)Description
TRUEnever evaluated
FALSEnever evaluated
0
1049 options.remote_forwards + i)
compare_forwar..._forwards + i)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1050 found_fwd = options.remote_forwards + i;-
1051 break;
never executed: break;
0
1052 }-
1053 }
never executed: end of block
0
1054 break;
never executed: break;
0
1055 }-
1056-
1057 if (found_fwd ==
found_fwd == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1058 ((void *)0)
found_fwd == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1059 )-
1060 error_reason = "port not forwarded";
never executed: error_reason = "port not forwarded";
0
1061 else if (ftype == 2
ftype == 2Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1062-
1063-
1064-
1065-
1066-
1067-
1068 if (channel_request_rforward_cancel(ssh, found_fwd) == -1
channel_reques...und_fwd) == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1069 error_reason = "port not in permitted opens";
never executed: error_reason = "port not in permitted opens";
0
1070 }
never executed: end of block
else {
0
1071-
1072 if (channel_cancel_lport_listener(ssh, &fwd, fwd.connect_port,
channel_cancel...wd_opts) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1073 &options.fwd_opts) == -1
channel_cancel...wd_opts) == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1074 error_reason = "port not found";
never executed: error_reason = "port not found";
0
1075 }
never executed: end of block
0
1076-
1077 if (error_reason !=
error_reason != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1078 ((void *)0)
error_reason != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1079 )-
1080 reply_error(reply, 0x80000003, rid, error_reason);
never executed: reply_error(reply, 0x80000003, rid, error_reason);
0
1081 else {-
1082 reply_ok(reply, rid);-
1083 free(found_fwd->listen_host);-
1084 free(found_fwd->listen_path);-
1085 free(found_fwd->connect_host);-
1086 free(found_fwd->connect_path);-
1087 found_fwd->listen_host = found_fwd->connect_host = -
1088 ((void *)0)-
1089 ;-
1090 found_fwd->listen_path = found_fwd->connect_path = -
1091 ((void *)0)-
1092 ;-
1093 found_fwd->listen_port = found_fwd->connect_port = 0;-
1094 }
never executed: end of block
0
1095 out:
code before this statement never executed: out:
0
1096 free(fwd_desc);-
1097 free(listen_addr);-
1098 free(connect_addr);-
1099-
1100 return
never executed: return ret;
ret;
never executed: return ret;
0
1101}-
1102-
1103static int-
1104process_mux_stdio_fwd(struct ssh *ssh, u_int rid,-
1105 Channel *c, struct sshbuf *m, struct sshbuf *reply)-
1106{-
1107 Channel *nc;-
1108 char *chost = -
1109 ((void *)0)-
1110 ;-
1111 u_int cport, i, j;-
1112 int r, new_fd[2];-
1113 struct mux_stdio_confirm_ctx *cctx;-
1114-
1115 if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_string_direct(m,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1116 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1117 ,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1118 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1119 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1120 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &chost,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1121 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1122 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1123 (
(r = sshbuf_ge... &cport)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &cport)) != 0
(r = sshbuf_ge... &cport)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1124 free(chost);-
1125 error("%s: malformed message", __func__);-
1126 return
never executed: return -1;
-1;
never executed: return -1;
0
1127 }-
1128-
1129 debug2("%s: channel %d: request stdio fwd to %s:%u",-
1130 __func__, c->self, chost, cport);-
1131-
1132-
1133 for(i = 0; i < 2
i < 2Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
1134 if ((
(new_fd[i] = m...->sock)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
new_fd[i] = mm_receive_fd(c->sock)) == -1
(new_fd[i] = m...->sock)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1135 error("%s: failed to receive fd %d from slave",-
1136 __func__, i);-
1137 for (j = 0; j < i
j < iDescription
TRUEnever evaluated
FALSEnever evaluated
; j++)
0
1138 close(new_fd[j]);
never executed: close(new_fd[j]);
0
1139 free(chost);-
1140-
1141-
1142 reply_error(reply, 0x80000003, rid,-
1143 "did not receive file descriptors");-
1144 return
never executed: return -1;
-1;
never executed: return -1;
0
1145 }-
1146 }
never executed: end of block
0
1147-
1148 debug3("%s: got fds stdin %d, stdout %d", __func__,-
1149 new_fd[0], new_fd[1]);-
1150-
1151-
1152 if (c->have_remote_id
c->have_remote_idDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1153 debug2("%s: session already open", __func__);-
1154 reply_error(reply, 0x80000003, rid,-
1155 "Multiple sessions not supported");-
1156 cleanup:
code before this statement never executed: cleanup:
0
1157 close(new_fd[0]);-
1158 close(new_fd[1]);-
1159 free(chost);-
1160 return
never executed: return 0;
0;
never executed: return 0;
0
1161 }-
1162-
1163 if (options.control_master == 3
options.control_master == 3Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1164 options.control_master == 4
options.control_master == 4Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1165 if (!ask_permission("Allow forward to %s:%u? ",
!ask_permissio... chost, cport)Description
TRUEnever evaluated
FALSEnever evaluated
0
1166 chost, cport)
!ask_permissio... chost, cport)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1167 debug2("%s: stdio fwd refused by user", __func__);-
1168 reply_error(reply, 0x80000002, rid,-
1169 "Permission denied");-
1170 goto
never executed: goto cleanup;
cleanup;
never executed: goto cleanup;
0
1171 }-
1172 }
never executed: end of block
0
1173-
1174-
1175 if (!isatty(new_fd[0])
!isatty(new_fd[0])Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1176 set_nonblock(new_fd[0]);
never executed: set_nonblock(new_fd[0]);
0
1177 if (!isatty(new_fd[1])
!isatty(new_fd[1])Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1178 set_nonblock(new_fd[1]);
never executed: set_nonblock(new_fd[1]);
0
1179-
1180 nc = channel_connect_stdio_fwd(ssh, chost, cport, new_fd[0], new_fd[1]);-
1181 free(chost);-
1182-
1183 nc->ctl_chan = c->self;-
1184 c->remote_id = nc->self;-
1185 c->have_remote_id = 1;-
1186-
1187 debug2("%s: channel_new: %d linked to control channel %d",-
1188 __func__, nc->self, nc->ctl_chan);-
1189-
1190 channel_register_cleanup(ssh, nc->self,-
1191 mux_master_session_cleanup_cb, 1);-
1192-
1193 cctx = xcalloc(1, sizeof(*cctx));-
1194 cctx->rid = rid;-
1195 channel_register_open_confirm(ssh, nc->self, mux_stdio_confirm, cctx);-
1196 c->mux_pause = 1;-
1197-
1198-
1199 return
never executed: return 0;
0;
never executed: return 0;
0
1200}-
1201-
1202-
1203static void-
1204mux_stdio_confirm(struct ssh *ssh, int id, int success, void *arg)-
1205{-
1206 struct mux_stdio_confirm_ctx *cctx = arg;-
1207 Channel *c, *cc;-
1208 struct sshbuf *reply;-
1209 int r;-
1210-
1211 if (cctx ==
cctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1212 ((void *)0)
cctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1213 )-
1214 fatal("%s: cctx == NULL", __func__);
never executed: fatal("%s: cctx == NULL", __func__);
0
1215 if ((
(c = channel_b...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
c = channel_by_id(ssh, id)) ==
(c = channel_b...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1216 ((void *)0)
(c = channel_b...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1217 )-
1218 fatal("%s: no channel for id %d", __func__, id);
never executed: fatal("%s: no channel for id %d", __func__, id);
0
1219 if ((
(cc = channel_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
cc = channel_by_id(ssh, c->ctl_chan)) ==
(cc = channel_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1220 ((void *)0)
(cc = channel_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1221 )-
1222 fatal("%s: channel %d lacks control channel %d", __func__,
never executed: fatal("%s: channel %d lacks control channel %d", __func__, id, c->ctl_chan);
0
1223 id, c->ctl_chan);
never executed: fatal("%s: channel %d lacks control channel %d", __func__, id, c->ctl_chan);
0
1224 if ((
(reply = sshbu...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
reply = sshbuf_new()) ==
(reply = sshbu...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1225 ((void *)0)
(reply = sshbu...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1226 )-
1227 fatal("%s: sshbuf_new", __func__);
never executed: fatal("%s: sshbuf_new", __func__);
0
1228-
1229 if (!success
!successDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1230 debug3("%s: sending failure reply", __func__);-
1231 reply_error(reply, 0x80000003, cctx->rid,-
1232 "Session open refused by peer");-
1233-
1234 goto
never executed: goto done;
done;
never executed: goto done;
0
1235 }-
1236-
1237 debug3("%s: sending success reply", __func__);-
1238-
1239 if ((
(r = sshbuf_pu...0000006)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, 0x80000006)) != 0
(r = sshbuf_pu...0000006)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1240 (
(r = sshbuf_pu...tx->rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, cctx->rid)) != 0
(r = sshbuf_pu...tx->rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1241 (
(r = sshbuf_pu...c->self)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, c->self)) != 0
(r = sshbuf_pu...c->self)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1242 fatal("%s: reply: %s", __func__, ssh_err(r));
never executed: fatal("%s: reply: %s", __func__, ssh_err(r));
0
1243-
1244 done:
code before this statement never executed: done:
0
1245-
1246 if ((
(r = sshbuf_pu..., reply)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_stringb(cc->output, reply)) != 0
(r = sshbuf_pu..., reply)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1247 fatal("%s: sshbuf_put_stringb: %s", __func__, ssh_err(r));
never executed: fatal("%s: sshbuf_put_stringb: %s", __func__, ssh_err(r));
0
1248 sshbuf_free(reply);-
1249-
1250 if (cc->mux_pause <= 0
cc->mux_pause <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1251 fatal("%s: mux_pause %d", __func__, cc->mux_pause);
never executed: fatal("%s: mux_pause %d", __func__, cc->mux_pause);
0
1252 cc->mux_pause = 0;-
1253 c->open_confirm_ctx = -
1254 ((void *)0)-
1255 ;-
1256 free(cctx);-
1257}
never executed: end of block
0
1258-
1259static int-
1260process_mux_stop_listening(struct ssh *ssh, u_int rid,-
1261 Channel *c, struct sshbuf *m, struct sshbuf *reply)-
1262{-
1263 debug("%s: channel %d: stop listening", __func__, c->self);-
1264-
1265 if (options.control_master == 3
options.control_master == 3Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1266 options.control_master == 4
options.control_master == 4Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1267 if (!ask_permission("Disable further multiplexing on shared "
!ask_permissio...o %s? ", host)Description
TRUEnever evaluated
FALSEnever evaluated
0
1268 "connection to %s? ", host)
!ask_permissio...o %s? ", host)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1269 debug2("%s: stop listen refused by user", __func__);-
1270 reply_error(reply, 0x80000002, rid,-
1271 "Permission denied");-
1272 return
never executed: return 0;
0;
never executed: return 0;
0
1273 }-
1274 }
never executed: end of block
0
1275-
1276 if (mux_listener_channel !=
mux_listener_c...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1277 ((void *)0)
mux_listener_c...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1278 ) {-
1279 channel_free(ssh, mux_listener_channel);-
1280 client_stop_mux();-
1281 free(options.control_path);-
1282 options.control_path = -
1283 ((void *)0)-
1284 ;-
1285 mux_listener_channel = -
1286 ((void *)0)-
1287 ;-
1288 muxserver_sock = -1;-
1289 }
never executed: end of block
0
1290-
1291 reply_ok(reply, rid);-
1292 return
never executed: return 0;
0;
never executed: return 0;
0
1293}-
1294-
1295static int-
1296process_mux_proxy(struct ssh *ssh, u_int rid,-
1297 Channel *c, struct sshbuf *m, struct sshbuf *reply)-
1298{-
1299 int r;-
1300-
1301 debug("%s: channel %d: proxy request", __func__, c->self);-
1302-
1303 c->mux_rcb = channel_proxy_downstream;-
1304 if ((
(r = sshbuf_pu...000000f)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, 0x8000000f)) != 0
(r = sshbuf_pu...000000f)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1305 (
(r = sshbuf_pu...ly, rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(reply, rid)) != 0
(r = sshbuf_pu...ly, rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1306 fatal("%s: reply: %s", __func__, ssh_err(r));
never executed: fatal("%s: reply: %s", __func__, ssh_err(r));
0
1307-
1308 return
never executed: return 0;
0;
never executed: return 0;
0
1309}-
1310-
1311-
1312static int-
1313mux_master_read_cb(struct ssh *ssh, Channel *c)-
1314{-
1315 struct mux_master_state *state = (struct mux_master_state *)c->mux_ctx;-
1316 struct sshbuf *in = -
1317 ((void *)0)-
1318 , *out = -
1319 ((void *)0)-
1320 ;-
1321 u_int type, rid, i;-
1322 int r, ret = -1;-
1323-
1324 if ((
(out = sshbuf_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
out = sshbuf_new()) ==
(out = sshbuf_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1325 ((void *)0)
(out = sshbuf_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1326 )-
1327 fatal("%s: sshbuf_new", __func__);
never executed: fatal("%s: sshbuf_new", __func__);
0
1328-
1329-
1330 if (c->mux_ctx ==
c->mux_ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1331 ((void *)0)
c->mux_ctx == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1332 ) {-
1333 state = xcalloc(1, sizeof(*state));-
1334 c->mux_ctx = state;-
1335 channel_register_cleanup(ssh, c->self,-
1336 mux_master_control_cleanup_cb, 0);-
1337-
1338-
1339 if ((
(r = sshbuf_pu...0000001)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(out, 0x00000001)) != 0
(r = sshbuf_pu...0000001)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1340 (
(r = sshbuf_pu...(out, 4)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(out, 4)) != 0
(r = sshbuf_pu...(out, 4)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1341 fatal("%s: reply: %s", __func__, ssh_err(r));
never executed: fatal("%s: reply: %s", __func__, ssh_err(r));
0
1342-
1343 if ((
(r = sshbuf_pu...ut, out)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_stringb(c->output, out)) != 0
(r = sshbuf_pu...ut, out)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1344 fatal("%s: sshbuf_put_stringb: %s",
never executed: fatal("%s: sshbuf_put_stringb: %s", __func__, ssh_err(r));
0
1345 __func__, ssh_err(r));
never executed: fatal("%s: sshbuf_put_stringb: %s", __func__, ssh_err(r));
0
1346 debug3("%s: channel %d: hello sent", __func__, c->self);-
1347 ret = 0;-
1348 goto
never executed: goto out;
out;
never executed: goto out;
0
1349 }-
1350-
1351-
1352 if ((
(r = sshbuf_fr...ut, &in)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_froms(c->input, &in)) != 0
(r = sshbuf_fr...ut, &in)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1353 malf:-
1354 error("%s: malformed message", __func__);-
1355 goto
never executed: goto out;
out;
never executed: goto out;
0
1356 }-
1357-
1358 if ((
(r = sshbuf_ge..., &type)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(in, &type)) != 0
(r = sshbuf_ge..., &type)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1359 goto
never executed: goto malf;
malf;
never executed: goto malf;
0
1360 debug3("%s: channel %d packet type 0x%08x len %zu",-
1361 __func__, c->self, type, sshbuf_len(in));-
1362-
1363 if (type == 0x00000001
type == 0x00000001Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1364 rid = 0;
never executed: rid = 0;
0
1365 else {-
1366 if (!state->hello_rcvd
!state->hello_rcvdDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1367 error("%s: expected MUX_MSG_HELLO(0x%08x), "-
1368 "received 0x%08x", __func__, 0x00000001, type);-
1369 goto
never executed: goto out;
out;
never executed: goto out;
0
1370 }-
1371 if ((
(r = sshbuf_ge...n, &rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(in, &rid)) != 0
(r = sshbuf_ge...n, &rid)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1372 goto
never executed: goto malf;
malf;
never executed: goto malf;
0
1373 }
never executed: end of block
0
1374-
1375 for (i = 0; mux_master_handlers[i].handler !=
mux_master_han...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1376 ((void *)0)
mux_master_han...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1377 ; i++) {-
1378 if (type == mux_master_handlers[i].type
type == mux_ma...ndlers[i].typeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1379 ret = mux_master_handlers[i].handler(ssh, rid,-
1380 c, in, out);-
1381 break;
never executed: break;
0
1382 }-
1383 }
never executed: end of block
0
1384 if (mux_master_handlers[i].handler ==
mux_master_han...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1385 ((void *)0)
mux_master_han...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1386 ) {-
1387 error("%s: unsupported mux message 0x%08x", __func__, type);-
1388 reply_error(out, 0x80000003, rid, "unsupported request");-
1389 ret = 0;-
1390 }
never executed: end of block
0
1391-
1392 if (sshbuf_len(out) != 0
sshbuf_len(out) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1393 if ((
(r = sshbuf_pu...ut, out)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_stringb(c->output, out)) != 0
(r = sshbuf_pu...ut, out)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1394 fatal("%s: sshbuf_put_stringb: %s",
never executed: fatal("%s: sshbuf_put_stringb: %s", __func__, ssh_err(r));
0
1395 __func__, ssh_err(r));
never executed: fatal("%s: sshbuf_put_stringb: %s", __func__, ssh_err(r));
0
1396 }
never executed: end of block
0
1397 out:
code before this statement never executed: out:
0
1398 sshbuf_free(in);-
1399 sshbuf_free(out);-
1400 return
never executed: return ret;
ret;
never executed: return ret;
0
1401}-
1402-
1403void-
1404mux_exit_message(struct ssh *ssh, Channel *c, int exitval)-
1405{-
1406 struct sshbuf *m;-
1407 Channel *mux_chan;-
1408 int r;-
1409-
1410 debug3("%s: channel %d: exit message, exitval %d", __func__, c->self,-
1411 exitval);-
1412-
1413 if ((
(mux_chan = ch...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
mux_chan = channel_by_id(ssh, c->ctl_chan)) ==
(mux_chan = ch...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1414 ((void *)0)
(mux_chan = ch...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1415 )-
1416 fatal("%s: channel %d missing mux channel %d",
never executed: fatal("%s: channel %d missing mux channel %d", __func__, c->self, c->ctl_chan);
0
1417 __func__, c->self, c->ctl_chan);
never executed: fatal("%s: channel %d missing mux channel %d", __func__, c->self, c->ctl_chan);
0
1418-
1419-
1420 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1421 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1422 )-
1423 fatal("%s: sshbuf_new", __func__);
never executed: fatal("%s: sshbuf_new", __func__);
0
1424 if ((
(r = sshbuf_pu...0000004)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, 0x80000004)) != 0
(r = sshbuf_pu...0000004)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1425 (
(r = sshbuf_pu...c->self)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, c->self)) != 0
(r = sshbuf_pu...c->self)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1426 (
(r = sshbuf_pu...exitval)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, exitval)) != 0
(r = sshbuf_pu...exitval)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1427 (
(r = sshbuf_pu...tput, m)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_stringb(mux_chan->output, m)) != 0
(r = sshbuf_pu...tput, m)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1428 fatal("%s: reply: %s", __func__, ssh_err(r));
never executed: fatal("%s: reply: %s", __func__, ssh_err(r));
0
1429 sshbuf_free(m);-
1430}
never executed: end of block
0
1431-
1432void-
1433mux_tty_alloc_failed(struct ssh *ssh, Channel *c)-
1434{-
1435 struct sshbuf *m;-
1436 Channel *mux_chan;-
1437 int r;-
1438-
1439 debug3("%s: channel %d: TTY alloc failed", __func__, c->self);-
1440-
1441 if ((
(mux_chan = ch...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
mux_chan = channel_by_id(ssh, c->ctl_chan)) ==
(mux_chan = ch...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1442 ((void *)0)
(mux_chan = ch...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1443 )-
1444 fatal("%s: channel %d missing mux channel %d",
never executed: fatal("%s: channel %d missing mux channel %d", __func__, c->self, c->ctl_chan);
0
1445 __func__, c->self, c->ctl_chan);
never executed: fatal("%s: channel %d missing mux channel %d", __func__, c->self, c->ctl_chan);
0
1446-
1447-
1448 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1449 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1450 )-
1451 fatal("%s: sshbuf_new", __func__);
never executed: fatal("%s: sshbuf_new", __func__);
0
1452 if ((
(r = sshbuf_pu...0000008)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, 0x80000008)) != 0
(r = sshbuf_pu...0000008)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1453 (
(r = sshbuf_pu...c->self)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, c->self)) != 0
(r = sshbuf_pu...c->self)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
1454 (
(r = sshbuf_pu...tput, m)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_stringb(mux_chan->output, m)) != 0
(r = sshbuf_pu...tput, m)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1455 fatal("%s: reply: %s", __func__, ssh_err(r));
never executed: fatal("%s: reply: %s", __func__, ssh_err(r));
0
1456 sshbuf_free(m);-
1457}
never executed: end of block
0
1458-
1459-
1460void-
1461muxserver_listen(struct ssh *ssh)-
1462{-
1463 mode_t old_umask;-
1464 char *orig_control_path = options.control_path;-
1465 char rbuf[16+1];-
1466 u_int i, r;-
1467 int oerrno;-
1468-
1469 if (options.control_path ==
options.contro...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1470 ((void *)0)
options.contro...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1471 ||-
1472 options.control_master == 0
options.control_master == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1473 return;
never executed: return;
0
1474-
1475 debug("setting up multiplex master socket");-
1476-
1477-
1478-
1479-
1480-
1481-
1482-
1483 for (i = 0; i < sizeof(rbuf) - 1
i < sizeof(rbuf) - 1Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
1484 r = arc4random_uniform(26+26+10);-
1485 rbuf[i] = (
(r < 26)Description
TRUEnever evaluated
FALSEnever evaluated
r < 26)
(r < 26)Description
TRUEnever evaluated
FALSEnever evaluated
? 'a' + r :
0
1486 (
(r < 26*2)Description
TRUEnever evaluated
FALSEnever evaluated
r < 26*2)
(r < 26*2)Description
TRUEnever evaluated
FALSEnever evaluated
? 'A' + r - 26 :
0
1487 '0' + r - 26 - 26;-
1488 }
never executed: end of block
0
1489 rbuf[sizeof(rbuf) - 1] = '\0';-
1490 options.control_path = -
1491 ((void *)0)-
1492 ;-
1493 xasprintf(&options.control_path, "%s.%s", orig_control_path, rbuf);-
1494 debug3("%s: temporary control path %s", __func__, options.control_path);-
1495-
1496 old_umask = umask(0177);-
1497 muxserver_sock = unix_listener(options.control_path, 64, 0);-
1498 oerrno = -
1499 (*__errno_location ())-
1500 ;-
1501 umask(old_umask);-
1502 if (muxserver_sock < 0
muxserver_sock < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1503 if (oerrno ==
oerrno == 22Description
TRUEnever evaluated
FALSEnever evaluated
0
1504 22
oerrno == 22Description
TRUEnever evaluated
FALSEnever evaluated
0
1505 || oerrno ==
oerrno == 98Description
TRUEnever evaluated
FALSEnever evaluated
0
1506 98
oerrno == 98Description
TRUEnever evaluated
FALSEnever evaluated
0
1507 ) {-
1508 error("ControlSocket %s already exists, "-
1509 "disabling multiplexing", options.control_path);-
1510 disable_mux_master:
code before this statement never executed: disable_mux_master:
0
1511 if (muxserver_sock != -1
muxserver_sock != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1512 close(muxserver_sock);-
1513 muxserver_sock = -1;-
1514 }
never executed: end of block
0
1515 free(orig_control_path);-
1516 free(options.control_path);-
1517 options.control_path = -
1518 ((void *)0)-
1519 ;-
1520 options.control_master = 0;-
1521 return;
never executed: return;
0
1522 } else {-
1523-
1524 cleanup_exit(255);-
1525 }
never executed: end of block
0
1526 }-
1527-
1528-
1529 if (link(options.control_path, orig_control_path) != 0
link(options.c...rol_path) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1530 if (-
1531 (*
(*__errno_location ()) != 17Description
TRUEnever evaluated
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) != 17Description
TRUEnever evaluated
FALSEnever evaluated
0
1532 !=
(*__errno_location ()) != 17Description
TRUEnever evaluated
FALSEnever evaluated
0
1533 17
(*__errno_location ()) != 17Description
TRUEnever evaluated
FALSEnever evaluated
0
1534 ) {-
1535 fatal("%s: link mux listener %s => %s: %s", __func__,-
1536 options.control_path, orig_control_path,-
1537 strerror(-
1538 (*__errno_location ())-