Lines Matching full:cctx
311 struct mux_session_confirm_ctx *cctx;
317 cctx = xcalloc(1, sizeof(*cctx));
318 cctx->term = NULL;
319 cctx->rid = rid;
321 cctx->env = NULL;
324 buffer_get_int_ret(&cctx->want_tty, m) != 0 ||
325 buffer_get_int_ret(&cctx->want_x_fwd, m) != 0 ||
326 buffer_get_int_ret(&cctx->want_agent_fwd, m) != 0 ||
327 buffer_get_int_ret(&cctx->want_subsys, m) != 0 ||
329 (cctx->term = buffer_get_string_ret(m, &len)) == NULL ||
335 free(cctx->env[j]);
336 free(cctx->env);
337 free(cctx->term);
338 free(cctx);
353 cctx->env = xreallocarray(cctx->env, env_len + 2,
354 sizeof(*cctx->env));
355 cctx->env[env_len++] = cp;
356 cctx->env[env_len] = NULL;
366 cctx->want_tty, cctx->want_x_fwd, cctx->want_agent_fwd,
367 cctx->want_subsys, cctx->term, cmd, env_len);
369 buffer_init(&cctx->cmd);
370 buffer_append(&cctx->cmd, cmd, strlen(cmd));
382 free(cctx->env[j]);
383 free(cctx->env);
384 free(cctx->term);
385 buffer_free(&cctx->cmd);
386 free(cctx);
411 free(cctx->term);
414 free(cctx->env[i]);
415 free(cctx->env);
417 buffer_free(&cctx->cmd);
418 free(cctx);
435 if (cctx->want_tty && tcgetattr(new_fd[0], &cctx->tio) == -1)
448 if (cctx->want_tty) {
460 if (cctx->want_tty && escape_char != 0xffffffff) {
471 channel_register_open_confirm(nc->self, mux_session_confirm, cctx);
948 struct mux_stdio_confirm_ctx *cctx;
1028 cctx = xcalloc(1, sizeof(*cctx));
1029 cctx->rid = rid;
1030 channel_register_open_confirm(nc->self, mux_stdio_confirm, cctx);
1041 struct mux_stdio_confirm_ctx *cctx = arg;
1045 if (cctx == NULL)
1046 fatal("%s: cctx == NULL", __func__);
1058 buffer_put_int(&reply, cctx->rid);
1067 buffer_put_int(&reply, cctx->rid);
1079 free(cctx);
1328 struct mux_session_confirm_ctx *cctx = arg;
1334 if (cctx == NULL)
1335 fatal("%s: cctx == NULL", __func__);
1347 buffer_put_int(&reply, cctx->rid);
1353 if (cctx->want_x_fwd && options.forward_x11 && display != NULL) {
1369 if (cctx->want_agent_fwd && options.forward_agent) {
1375 client_session2_setup(id, cctx->want_tty, cctx->want_subsys,
1376 cctx->term, &cctx->tio, c->rfd, &cctx->cmd, cctx->env);
1382 buffer_put_int(&reply, cctx->rid);
1394 buffer_free(&cctx->cmd);
1395 free(cctx->term);
1396 if (cctx->env != NULL) {
1397 for (i = 0; cctx->env[i] != NULL; i++)
1398 free(cctx->env[i]);
1399 free(cctx->env);
1401 free(cctx);