Lines Matching refs:ret
71 char *ret;
80 if ((ret = malloc(strlen((s)) + 1)) == NULL) {
87 ret[i++] = *s++;
91 free(ret);
94 ret[i] = '\0';
97 return ret;
147 int r, ret = -1, found;
245 ret = 0;
251 return ret;
257 struct sshauthopt *ret;
259 if ((ret = calloc(1, sizeof(*ret))) == NULL)
261 ret->force_tun_device = -1;
262 return ret;
297 struct sshauthopt *ret = NULL;
299 if ((ret = sshauthopt_new()) == NULL)
303 ret->permit_port_forwarding_flag = 1;
304 ret->permit_agent_forwarding_flag = 1;
305 ret->permit_x11_forwarding_flag = 1;
306 ret->permit_pty_flag = 1;
307 ret->permit_user_rc = 1;
308 return ret;
388 struct sshauthopt *ret = NULL;
394 if ((ret = sshauthopt_new_with_keys_defaults()) == NULL)
398 return ret;
403 ret->restricted = 1;
404 ret->permit_port_forwarding_flag = 0;
405 ret->permit_agent_forwarding_flag = 0;
406 ret->permit_x11_forwarding_flag = 0;
407 ret->permit_pty_flag = 0;
408 ret->permit_user_rc = 0;
410 ret->cert_authority = r;
412 ret->permit_port_forwarding_flag = r == 1;
414 ret->permit_agent_forwarding_flag = r == 1;
416 ret->permit_x11_forwarding_flag = r == 1;
418 ret->permit_pty_flag = r == 1;
420 ret->permit_user_rc = r == 1;
422 if (ret->force_command != NULL) {
426 ret->force_command = opt_dequote(&opts, &errstr);
427 if (ret->force_command == NULL)
430 if (ret->cert_principals != NULL) {
434 ret->cert_principals = opt_dequote(&opts, &errstr);
435 if (ret->cert_principals == NULL)
438 if (ret->required_from_host_keys != NULL) {
442 ret->required_from_host_keys = opt_dequote(&opts,
444 if (ret->required_from_host_keys == NULL)
456 if (ret->valid_before == 0 ||
457 valid_before < ret->valid_before)
458 ret->valid_before = valid_before;
460 if (ret->nenv > INT_MAX) {
483 oarray = ret->env;
484 if ((ret->env = recallocarray(ret->env, ret->nenv,
485 ret->nenv + 1, sizeof(*ret->env))) == NULL) {
487 ret->env = oarray; /* put it back for cleanup */
490 ret->env[ret->nenv++] = opt;
492 if (handle_permit(&opts, 0, &ret->permitopen,
493 &ret->npermitopen, &errstr) != 0)
496 if (handle_permit(&opts, 1, &ret->permitlisten,
497 &ret->npermitlisten, &errstr) != 0)
502 ret->force_tun_device = a2tun(opt, NULL);
504 if (ret->force_tun_device == SSH_TUNID_ERR) {
530 return ret;
535 sshauthopt_free(ret);
544 struct sshauthopt *ret;
550 if ((ret = sshauthopt_new()) == NULL)
554 if (cert_option_list(ret, k->cert->critical,
556 sshauthopt_free(ret);
559 if (cert_option_list(ret, k->cert->extensions,
561 sshauthopt_free(ret);
565 return ret;
576 struct sshauthopt *ret;
583 if ((ret = sshauthopt_new()) == NULL)
593 if (tmp != NULL && (ret->required_from_host_cert = strdup(tmp)) == NULL)
598 if (tmp != NULL && (ret->required_from_host_keys = strdup(tmp)) == NULL)
605 ret->force_tun_device = primary->force_tun_device;
606 if (ret->force_tun_device == -1)
607 ret->force_tun_device = additional->force_tun_device;
609 if (dup_strings(&ret->env, &ret->nenv,
613 if (dup_strings(&ret->env, &ret->nenv,
618 if (dup_strings(&ret->permitopen, &ret->npermitopen,
622 if (dup_strings(&ret->permitopen, &ret->npermitopen,
628 if (dup_strings(&ret->permitlisten, &ret->npermitlisten,
632 if (dup_strings(&ret->permitlisten, &ret->npermitlisten,
638 #define OPTFLAG(x) ret->x = (primary->x == 1) && (additional->x == 1)
648 ret->valid_before = primary->valid_before;
650 additional->valid_before < ret->valid_before)
651 ret->valid_before = additional->valid_before;
662 ret->force_command = strdup(primary->force_command);
663 if (ret->force_command == NULL)
670 if ((ret->force_command = strdup(
674 if ((ret->force_command = strdup(
681 return ret;
688 sshauthopt_free(ret);
698 struct sshauthopt *ret;
700 if ((ret = sshauthopt_new()) == NULL)
703 #define OPTSCALAR(x) ret->x = orig->x
716 if (orig->x != NULL && (ret->x = strdup(orig->x)) == NULL) { \
717 sshauthopt_free(ret); \
727 if (dup_strings(&ret->env, &ret->nenv, orig->env, orig->nenv) != 0 ||
728 dup_strings(&ret->permitopen, &ret->npermitopen,
730 dup_strings(&ret->permitlisten, &ret->npermitlisten,
732 sshauthopt_free(ret);
735 return ret;