|
Lines 314-323
process_mux_new_session(u_int rid, Channel *c, Buffer *m, Buffer *r)
Link Here
|
| 314 |
/* Reply for SSHMUX_COMMAND_OPEN */ |
314 |
/* Reply for SSHMUX_COMMAND_OPEN */ |
| 315 |
cctx = xcalloc(1, sizeof(*cctx)); |
315 |
cctx = xcalloc(1, sizeof(*cctx)); |
| 316 |
cctx->term = NULL; |
316 |
cctx->term = NULL; |
| 317 |
cctx->rid = rid; |
317 |
cctx->rid = rid; |
| 318 |
cmd = reserved = NULL; |
318 |
cmd = reserved = NULL; |
|
|
319 |
cctx->env = NULL; |
| 320 |
env_len = 0; |
| 319 |
if ((reserved = buffer_get_string_ret(m, NULL)) == NULL || |
321 |
if ((reserved = buffer_get_string_ret(m, NULL)) == NULL || |
| 320 |
buffer_get_int_ret(&cctx->want_tty, m) != 0 || |
322 |
buffer_get_int_ret(&cctx->want_tty, m) != 0 || |
| 321 |
buffer_get_int_ret(&cctx->want_x_fwd, m) != 0 || |
323 |
buffer_get_int_ret(&cctx->want_x_fwd, m) != 0 || |
| 322 |
buffer_get_int_ret(&cctx->want_agent_fwd, m) != 0 || |
324 |
buffer_get_int_ret(&cctx->want_agent_fwd, m) != 0 || |
| 323 |
buffer_get_int_ret(&cctx->want_subsys, m) != 0 || |
325 |
buffer_get_int_ret(&cctx->want_subsys, m) != 0 || |
|
Lines 327-346
process_mux_new_session(u_int rid, Channel *c, Buffer *m, Buffer *r)
Link Here
|
| 327 |
malf: |
329 |
malf: |
| 328 |
if (cmd != NULL) |
330 |
if (cmd != NULL) |
| 329 |
xfree(cmd); |
331 |
xfree(cmd); |
| 330 |
if (reserved != NULL) |
332 |
if (reserved != NULL) |
| 331 |
xfree(reserved); |
333 |
xfree(reserved); |
|
|
334 |
for (j = 0; j < env_len; j++) |
| 335 |
xfree(cctx->env[j]); |
| 336 |
if (env_len > 0) |
| 337 |
xfree(cctx->env); |
| 332 |
if (cctx->term != NULL) |
338 |
if (cctx->term != NULL) |
| 333 |
xfree(cctx->term); |
339 |
xfree(cctx->term); |
|
|
340 |
xfree(cctx); |
| 334 |
error("%s: malformed message", __func__); |
341 |
error("%s: malformed message", __func__); |
| 335 |
return -1; |
342 |
return -1; |
| 336 |
} |
343 |
} |
| 337 |
xfree(reserved); |
344 |
xfree(reserved); |
| 338 |
reserved = NULL; |
345 |
reserved = NULL; |
| 339 |
|
346 |
|
| 340 |
cctx->env = NULL; |
|
|
| 341 |
env_len = 0; |
| 342 |
while (buffer_len(m) > 0) { |
347 |
while (buffer_len(m) > 0) { |
| 343 |
#define MUX_MAX_ENV_VARS 4096 |
348 |
#define MUX_MAX_ENV_VARS 4096 |
| 344 |
if ((cp = buffer_get_string_ret(m, &len)) == NULL) |
349 |
if ((cp = buffer_get_string_ret(m, &len)) == NULL) |
| 345 |
goto malf; |
350 |
goto malf; |
| 346 |
if (!env_permitted(cp)) { |
351 |
if (!env_permitted(cp)) { |
|
Lines 411-420
process_mux_new_session(u_int rid, Channel *c, Buffer *m, Buffer *r)
Link Here
|
| 411 |
for (i = 0; i < env_len; i++) |
416 |
for (i = 0; i < env_len; i++) |
| 412 |
xfree(cctx->env[i]); |
417 |
xfree(cctx->env[i]); |
| 413 |
xfree(cctx->env); |
418 |
xfree(cctx->env); |
| 414 |
} |
419 |
} |
| 415 |
buffer_free(&cctx->cmd); |
420 |
buffer_free(&cctx->cmd); |
|
|
421 |
xfree(cctx); |
| 416 |
return 0; |
422 |
return 0; |
| 417 |
} |
423 |
} |
| 418 |
|
424 |
|
| 419 |
if (options.control_master == SSHCTL_MASTER_ASK || |
425 |
if (options.control_master == SSHCTL_MASTER_ASK || |
| 420 |
options.control_master == SSHCTL_MASTER_AUTO_ASK) { |
426 |
options.control_master == SSHCTL_MASTER_AUTO_ASK) { |
| 421 |
- |
|
|