Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | extern ServerOptions options; | - |
17 | | - |
18 | | - |
19 | extern Authctxt *the_authctxt; | - |
20 | extern struct sshauthopt *auth_opts; | - |
21 | extern int use_privsep; | - |
22 | | - |
23 | static int no_more_sessions = 0; | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | static volatile sig_atomic_t child_terminated = 0; | - |
31 | | - |
32 | | - |
33 | static volatile sig_atomic_t received_sigterm = 0; | - |
34 | | - |
35 | | - |
36 | static void server_init_dispatch(void); | - |
37 | | - |
38 | | - |
39 | char *tun_fwd_ifnames = | - |
40 | ((void *)0) | - |
41 | ; | - |
42 | | - |
43 | | - |
44 | static int | - |
45 | bind_permitted(int port, uid_t uid) | - |
46 | { | - |
47 | if (use_privsepTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
48 | return never executed: return 1; 1;never executed: return 1; | 0 |
49 | if (port < TRUE | never evaluated | FALSE | never evaluated |
| 0 |
50 | 1024TRUE | never evaluated | FALSE | never evaluated |
| 0 |
51 | && uid != 0TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
52 | return never executed: return 0; 0;never executed: return 0; | 0 |
53 | return never executed: return 1; 1;never executed: return 1; | 0 |
54 | } | - |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | static int notify_pipe[2]; | - |
61 | static void | - |
62 | notify_setup(void) | - |
63 | { | - |
64 | if (pipe(notify_pipe) < 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
65 | error("pipe(notify_pipe) failed %s", strerror( | - |
66 | (*__errno_location ()) | - |
67 | )); | - |
68 | } never executed: end of block else if ((TRUE | never evaluated | FALSE | never evaluated |
fcntl(notify_pipe[0], TRUE | never evaluated | FALSE | never evaluated |
| 0 |
69 | 2TRUE | never evaluated | FALSE | never evaluated |
| 0 |
70 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
71 | 1TRUE | never evaluated | FALSE | never evaluated |
| 0 |
72 | ) == -1)TRUE | never evaluated | FALSE | never evaluated |
|| | 0 |
73 | (TRUE | never evaluated | FALSE | never evaluated |
fcntl(notify_pipe[1], TRUE | never evaluated | FALSE | never evaluated |
| 0 |
74 | 2TRUE | never evaluated | FALSE | never evaluated |
| 0 |
75 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
76 | 1TRUE | never evaluated | FALSE | never evaluated |
| 0 |
77 | ) == -1)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
78 | error("fcntl(notify_pipe, F_SETFD) failed %s", strerror( | - |
79 | (*__errno_location ()) | - |
80 | )); | - |
81 | close(notify_pipe[0]); | - |
82 | close(notify_pipe[1]); | - |
83 | } never executed: end of block else { | 0 |
84 | set_nonblock(notify_pipe[0]); | - |
85 | set_nonblock(notify_pipe[1]); | - |
86 | return; never executed: return; | 0 |
87 | } | - |
88 | notify_pipe[0] = -1; | - |
89 | notify_pipe[1] = -1; | - |
90 | } never executed: end of block | 0 |
91 | static void | - |
92 | notify_parent(void) | - |
93 | { | - |
94 | if (notify_pipe[1] != -1TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
95 | ( never executed: (void)write(notify_pipe[1], "", 1); void)write(notify_pipe[1], "", 1);never executed: (void)write(notify_pipe[1], "", 1); | 0 |
96 | } never executed: end of block | 0 |
97 | static void | - |
98 | notify_prepare(fd_set *readset) | - |
99 | { | - |
100 | if (notify_pipe[0] != -1TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
101 | kludge_FD_SET(notify_pipe[0], readset); never executed: kludge_FD_SET(notify_pipe[0], readset); | 0 |
102 | } never executed: end of block | 0 |
103 | static void | - |
104 | notify_done(fd_set *readset) | - |
105 | { | - |
106 | char c; | - |
107 | | - |
108 | if (notify_pipe[0] != -1TRUE | never evaluated | FALSE | never evaluated |
&& kludge_FD_ISSET(notify_pipe[0], readset)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
109 | while (read(notify_pipe[0], &c, 1) != -1TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
110 | debug2("%s: reading", __func__); never executed: debug2("%s: reading", __func__); | 0 |
111 | } never executed: end of block | 0 |
112 | | - |
113 | | - |
114 | static void | - |
115 | sigchld_handler(int sig) | - |
116 | { | - |
117 | int save_errno = | - |
118 | (*__errno_location ()) | - |
119 | ; | - |
120 | child_terminated = 1; | - |
121 | notify_parent(); | - |
122 | | - |
123 | (*__errno_location ()) | - |
124 | = save_errno; | - |
125 | } never executed: end of block | 0 |
126 | | - |
127 | | - |
128 | static void | - |
129 | sigterm_handler(int sig) | - |
130 | { | - |
131 | received_sigterm = sig; | - |
132 | } never executed: end of block | 0 |
133 | | - |
134 | static void | - |
135 | client_alive_check(struct ssh *ssh) | - |
136 | { | - |
137 | int channel_id; | - |
138 | char remote_id[512]; | - |
139 | | - |
140 | | - |
141 | if (ssh_packet_inc_alive_timeouts(active_state) > options.client_alive_count_maxTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
142 | sshpkt_fmt_connection_id(ssh, remote_id, sizeof(remote_id)); | - |
143 | logit("Timeout, client not responding from %s", remote_id); | - |
144 | cleanup_exit(255); | - |
145 | } never executed: end of block | 0 |
146 | | - |
147 | | - |
148 | | - |
149 | | - |
150 | | - |
151 | if ((TRUE | never evaluated | FALSE | never evaluated |
channel_id = channel_find_open(ssh)) == -1TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
152 | ssh_packet_start(active_state, (80)); | - |
153 | ssh_packet_put_cstring(active_state, ("keepalive@openssh.com")); | - |
154 | ssh_packet_put_char(active_state, (1)); | - |
155 | } never executed: end of block else { | 0 |
156 | channel_request_start(ssh, channel_id, | - |
157 | "keepalive@openssh.com", 1); | - |
158 | } never executed: end of block | 0 |
159 | ssh_packet_send(active_state); | - |
160 | } never executed: end of block | 0 |
161 | | - |
162 | | - |
163 | | - |
164 | | - |
165 | | - |
166 | | - |
167 | | - |
168 | static void | - |
169 | wait_until_can_do_something(struct ssh *ssh, | - |
170 | int connection_in, int connection_out, | - |
171 | fd_set **readsetp, fd_set **writesetp, int *maxfdp, | - |
172 | u_int *nallocp, u_int64_t max_time_ms) | - |
173 | { | - |
174 | struct timeval tv, *tvp; | - |
175 | int ret; | - |
176 | time_t minwait_secs = 0; | - |
177 | int client_alive_scheduled = 0; | - |
178 | static time_t last_client_time; | - |
179 | | - |
180 | | - |
181 | channel_prepare_select(ssh, readsetp, writesetp, maxfdp, | - |
182 | nallocp, &minwait_secs); | - |
183 | | - |
184 | | - |
185 | if (minwait_secs != 0TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
186 | max_time_ms = (((TRUE | never evaluated | FALSE | never evaluated |
max_time_ms) < ((u_int)minwait_secs * 1000))TRUE | never evaluated | FALSE | never evaluated |
? (max_time_ms) : ((u_int)minwait_secs * 1000));never executed: max_time_ms = (((max_time_ms) < ((u_int)minwait_secs * 1000)) ? (max_time_ms) : ((u_int)minwait_secs * 1000)); | 0 |
187 | if (options.client_alive_intervalTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
188 | uint64_t keepalive_ms = | - |
189 | (uint64_t)options.client_alive_interval * 1000; | - |
190 | | - |
191 | client_alive_scheduled = 1; | - |
192 | if (max_time_ms == 0TRUE | never evaluated | FALSE | never evaluated |
|| max_time_ms > keepalive_msTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
193 | max_time_ms = keepalive_ms; never executed: max_time_ms = keepalive_ms; | 0 |
194 | } never executed: end of block | 0 |
195 | | - |
196 | | - |
197 | | - |
198 | | - |
199 | | - |
200 | kludge_FD_SET(connection_in, *readsetp); | - |
201 | notify_prepare(*readsetp); | - |
202 | | - |
203 | | - |
204 | | - |
205 | | - |
206 | | - |
207 | if (ssh_packet_have_data_to_write(active_state)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
208 | kludge_FD_SET(connection_out, *writesetp); never executed: kludge_FD_SET(connection_out, *writesetp); | 0 |
209 | | - |
210 | | - |
211 | | - |
212 | | - |
213 | | - |
214 | if (child_terminatedTRUE | never evaluated | FALSE | never evaluated |
&& ssh_packet_not_very_much_data_to_write(active_state)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
215 | if (max_time_ms == 0TRUE | never evaluated | FALSE | never evaluated |
|| client_alive_scheduledTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
216 | max_time_ms = 100; never executed: max_time_ms = 100; | 0 |
217 | | - |
218 | if (max_time_ms == 0TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
219 | tvp = never executed: tvp = ((void *)0) ; | 0 |
220 | ((void *)0) never executed: tvp = ((void *)0) ; | 0 |
221 | ; never executed: tvp = ((void *)0) ; | 0 |
222 | else { | - |
223 | tv.tv_sec = max_time_ms / 1000; | - |
224 | tv.tv_usec = 1000 * (max_time_ms % 1000); | - |
225 | tvp = &tv; | - |
226 | } never executed: end of block | 0 |
227 | | - |
228 | | - |
229 | ret = select((*maxfdp)+1, *readsetp, *writesetp, | - |
230 | ((void *)0) | - |
231 | , tvp); | - |
232 | | - |
233 | if (ret == -1TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
234 | memset(*readsetp, 0, *nallocp); | - |
235 | memset(*writesetp, 0, *nallocp); | - |
236 | if ( | - |
237 | (*TRUE | never evaluated | FALSE | never evaluated |
__errno_location ()) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
238 | != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
239 | 4TRUE | never evaluated | FALSE | never evaluated |
| 0 |
240 | ) | - |
241 | error("select: %.100s", strerror( never executed: error("select: %.100s", strerror( (*__errno_location ()) )); | 0 |
242 | (*__errno_location ()) never executed: error("select: %.100s", strerror( (*__errno_location ()) )); | 0 |
243 | )); never executed: error("select: %.100s", strerror( (*__errno_location ()) )); | 0 |
244 | } never executed: end of block else if (client_alive_scheduledTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
245 | time_t now = monotime(); | - |
246 | | - |
247 | if (ret == 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
248 | client_alive_check(ssh); | - |
249 | } never executed: end of block else if (kludge_FD_ISSET(connection_in, *readsetp)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
250 | last_client_time = now; | - |
251 | } never executed: end of block else if (last_client_time != 0TRUE | never evaluated | FALSE | never evaluated |
&& last_client_time +TRUE | never evaluated | FALSE | never evaluated |
| 0 |
252 | options.client_alive_interval <= nowTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
253 | client_alive_check(ssh); | - |
254 | last_client_time = now; | - |
255 | } never executed: end of block | 0 |
256 | } never executed: end of block | 0 |
257 | | - |
258 | notify_done(*readsetp); | - |
259 | } never executed: end of block | 0 |
260 | | - |
261 | | - |
262 | | - |
263 | | - |
264 | | - |
265 | static int | - |
266 | process_input(struct ssh *ssh, fd_set *readset, int connection_in) | - |
267 | { | - |
268 | int len; | - |
269 | char buf[16384]; | - |
270 | | - |
271 | | - |
272 | if (kludge_FD_ISSET(connection_in, readset)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
273 | len = read(connection_in, buf, sizeof(buf)); | - |
274 | if (len == 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
275 | verbose("Connection closed by %.100s port %d", | - |
276 | ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); | - |
277 | return never executed: return -1; -1;never executed: return -1; | 0 |
278 | } else if (len < 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
279 | if ( | - |
280 | (*TRUE | never evaluated | FALSE | never evaluated |
__errno_location ()) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
281 | != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
282 | 4TRUE | never evaluated | FALSE | never evaluated |
| 0 |
283 | && | - |
284 | (*TRUE | never evaluated | FALSE | never evaluated |
__errno_location ()) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
285 | != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
286 | 11TRUE | never evaluated | FALSE | never evaluated |
| 0 |
287 | && | - |
288 | | - |
289 | (*TRUE | never evaluated | FALSE | never evaluated |
__errno_location ()) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
290 | != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
291 | 11TRUE | never evaluated | FALSE | never evaluated |
| 0 |
292 | ) { | - |
293 | verbose("Read error from remote host " | - |
294 | "%.100s port %d: %.100s", | - |
295 | ssh_remote_ipaddr(ssh), | - |
296 | ssh_remote_port(ssh), strerror( | - |
297 | (*__errno_location ()) | - |
298 | )); | - |
299 | cleanup_exit(255); | - |
300 | } never executed: end of block | 0 |
301 | } never executed: end of block else { | 0 |
302 | | - |
303 | packet_process_incoming(buf, len); | - |
304 | } never executed: end of block | 0 |
305 | } | - |
306 | return never executed: return 0; 0;never executed: return 0; | 0 |
307 | } | - |
308 | | - |
309 | | - |
310 | | - |
311 | | - |
312 | static void | - |
313 | process_output(fd_set *writeset, int connection_out) | - |
314 | { | - |
315 | | - |
316 | if (kludge_FD_ISSET(connection_out, writeset)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
317 | packet_write_poll(); never executed: packet_write_poll(); | 0 |
318 | } never executed: end of block | 0 |
319 | | - |
320 | static void | - |
321 | process_buffered_input_packets(struct ssh *ssh) | - |
322 | { | - |
323 | ssh_dispatch_run_fatal(ssh, DISPATCH_NONBLOCK, | - |
324 | ((void *)0) | - |
325 | ); | - |
326 | } never executed: end of block | 0 |
327 | | - |
328 | static void | - |
329 | collect_children(struct ssh *ssh) | - |
330 | { | - |
331 | pid_t pid; | - |
332 | sigset_t oset, nset; | - |
333 | int status; | - |
334 | | - |
335 | | - |
336 | sigemptyset(&nset); | - |
337 | sigaddset(&nset, | - |
338 | 17 | - |
339 | ); | - |
340 | sigprocmask( | - |
341 | 0 | - |
342 | , &nset, &oset); | - |
343 | if (child_terminatedTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
344 | debug("Received SIGCHLD."); | - |
345 | while ((TRUE | never evaluated | FALSE | never evaluated |
pid = waitpid(-1, &status, TRUE | never evaluated | FALSE | never evaluated |
| 0 |
346 | 1TRUE | never evaluated | FALSE | never evaluated |
| 0 |
347 | )) > 0TRUE | never evaluated | FALSE | never evaluated |
|| | 0 |
348 | (pid < 0TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
349 | (*TRUE | never evaluated | FALSE | never evaluated |
__errno_location ()) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
350 | == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
351 | 4TRUE | never evaluated | FALSE | never evaluated |
| 0 |
352 | )) | - |
353 | if (pid > 0TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
354 | session_close_by_pid(ssh, pid, status); never executed: session_close_by_pid(ssh, pid, status); | 0 |
355 | child_terminated = 0; | - |
356 | } never executed: end of block | 0 |
357 | sigprocmask( | - |
358 | 2 | - |
359 | , &oset, | - |
360 | ((void *)0) | - |
361 | ); | - |
362 | } never executed: end of block | 0 |
363 | | - |
364 | void | - |
365 | server_loop2(struct ssh *ssh, Authctxt *authctxt) | - |
366 | { | - |
367 | fd_set *readset = | - |
368 | ((void *)0) | - |
369 | , *writeset = | - |
370 | ((void *)0) | - |
371 | ; | - |
372 | int max_fd; | - |
373 | u_int nalloc = 0, connection_in, connection_out; | - |
374 | u_int64_t rekey_timeout_ms = 0; | - |
375 | | - |
376 | debug("Entering interactive session for SSH2."); | - |
377 | | - |
378 | mysignal( | - |
379 | 17 | - |
380 | ,sigchld_handler); | - |
381 | child_terminated = 0; | - |
382 | connection_in = ssh_packet_get_connection_in(active_state); | - |
383 | connection_out = ssh_packet_get_connection_out(active_state); | - |
384 | | - |
385 | if (!use_privsepTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
386 | mysignal( | - |
387 | 15 | - |
388 | ,sigterm_handler); | - |
389 | mysignal( | - |
390 | 2 | - |
391 | ,sigterm_handler); | - |
392 | mysignal( | - |
393 | 3 | - |
394 | ,sigterm_handler); | - |
395 | } never executed: end of block | 0 |
396 | | - |
397 | notify_setup(); | - |
398 | | - |
399 | max_fd = (((TRUE | never evaluated | FALSE | never evaluated |
connection_in) > (connection_out))TRUE | never evaluated | FALSE | never evaluated |
? (connection_in) : (connection_out)); | 0 |
400 | max_fd = (((TRUE | never evaluated | FALSE | never evaluated |
max_fd) > (notify_pipe[0]))TRUE | never evaluated | FALSE | never evaluated |
? (max_fd) : (notify_pipe[0])); | 0 |
401 | | - |
402 | server_init_dispatch(); | - |
403 | | - |
404 | for (;;) { | - |
405 | process_buffered_input_packets(ssh); | - |
406 | | - |
407 | if (!ssh_packet_is_rekeying(ssh)TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
408 | ssh_packet_not_very_much_data_to_write(active_state)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
409 | channel_output_poll(ssh); never executed: channel_output_poll(ssh); | 0 |
410 | if (options.rekey_interval > 0TRUE | never evaluated | FALSE | never evaluated |
&& !ssh_packet_is_rekeying(ssh)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
411 | rekey_timeout_ms = ssh_packet_get_rekey_timeout(active_state) * 1000; never executed: rekey_timeout_ms = ssh_packet_get_rekey_timeout(active_state) * 1000; | 0 |
412 | else | - |
413 | rekey_timeout_ms = 0; never executed: rekey_timeout_ms = 0; | 0 |
414 | | - |
415 | wait_until_can_do_something(ssh, connection_in, connection_out, | - |
416 | &readset, &writeset, &max_fd, &nalloc, rekey_timeout_ms); | - |
417 | | - |
418 | if (received_sigtermTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
419 | logit("Exiting on signal %d", (int)received_sigterm); | - |
420 | | - |
421 | cleanup_exit(255); | - |
422 | } never executed: end of block | 0 |
423 | | - |
424 | collect_children(ssh); | - |
425 | if (!ssh_packet_is_rekeying(ssh)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
426 | channel_after_select(ssh, readset, writeset); never executed: channel_after_select(ssh, readset, writeset); | 0 |
427 | if (process_input(ssh, readset, connection_in) < 0TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
428 | break; never executed: break; | 0 |
429 | process_output(writeset, connection_out); | - |
430 | } never executed: end of block | 0 |
431 | collect_children(ssh); | - |
432 | | - |
433 | free(readset); | - |
434 | free(writeset); | - |
435 | | - |
436 | | - |
437 | channel_free_all(ssh); | - |
438 | | - |
439 | | - |
440 | session_destroy_all(ssh, | - |
441 | ((void *)0) | - |
442 | ); | - |
443 | } never executed: end of block | 0 |
444 | | - |
445 | static int | - |
446 | server_input_keep_alive(int type, u_int32_t seq, struct ssh *ssh) | - |
447 | { | - |
448 | debug("Got %d/%u for keepalive", type, seq); | - |
449 | | - |
450 | | - |
451 | | - |
452 | | - |
453 | | - |
454 | ssh_packet_set_alive_timeouts(active_state, (0)); | - |
455 | return never executed: return 0; 0;never executed: return 0; | 0 |
456 | } | - |
457 | | - |
458 | static Channel * | - |
459 | server_request_direct_tcpip(struct ssh *ssh, int *reason, const char **errmsg) | - |
460 | { | - |
461 | Channel *c = | - |
462 | ((void *)0) | - |
463 | ; | - |
464 | char *target, *originator; | - |
465 | u_short target_port, originator_port; | - |
466 | | - |
467 | target = ssh_packet_get_string(active_state, ( | - |
468 | ((void *)0) | - |
469 | )); | - |
470 | target_port = packet_get_int(); | - |
471 | originator = ssh_packet_get_string(active_state, ( | - |
472 | ((void *)0) | - |
473 | )); | - |
474 | originator_port = packet_get_int(); | - |
475 | do { int _len = ssh_packet_remaining(active_state); if (_len > 0TRUE | never evaluated | FALSE | never evaluated |
) { logit("Packet integrity error (%d bytes remaining) at %s:%d", _len ,__FILE__, 469); ssh_packet_disconnect(active_state, "Packet integrity error."); }never executed: end of block } while (0); | 0 |
476 | | - |
477 | debug("%s: originator %s port %d, target %s port %d", __func__, | - |
478 | originator, originator_port, target, target_port); | - |
479 | | - |
480 | | - |
481 | if ((TRUE | never evaluated | FALSE | never evaluated |
options.allow_tcp_forwarding & (1<<1)) != 0TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
482 | auth_opts->permit_port_forwarding_flagTRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
483 | !options.disable_forwardingTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
484 | c = channel_connect_to_port(ssh, target, target_port, | - |
485 | "direct-tcpip", "direct-tcpip", reason, errmsg); | - |
486 | } never executed: end of block else { | 0 |
487 | logit("refused local port forward: " | - |
488 | "originator %s port %d, target %s port %d", | - |
489 | originator, originator_port, target, target_port); | - |
490 | if (reason != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
491 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
492 | ) | - |
493 | * never executed: *reason = 1; reason = 1;never executed: *reason = 1; | 0 |
494 | } never executed: end of block | 0 |
495 | | - |
496 | free(originator); | - |
497 | free(target); | - |
498 | | - |
499 | return never executed: return c; c;never executed: return c; | 0 |
500 | } | - |
501 | | - |
502 | static Channel * | - |
503 | server_request_direct_streamlocal(struct ssh *ssh) | - |
504 | { | - |
505 | Channel *c = | - |
506 | ((void *)0) | - |
507 | ; | - |
508 | char *target, *originator; | - |
509 | u_short originator_port; | - |
510 | struct passwd *pw = the_authctxt->pw; | - |
511 | | - |
512 | if (pw == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
513 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
514 | || !the_authctxt->validTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
515 | fatal("%s: no/invalid user", __func__); never executed: fatal("%s: no/invalid user", __func__); | 0 |
516 | | - |
517 | target = ssh_packet_get_string(active_state, ( | - |
518 | ((void *)0) | - |
519 | )); | - |
520 | originator = ssh_packet_get_string(active_state, ( | - |
521 | ((void *)0) | - |
522 | )); | - |
523 | originator_port = packet_get_int(); | - |
524 | do { int _len = ssh_packet_remaining(active_state); if (_len > 0TRUE | never evaluated | FALSE | never evaluated |
) { logit("Packet integrity error (%d bytes remaining) at %s:%d", _len ,__FILE__, 508); ssh_packet_disconnect(active_state, "Packet integrity error."); }never executed: end of block } while (0); | 0 |
525 | | - |
526 | debug("%s: originator %s port %d, target %s", __func__, | - |
527 | originator, originator_port, target); | - |
528 | | - |
529 | | - |
530 | if ((TRUE | never evaluated | FALSE | never evaluated |
options.allow_streamlocal_forwarding & (1<<1)) != 0TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
531 | auth_opts->permit_port_forwarding_flagTRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
532 | !options.disable_forwardingTRUE | never evaluated | FALSE | never evaluated |
&& (pw->pw_uid == 0TRUE | never evaluated | FALSE | never evaluated |
|| use_privsepTRUE | never evaluated | FALSE | never evaluated |
)) { | 0 |
533 | c = channel_connect_to_path(ssh, target, | - |
534 | "direct-streamlocal@openssh.com", "direct-streamlocal"); | - |
535 | } never executed: end of block else { | 0 |
536 | logit("refused streamlocal port forward: " | - |
537 | "originator %s port %d, target %s", | - |
538 | originator, originator_port, target); | - |
539 | } never executed: end of block | 0 |
540 | | - |
541 | free(originator); | - |
542 | free(target); | - |
543 | | - |
544 | return never executed: return c; c;never executed: return c; | 0 |
545 | } | - |
546 | | - |
547 | static Channel * | - |
548 | server_request_tun(struct ssh *ssh) | - |
549 | { | - |
550 | Channel *c = | - |
551 | ((void *)0) | - |
552 | ; | - |
553 | int mode, tun, sock; | - |
554 | char *tmp, *ifname = | - |
555 | ((void *)0) | - |
556 | ; | - |
557 | | - |
558 | mode = packet_get_int(); | - |
559 | switch (mode) { | - |
560 | case never executed: case 0x01: 0x01:never executed: case 0x01: | 0 |
561 | case never executed: case 0x02: 0x02:never executed: case 0x02: | 0 |
562 | break; never executed: break; | 0 |
563 | default never executed: default: :never executed: default: | 0 |
564 | packet_send_debug("Unsupported tunnel device mode."); | - |
565 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 |
566 | ((void *)0) never executed: return ((void *)0) ; | 0 |
567 | ; never executed: return ((void *)0) ; | 0 |
568 | } | - |
569 | if ((TRUE | never evaluated | FALSE | never evaluated |
options.permit_tun & mode) == 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
570 | packet_send_debug("Server has rejected tunnel device " | - |
571 | "forwarding"); | - |
572 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 |
573 | ((void *)0) never executed: return ((void *)0) ; | 0 |
574 | ; never executed: return ((void *)0) ; | 0 |
575 | } | - |
576 | | - |
577 | tun = packet_get_int(); | - |
578 | if (auth_opts->force_tun_device != -1TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
579 | if (tun != 0x7fffffffTRUE | never evaluated | FALSE | never evaluated |
&& auth_opts->force_tun_device != tunTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
580 | goto never executed: goto done; done;never executed: goto done; | 0 |
581 | tun = auth_opts->force_tun_device; | - |
582 | } never executed: end of block | 0 |
583 | sock = tun_open(tun, mode, &ifname); | - |
584 | if (sock < 0TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
585 | goto never executed: goto done; done;never executed: goto done; | 0 |
586 | debug("Tunnel forwarding using interface %s", ifname); | - |
587 | | - |
588 | c = channel_new(ssh, "tun", 4, sock, sock, -1, | - |
589 | (64*(32*1024)), (32*1024), 0, "tun", 1); | - |
590 | c->datagram = 1; | - |
591 | | - |
592 | if (mode == 0x01TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
593 | channel_register_filter(ssh, c->self, sys_tun_infilter, never executed: channel_register_filter(ssh, c->self, sys_tun_infilter, sys_tun_outfilter, ((void *)0) , ((void *)0) ); | 0 |
594 | sys_tun_outfilter, never executed: channel_register_filter(ssh, c->self, sys_tun_infilter, sys_tun_outfilter, ((void *)0) , ((void *)0) ); | 0 |
595 | ((void *)0) never executed: channel_register_filter(ssh, c->self, sys_tun_infilter, sys_tun_outfilter, ((void *)0) , ((void *)0) ); | 0 |
596 | , never executed: channel_register_filter(ssh, c->self, sys_tun_infilter, sys_tun_outfilter, ((void *)0) , ((void *)0) ); | 0 |
597 | ((void *)0) never executed: channel_register_filter(ssh, c->self, sys_tun_infilter, sys_tun_outfilter, ((void *)0) , ((void *)0) ); | 0 |
598 | ); never executed: channel_register_filter(ssh, c->self, sys_tun_infilter, sys_tun_outfilter, ((void *)0) , ((void *)0) ); | 0 |
599 | | - |
600 | | - |
601 | | - |
602 | | - |
603 | | - |
604 | | - |
605 | | - |
606 | tmp = tun_fwd_ifnames; | - |
607 | xasprintf(&tun_fwd_ifnames, "%s%s%s", | - |
608 | tun_fwd_ifnames == | - |
609 | ((void *)0) | - |
610 | ? "" : tun_fwd_ifnames, | - |
611 | tun_fwd_ifnames == | - |
612 | ((void *)0) | - |
613 | ? "" : ",", | - |
614 | ifname); | - |
615 | free(tmp); | - |
616 | free(ifname); | - |
617 | | - |
618 | done: code before this statement never executed: done: | 0 |
619 | if (c == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
620 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
621 | ) | - |
622 | packet_send_debug("Failed to open the tunnel device."); never executed: packet_send_debug("Failed to open the tunnel device."); | 0 |
623 | return never executed: return c; c;never executed: return c; | 0 |
624 | } | - |
625 | | - |
626 | static Channel * | - |
627 | server_request_session(struct ssh *ssh) | - |
628 | { | - |
629 | Channel *c; | - |
630 | | - |
631 | debug("input_session_request"); | - |
632 | do { int _len = ssh_packet_remaining(active_state); if (_len > 0TRUE | never evaluated | FALSE | never evaluated |
) { logit("Packet integrity error (%d bytes remaining) at %s:%d", _len ,__FILE__, 598); ssh_packet_disconnect(active_state, "Packet integrity error."); }never executed: end of block } while (0); | 0 |
633 | | - |
634 | if (no_more_sessionsTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
635 | packet_disconnect("Possible attack: attempt to open a session " | - |
636 | "after additional sessions disabled"); | - |
637 | } never executed: end of block | 0 |
638 | | - |
639 | | - |
640 | | - |
641 | | - |
642 | | - |
643 | | - |
644 | | - |
645 | c = channel_new(ssh, "session", 10, | - |
646 | -1, -1, -1, 0, (32*1024), | - |
647 | 0, "server-session", 1); | - |
648 | if (session_open(the_authctxt, c->self) != 1TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
649 | debug("session open failed, free channel %d", c->self); | - |
650 | channel_free(ssh, c); | - |
651 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 |
652 | ((void *)0) never executed: return ((void *)0) ; | 0 |
653 | ; never executed: return ((void *)0) ; | 0 |
654 | } | - |
655 | channel_register_cleanup(ssh, c->self, session_close_by_channel, 0); | - |
656 | return never executed: return c; c;never executed: return c; | 0 |
657 | } | - |
658 | | - |
659 | static int | - |
660 | server_input_channel_open(int type, u_int32_t seq, struct ssh *ssh) | - |
661 | { | - |
662 | Channel *c = | - |
663 | ((void *)0) | - |
664 | ; | - |
665 | char *ctype; | - |
666 | const char *errmsg = | - |
667 | ((void *)0) | - |
668 | ; | - |
669 | int rchan, reason = 2; | - |
670 | u_int rmaxpack, rwindow, len; | - |
671 | | - |
672 | ctype = ssh_packet_get_string(active_state, (&len)); | - |
673 | rchan = packet_get_int(); | - |
674 | rwindow = packet_get_int(); | - |
675 | rmaxpack = packet_get_int(); | - |
676 | | - |
677 | debug("%s: ctype %s rchan %d win %d max %d", __func__, | - |
678 | ctype, rchan, rwindow, rmaxpack); | - |
679 | | - |
680 | if ( | - |
681 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
682 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
683 | ) && __builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
684 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
685 | ) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
686 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
687 | ), __s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
688 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
689 | ), (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
690 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
691 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
692 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
693 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
694 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
695 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
696 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
697 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
698 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
699 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
700 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
701 | ) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
702 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
703 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
704 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
705 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
706 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
707 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
708 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
709 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
710 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
711 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
712 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
713 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
714 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
715 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
716 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
717 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
718 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
719 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
720 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
721 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
722 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
723 | ))[0] - __s2[0]); if (__s1_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
724 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
725 | ))[1] - __s2[1]); if (__s1_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
726 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
727 | ))[2] - __s2[2]); if (__s1_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( ctype ))[3] - __s2[3]); | 0 |
728 | ctypeTRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( ctype ))[3] - __s2[3]); | 0 |
729 | ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
730 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
731 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
732 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
733 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
734 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
735 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
736 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
737 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
738 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
739 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
740 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
741 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
742 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
743 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
744 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
745 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
746 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
747 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
748 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
749 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
750 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
751 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
752 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
753 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
754 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
755 | ))[2] - __s2[2]); if (__s2_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( "session" ))[3] - __s2[3]); | 0 |
756 | "session"TRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( "session" ))[3] - __s2[3]); | 0 |
757 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
758 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
759 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
760 | "session"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
761 | )))); }) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
762 | == 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
763 | c = server_request_session(ssh); | - |
764 | } never executed: end of block else if ( | 0 |
765 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
766 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
767 | ) && __builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
768 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
769 | ) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
770 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
771 | ), __s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
772 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
773 | ), (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
774 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
775 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
776 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
777 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
778 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
779 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
780 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
781 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
782 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
783 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
784 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
785 | ) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
786 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
787 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
788 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
789 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
790 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
791 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
792 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
793 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
794 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
795 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
796 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
797 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
798 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
799 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
800 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
801 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
802 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
803 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
804 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
805 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
806 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
807 | ))[0] - __s2[0]); if (__s1_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
808 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
809 | ))[1] - __s2[1]); if (__s1_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
810 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
811 | ))[2] - __s2[2]); if (__s1_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( ctype ))[3] - __s2[3]); | 0 |
812 | ctypeTRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( ctype ))[3] - __s2[3]); | 0 |
813 | ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
814 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
815 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
816 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
817 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
818 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
819 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
820 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
821 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
822 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
823 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
824 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
825 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
826 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
827 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
828 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
829 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
830 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
831 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
832 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
833 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
834 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
835 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
836 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
837 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
838 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
839 | ))[2] - __s2[2]); if (__s2_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( "direct-tcpip" ))[3] - __s2[3]); | 0 |
840 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( "direct-tcpip" ))[3] - __s2[3]); | 0 |
841 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
842 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
843 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
844 | "direct-tcpip"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
845 | )))); }) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
846 | == 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
847 | c = server_request_direct_tcpip(ssh, &reason, &errmsg); | - |
848 | } never executed: end of block else if ( | 0 |
849 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
850 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
851 | ) && __builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
852 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
853 | ) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
854 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
855 | ), __s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
856 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
857 | ), (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
858 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
859 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
860 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
861 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
862 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
863 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
864 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
865 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
866 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
867 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
868 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
869 | ) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
870 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
871 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
872 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
873 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
874 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
875 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
876 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
877 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
878 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
879 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
880 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
881 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
882 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
883 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
884 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
885 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
886 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
887 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
888 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
889 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
890 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
891 | ))[0] - __s2[0]); if (__s1_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
892 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
893 | ))[1] - __s2[1]); if (__s1_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
894 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
895 | ))[2] - __s2[2]); if (__s1_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( ctype ))[3] - __s2[3]); | 0 |
896 | ctypeTRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( ctype ))[3] - __s2[3]); | 0 |
897 | ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
898 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
899 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
900 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
901 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
902 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
903 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
904 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
905 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
906 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
907 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
908 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
909 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
910 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
911 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
912 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
913 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
914 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
915 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
916 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
917 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
918 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
919 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
920 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
921 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
922 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
923 | ))[2] - __s2[2]); if (__s2_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( "direct-streamlocal@openssh.com" ))[3] - __s2[3]); | 0 |
924 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( "direct-streamlocal@openssh.com" ))[3] - __s2[3]); | 0 |
925 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
926 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
927 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
928 | "direct-streamlocal@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
929 | )))); }) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
930 | == 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
931 | c = server_request_direct_streamlocal(ssh); | - |
932 | } never executed: end of block else if ( | 0 |
933 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
934 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
935 | ) && __builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
936 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
937 | ) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
938 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
939 | ), __s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
940 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
941 | ), (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
942 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
943 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
944 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
945 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
946 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
947 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
948 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
949 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
950 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
951 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
952 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
953 | ) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
954 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
955 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
956 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
957 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
958 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
959 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
960 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
961 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
962 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
963 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
964 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
965 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
966 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
967 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
968 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
969 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
970 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
971 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
972 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
973 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
974 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
975 | ))[0] - __s2[0]); if (__s1_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
976 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
977 | ))[1] - __s2[1]); if (__s1_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
978 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
979 | ))[2] - __s2[2]); if (__s1_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( ctype ))[3] - __s2[3]); | 0 |
980 | ctypeTRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( ctype ))[3] - __s2[3]); | 0 |
981 | ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
982 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
983 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
984 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
985 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
986 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
987 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
988 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
989 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
990 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
991 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
992 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
993 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
994 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
995 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
996 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
997 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
998 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
999 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1000 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1001 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1002 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1003 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1004 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1005 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1006 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1007 | ))[2] - __s2[2]); if (__s2_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( "tun@openssh.com" ))[3] - __s2[3]); | 0 |
1008 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( "tun@openssh.com" ))[3] - __s2[3]); | 0 |
1009 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1010 | ctypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1011 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1012 | "tun@openssh.com"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1013 | )))); }) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1014 | == 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1015 | c = server_request_tun(ssh); | - |
1016 | } never executed: end of block | 0 |
1017 | if (c != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1018 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1019 | ) { | - |
1020 | debug("%s: confirm %s", __func__, ctype); | - |
1021 | c->remote_id = rchan; | - |
1022 | c->have_remote_id = 1; | - |
1023 | c->remote_window = rwindow; | - |
1024 | c->remote_maxpacket = rmaxpack; | - |
1025 | if (c->type != 12TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1026 | ssh_packet_start(active_state, (91)); | - |
1027 | ssh_packet_put_int(active_state, (c->remote_id)); | - |
1028 | ssh_packet_put_int(active_state, (c->self)); | - |
1029 | ssh_packet_put_int(active_state, (c->local_window)); | - |
1030 | ssh_packet_put_int(active_state, (c->local_maxpacket)); | - |
1031 | ssh_packet_send(active_state); | - |
1032 | } never executed: end of block | 0 |
1033 | } never executed: end of block else { | 0 |
1034 | debug("%s: failure %s", __func__, ctype); | - |
1035 | ssh_packet_start(active_state, (92)); | - |
1036 | ssh_packet_put_int(active_state, (rchan)); | - |
1037 | ssh_packet_put_int(active_state, (reason)); | - |
1038 | ssh_packet_put_cstring(active_state, (errmsg ? errmsg : "open failed")); | - |
1039 | ssh_packet_put_cstring(active_state, ("")); | - |
1040 | ssh_packet_send(active_state); | - |
1041 | } never executed: end of block | 0 |
1042 | free(ctype); | - |
1043 | return never executed: return 0; 0;never executed: return 0; | 0 |
1044 | } | - |
1045 | | - |
1046 | static int | - |
1047 | server_input_hostkeys_prove(struct ssh *ssh, struct sshbuf **respp) | - |
1048 | { | - |
1049 | struct sshbuf *resp = | - |
1050 | ((void *)0) | - |
1051 | ; | - |
1052 | struct sshbuf *sigbuf = | - |
1053 | ((void *)0) | - |
1054 | ; | - |
1055 | struct sshkey *key = | - |
1056 | ((void *)0) | - |
1057 | , *key_pub = | - |
1058 | ((void *)0) | - |
1059 | , *key_prv = | - |
1060 | ((void *)0) | - |
1061 | ; | - |
1062 | int r, ndx, kexsigtype, use_kexsigtype, success = 0; | - |
1063 | const u_char *blob; | - |
1064 | u_char *sig = 0; | - |
1065 | size_t blen, slen; | - |
1066 | | - |
1067 | if ((TRUE | never evaluated | FALSE | never evaluated |
resp = sshbuf_new()) == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1068 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1069 | || (TRUE | never evaluated | FALSE | never evaluated |
sigbuf = sshbuf_new()) == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1070 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1071 | ) | - |
1072 | fatal("%s: sshbuf_new", __func__); never executed: fatal("%s: sshbuf_new", __func__); | 0 |
1073 | | - |
1074 | kexsigtype = sshkey_type_plain( | - |
1075 | sshkey_type_from_name(ssh->kex->hostkey_alg)); | - |
1076 | while (ssh_packet_remaining(ssh) > 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1077 | sshkey_free(key); | - |
1078 | key = | - |
1079 | ((void *)0) | - |
1080 | ; | - |
1081 | if ((TRUE | never evaluated | FALSE | never evaluated |
r = sshpkt_get_string_direct(ssh, &blob, &blen)) != 0TRUE | never evaluated | FALSE | never evaluated |
|| | 0 |
1082 | (TRUE | never evaluated | FALSE | never evaluated |
r = sshkey_from_blob(blob, blen, &key)) != 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1083 | error("%s: couldn't parse key: %s", | - |
1084 | __func__, ssh_err(r)); | - |
1085 | goto never executed: goto out; out;never executed: goto out; | 0 |
1086 | } | - |
1087 | | - |
1088 | | - |
1089 | | - |
1090 | | - |
1091 | if ((TRUE | never evaluated | FALSE | never evaluated |
ndx = ssh->kex->host_key_index(key, 1, ssh)) == -1TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1092 | error("%s: unknown host %s key", | - |
1093 | __func__, sshkey_type(key)); | - |
1094 | goto never executed: goto out; out;never executed: goto out; | 0 |
1095 | } | - |
1096 | | - |
1097 | | - |
1098 | | - |
1099 | | - |
1100 | if ((TRUE | never evaluated | FALSE | never evaluated |
key_prv = get_hostkey_by_index(ndx)) == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1101 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1102 | && | - |
1103 | (TRUE | never evaluated | FALSE | never evaluated |
key_pub = get_hostkey_public_by_index(ndx, ssh)) == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1104 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1105 | ) { | - |
1106 | error("%s: can't retrieve hostkey %d", __func__, ndx); | - |
1107 | goto never executed: goto out; out;never executed: goto out; | 0 |
1108 | } | - |
1109 | sshbuf_reset(sigbuf); | - |
1110 | free(sig); | - |
1111 | sig = | - |
1112 | ((void *)0) | - |
1113 | ; | - |
1114 | | - |
1115 | | - |
1116 | | - |
1117 | | - |
1118 | use_kexsigtype = kexsigtype == KEY_RSATRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
1119 | sshkey_type_plain(key->type) == KEY_RSATRUE | never evaluated | FALSE | never evaluated |
; | 0 |
1120 | if ((TRUE | never evaluated | FALSE | never evaluated |
r = sshbuf_put_cstring(sigbuf,TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1121 | "hostkeys-prove-00@openssh.com")) != 0TRUE | never evaluated | FALSE | never evaluated |
|| | 0 |
1122 | (TRUE | never evaluated | FALSE | never evaluated |
r = sshbuf_put_string(sigbuf,TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1123 | ssh->kex->session_id, ssh->kex->session_id_len)) != 0TRUE | never evaluated | FALSE | never evaluated |
|| | 0 |
1124 | (TRUE | never evaluated | FALSE | never evaluated |
r = sshkey_puts(key, sigbuf)) != 0TRUE | never evaluated | FALSE | never evaluated |
|| | 0 |
1125 | (TRUE | never evaluated | FALSE | never evaluated |
r = ssh->kex->sign(key_prv, key_pub, &sig, &slen,TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1126 | sshbuf_ptr(sigbuf), sshbuf_len(sigbuf),TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1127 | use_kexsigtype ? ssh->kex->hostkey_alg : TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1128 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1129 | , 0)) != 0TRUE | never evaluated | FALSE | never evaluated |
|| | 0 |
1130 | (TRUE | never evaluated | FALSE | never evaluated |
r = sshbuf_put_string(resp, sig, slen)) != 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1131 | error("%s: couldn't prepare signature: %s", | - |
1132 | __func__, ssh_err(r)); | - |
1133 | goto never executed: goto out; out;never executed: goto out; | 0 |
1134 | } | - |
1135 | } never executed: end of block | 0 |
1136 | | - |
1137 | *respp = resp; | - |
1138 | resp = | - |
1139 | ((void *)0) | - |
1140 | ; | - |
1141 | success = 1; | - |
1142 | out: code before this statement never executed: out: | 0 |
1143 | free(sig); | - |
1144 | sshbuf_free(resp); | - |
1145 | sshbuf_free(sigbuf); | - |
1146 | sshkey_free(key); | - |
1147 | return never executed: return success; success;never executed: return success; | 0 |
1148 | } | - |
1149 | | - |
1150 | static int | - |
1151 | server_input_global_request(int type, u_int32_t seq, struct ssh *ssh) | - |
1152 | { | - |
1153 | char *rtype; | - |
1154 | int want_reply; | - |
1155 | int r, success = 0, allocated_listen_port = 0; | - |
1156 | struct sshbuf *resp = | - |
1157 | ((void *)0) | - |
1158 | ; | - |
1159 | struct passwd *pw = the_authctxt->pw; | - |
1160 | | - |
1161 | if (pw == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1162 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1163 | || !the_authctxt->validTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1164 | fatal("%s: no/invalid user", __func__); never executed: fatal("%s: no/invalid user", __func__); | 0 |
1165 | | - |
1166 | rtype = ssh_packet_get_string(active_state, ( | - |
1167 | ((void *)0) | - |
1168 | )); | - |
1169 | want_reply = packet_get_char(); | - |
1170 | debug("%s: rtype %s want_reply %d", __func__, rtype, want_reply); | - |
1171 | | - |
1172 | | - |
1173 | if ( | - |
1174 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1175 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1176 | ) && __builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1177 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1178 | ) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1179 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1180 | ), __s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1181 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1182 | ), (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1183 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1184 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1185 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1186 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1187 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1188 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1189 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1190 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1191 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1192 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1193 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1194 | ) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1195 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1196 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1197 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1198 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1199 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1200 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1201 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1202 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1203 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1204 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1205 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1206 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1207 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1208 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1209 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1210 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1211 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1212 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1213 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1214 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1215 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1216 | ))[0] - __s2[0]); if (__s1_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1217 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1218 | ))[1] - __s2[1]); if (__s1_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1219 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1220 | ))[2] - __s2[2]); if (__s1_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( rtype ))[3] - __s2[3]); | 0 |
1221 | rtypeTRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( rtype ))[3] - __s2[3]); | 0 |
1222 | ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1223 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1224 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1225 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1226 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1227 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1228 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1229 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1230 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1231 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1232 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1233 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1234 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1235 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1236 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1237 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1238 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1239 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1240 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1241 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1242 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1243 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1244 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1245 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1246 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1247 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1248 | ))[2] - __s2[2]); if (__s2_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( "tcpip-forward" ))[3] - __s2[3]); | 0 |
1249 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( "tcpip-forward" ))[3] - __s2[3]); | 0 |
1250 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1251 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1252 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1253 | "tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1254 | )))); }) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1255 | == 0TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1256 | struct Forward fwd; | - |
1257 | | - |
1258 | memset(&fwd, 0, sizeof(fwd)); | - |
1259 | fwd.listen_host = ssh_packet_get_string(active_state, ( | - |
1260 | ((void *)0) | - |
1261 | )); | - |
1262 | fwd.listen_port = (u_short)packet_get_int(); | - |
1263 | debug("%s: tcpip-forward listen %s port %d", __func__, | - |
1264 | fwd.listen_host, fwd.listen_port); | - |
1265 | | - |
1266 | | - |
1267 | if ((TRUE | never evaluated | FALSE | never evaluated |
options.allow_tcp_forwarding & (1)) == 0TRUE | never evaluated | FALSE | never evaluated |
|| | 0 |
1268 | !auth_opts->permit_port_forwarding_flagTRUE | never evaluated | FALSE | never evaluated |
|| | 0 |
1269 | options.disable_forwardingTRUE | never evaluated | FALSE | never evaluated |
|| | 0 |
1270 | (!want_replyTRUE | never evaluated | FALSE | never evaluated |
&& fwd.listen_port == 0TRUE | never evaluated | FALSE | never evaluated |
) || | 0 |
1271 | (fwd.listen_port != 0TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
1272 | !bind_permitted(fwd.listen_port, pw->pw_uid)TRUE | never evaluated | FALSE | never evaluated |
)) { | 0 |
1273 | success = 0; | - |
1274 | packet_send_debug("Server has disabled port forwarding."); | - |
1275 | } never executed: end of block else { | 0 |
1276 | | - |
1277 | success = channel_setup_remote_fwd_listener(ssh, &fwd, | - |
1278 | &allocated_listen_port, &options.fwd_opts); | - |
1279 | } never executed: end of block | 0 |
1280 | free(fwd.listen_host); | - |
1281 | if ((TRUE | never evaluated | FALSE | never evaluated |
resp = sshbuf_new()) == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1282 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1283 | ) | - |
1284 | fatal("%s: sshbuf_new", __func__); never executed: fatal("%s: sshbuf_new", __func__); | 0 |
1285 | if (allocated_listen_port != 0TRUE | never evaluated | FALSE | never evaluated |
&& | 0 |
1286 | (TRUE | never evaluated | FALSE | never evaluated |
r = sshbuf_put_u32(resp, allocated_listen_port)) != 0TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1287 | fatal("%s: sshbuf_put_u32: %s", __func__, ssh_err(r)); never executed: fatal("%s: sshbuf_put_u32: %s", __func__, ssh_err(r)); | 0 |
1288 | } never executed: end of block else if ( | 0 |
1289 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1290 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1291 | ) && __builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1292 | "cancel-tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1293 | ) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1294 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1295 | ), __s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1296 | "cancel-tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1297 | ), (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1298 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1299 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1300 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1301 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1302 | "cancel-tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1303 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1304 | "cancel-tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1305 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1306 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1307 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1308 | "cancel-tcpip-forward"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1309 | ) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1310 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1311 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1312 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1313 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1314 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1315 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1316 | rtypeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1317 | |