Lines Matching full:options
77 # 1. command line options
122 # Defaults for various options
136 const char *host, const char *original_host, Options *options,
138 static int process_config_line_depth(Options *options, struct passwd *pw,
191 /* Deprecated options */
202 /* Unsupported options */
210 /* Sometimes-unsupported options */
373 * Adds a local TCP/IP port forward to options. Never returns if there is an
378 add_local_forward(Options *options, const struct Forward *newfwd) in add_local_forward() argument
384 for (i = 0; i < options->num_local_forwards; i++) { in add_local_forward()
385 if (forward_equals(newfwd, options->local_forwards + i)) in add_local_forward()
388 options->local_forwards = xreallocarray(options->local_forwards, in add_local_forward()
389 options->num_local_forwards + 1, in add_local_forward()
390 sizeof(*options->local_forwards)); in add_local_forward()
391 fwd = &options->local_forwards[options->num_local_forwards++]; in add_local_forward()
402 * Adds a remote TCP/IP port forward to options. Never returns if there is
407 add_remote_forward(Options *options, const struct Forward *newfwd) in add_remote_forward() argument
413 for (i = 0; i < options->num_remote_forwards; i++) { in add_remote_forward()
414 if (forward_equals(newfwd, options->remote_forwards + i)) in add_remote_forward()
417 options->remote_forwards = xreallocarray(options->remote_forwards, in add_remote_forward()
418 options->num_remote_forwards + 1, in add_remote_forward()
419 sizeof(*options->remote_forwards)); in add_remote_forward()
420 fwd = &options->remote_forwards[options->num_remote_forwards++]; in add_remote_forward()
433 clear_forwardings(Options *options) in clear_forwardings() argument
437 for (i = 0; i < options->num_local_forwards; i++) { in clear_forwardings()
438 free(options->local_forwards[i].listen_host); in clear_forwardings()
439 free(options->local_forwards[i].listen_path); in clear_forwardings()
440 free(options->local_forwards[i].connect_host); in clear_forwardings()
441 free(options->local_forwards[i].connect_path); in clear_forwardings()
443 if (options->num_local_forwards > 0) { in clear_forwardings()
444 free(options->local_forwards); in clear_forwardings()
445 options->local_forwards = NULL; in clear_forwardings()
447 options->num_local_forwards = 0; in clear_forwardings()
448 for (i = 0; i < options->num_remote_forwards; i++) { in clear_forwardings()
449 free(options->remote_forwards[i].listen_host); in clear_forwardings()
450 free(options->remote_forwards[i].listen_path); in clear_forwardings()
451 free(options->remote_forwards[i].connect_host); in clear_forwardings()
452 free(options->remote_forwards[i].connect_path); in clear_forwardings()
454 if (options->num_remote_forwards > 0) { in clear_forwardings()
455 free(options->remote_forwards); in clear_forwardings()
456 options->remote_forwards = NULL; in clear_forwardings()
458 options->num_remote_forwards = 0; in clear_forwardings()
459 options->tun_open = SSH_TUNMODE_NO; in clear_forwardings()
463 add_certificate_file(Options *options, const char *path, int userprovided) in add_certificate_file() argument
467 if (options->num_certificate_files >= SSH_MAX_CERTIFICATE_FILES) in add_certificate_file()
472 for (i = 0; i < options->num_certificate_files; i++) { in add_certificate_file()
473 if (options->certificate_file_userprovided[i] == userprovided && in add_certificate_file()
474 strcmp(options->certificate_files[i], path) == 0) { in add_certificate_file()
480 options->certificate_file_userprovided[options->num_certificate_files] = in add_certificate_file()
482 options->certificate_files[options->num_certificate_files++] = in add_certificate_file()
487 add_identity_file(Options *options, const char *dir, const char *filename, in add_identity_file() argument
493 if (options->num_identity_files >= SSH_MAX_IDENTITY_FILES) in add_identity_file()
503 for (i = 0; i < options->num_identity_files; i++) { in add_identity_file()
504 if (options->identity_file_userprovided[i] == userprovided && in add_identity_file()
505 strcmp(options->identity_files[i], path) == 0) { in add_identity_file()
512 options->identity_file_userprovided[options->num_identity_files] = in add_identity_file()
514 options->identity_files[options->num_identity_files++] = path; in add_identity_file()
652 match_cfg_line(Options *options, char **condition, struct passwd *pw, in match_cfg_line() argument
666 port = options->port <= 0 ? default_ssh_port() : options->port; in match_cfg_line()
667 ruser = options->user == NULL ? pw->pw_name : options->user; in match_cfg_line()
669 host = xstrdup(options->hostname); in match_cfg_line()
670 } else if (options->hostname != NULL) { in match_cfg_line()
672 host = percent_expand(options->hostname, in match_cfg_line()
762 criteria = xstrdup(options->tag == NULL ? "" : in match_cfg_line()
763 options->tag); in match_cfg_line()
772 jmphost = option_clear_or_none(options->jump_host) ? in match_cfg_line()
773 "" : options->jump_host; in match_cfg_line()
781 keyalias = options->host_key_alias ? in match_cfg_line()
782 options->host_key_alias : host; in match_cfg_line()
845 rm_env(Options *options, const char *arg, const char *filename, int linenum) in rm_env() argument
847 u_int i, j, onum_send_env = options->num_send_env; in rm_env()
850 for (i = 0; i < options->num_send_env; ) { in rm_env()
851 if (!match_pattern(options->send_env[i], arg + 1)) { in rm_env()
856 filename, linenum, options->send_env[i]); in rm_env()
857 free(options->send_env[i]); in rm_env()
858 options->send_env[i] = NULL; in rm_env()
859 for (j = i; j < options->num_send_env - 1; j++) { in rm_env()
860 options->send_env[j] = options->send_env[j + 1]; in rm_env()
861 options->send_env[j + 1] = NULL; in rm_env()
863 options->num_send_env--; in rm_env()
866 if (onum_send_env != options->num_send_env) { in rm_env()
867 options->send_env = xrecallocarray(options->send_env, in rm_env()
868 onum_send_env, options->num_send_env, in rm_env()
869 sizeof(*options->send_env)); in rm_env()
1033 process_config_line(Options *options, struct passwd *pw, const char *host, in process_config_line() argument
1037 return process_config_line_depth(options, pw, host, original_host, in process_config_line()
1043 process_config_line_depth(Options *options, struct passwd *pw, const char *host, in process_config_line_depth() argument
1103 options->ignored_unknown); in process_config_line_depth()
1113 /* don't panic, but count bad options */ in process_config_line_depth()
1124 intptr = &options->connection_timeout; in process_config_line_depth()
1144 intptr = &options->forward_agent; in process_config_line_depth()
1170 charptr = &options->forward_agent_sock_path; in process_config_line_depth()
1174 intptr = &options->forward_x11; in process_config_line_depth()
1190 intptr = &options->forward_x11_trusted; in process_config_line_depth()
1194 intptr = &options->forward_x11_timeout; in process_config_line_depth()
1198 intptr = &options->fwd_opts.gateway_ports; in process_config_line_depth()
1202 intptr = &options->exit_on_forward_failure; in process_config_line_depth()
1206 intptr = &options->password_authentication; in process_config_line_depth()
1210 intptr = &options->kbd_interactive_authentication; in process_config_line_depth()
1214 charptr = &options->kbd_interactive_devices; in process_config_line_depth()
1219 intptr = &options->pubkey_authentication; in process_config_line_depth()
1223 intptr = &options->hostbased_authentication; in process_config_line_depth()
1227 intptr = &options->gss_authentication; in process_config_line_depth()
1231 intptr = &options->gss_deleg_creds; in process_config_line_depth()
1235 intptr = &options->batch_mode; in process_config_line_depth()
1239 intptr = &options->check_host_ip; in process_config_line_depth()
1243 intptr = &options->verify_host_key_dns; in process_config_line_depth()
1248 intptr = &options->strict_host_key_checking; in process_config_line_depth()
1253 intptr = &options->compression; in process_config_line_depth()
1258 intptr = &options->tcp_keep_alive; in process_config_line_depth()
1262 intptr = &options->no_host_authentication_for_localhost; in process_config_line_depth()
1266 intptr = &options->number_of_password_prompts; in process_config_line_depth()
1290 if (*activep && options->rekey_limit == -1) in process_config_line_depth()
1291 options->rekey_limit = val64; in process_config_line_depth()
1297 intptr = &options->rekey_interval; in process_config_line_depth()
1310 intptr = &options->num_identity_files; in process_config_line_depth()
1317 add_identity_file(options, NULL, in process_config_line_depth()
1330 intptr = &options->num_certificate_files; in process_config_line_depth()
1338 add_certificate_file(options, arg, in process_config_line_depth()
1344 charptr=&options->xauth_location; in process_config_line_depth()
1348 charptr = &options->user; in process_config_line_depth()
1361 cpptr = (char **)&options->system_hostfiles; in process_config_line_depth()
1362 uintptr = &options->num_system_hostfiles; in process_config_line_depth()
1396 cpptr = (char **)&options->user_hostfiles; in process_config_line_depth()
1397 uintptr = &options->num_user_hostfiles; in process_config_line_depth()
1402 charptr = &options->hostname; in process_config_line_depth()
1406 charptr = &options->tag; in process_config_line_depth()
1410 charptr = &options->host_key_alias; in process_config_line_depth()
1414 charptr = &options->preferred_authentications; in process_config_line_depth()
1418 charptr = &options->bind_address; in process_config_line_depth()
1422 charptr = &options->bind_interface; in process_config_line_depth()
1426 charptr = &options->pkcs11_provider; in process_config_line_depth()
1430 charptr = &options->sk_provider; in process_config_line_depth()
1434 charptr = &options->known_hosts_command; in process_config_line_depth()
1438 charptr = &options->proxy_command; in process_config_line_depth()
1440 if (options->jump_host != NULL) in process_config_line_depth()
1441 charptr = &options->jump_host; /* Skip below */ in process_config_line_depth()
1462 if (parse_jump(str + len, options, *activep) == -1) { in process_config_line_depth()
1483 if (*activep && options->port == -1) in process_config_line_depth()
1484 options->port = value; in process_config_line_depth()
1488 intptr = &options->connection_attempts; in process_config_line_depth()
1513 if (*activep && options->ciphers == NULL) in process_config_line_depth()
1514 options->ciphers = xstrdup(arg); in process_config_line_depth()
1530 if (*activep && options->macs == NULL) in process_config_line_depth()
1531 options->macs = xstrdup(arg); in process_config_line_depth()
1548 if (*activep && options->kex_algorithms == NULL) in process_config_line_depth()
1549 options->kex_algorithms = xstrdup(arg); in process_config_line_depth()
1553 charptr = &options->hostkeyalgorithms; in process_config_line_depth()
1574 charptr = &options->ca_sign_algorithms; in process_config_line_depth()
1579 log_level_ptr = &options->log_level; in process_config_line_depth()
1592 log_facility_ptr = &options->log_facility; in process_config_line_depth()
1605 cppptr = &options->log_verbose; in process_config_line_depth()
1606 uintptr = &options->num_log_verbose; in process_config_line_depth()
1672 add_remote_forward(options, &fwd); in process_config_line_depth()
1674 add_local_forward(options, &fwd); in process_config_line_depth()
1680 uintptr = &options->num_permitted_remote_opens; in process_config_line_depth()
1681 cppptr = &options->permitted_remote_opens; in process_config_line_depth()
1731 intptr = &options->clear_forwardings; in process_config_line_depth()
1771 debug("%.200s line %d: Applying options for %.100s", in process_config_line_depth()
1781 value = match_cfg_line(options, &str, pw, host, original_host, in process_config_line_depth()
1800 intptr = &options->escape_char; in process_config_line_depth()
1824 intptr = &options->address_family; in process_config_line_depth()
1829 intptr = &options->enable_ssh_keysign; in process_config_line_depth()
1833 intptr = &options->identities_only; in process_config_line_depth()
1837 intptr = &options->server_alive_interval; in process_config_line_depth()
1841 intptr = &options->server_alive_count_max; in process_config_line_depth()
1857 rm_env(options, arg, filename, linenum); in process_config_line_depth()
1862 &options->send_env, &options->num_send_env, arg); in process_config_line_depth()
1871 found = options->num_setenv == 0; in process_config_line_depth()
1892 options->setenv = strs; in process_config_line_depth()
1893 options->num_setenv = nstrs; in process_config_line_depth()
1900 charptr = &options->control_path; in process_config_line_depth()
1904 intptr = &options->control_master; in process_config_line_depth()
1910 intptr = &options->control_persist; in process_config_line_depth()
1932 options->control_persist_timeout = value2; in process_config_line_depth()
1937 intptr = &options->hash_known_hosts; in process_config_line_depth()
1941 intptr = &options->tun_open; in process_config_line_depth()
1958 if (*activep && options->tun_local == -1) { in process_config_line_depth()
1959 options->tun_local = value; in process_config_line_depth()
1960 options->tun_remote = value2; in process_config_line_depth()
1965 charptr = &options->local_command; in process_config_line_depth()
1969 intptr = &options->permit_local_command; in process_config_line_depth()
1973 charptr = &options->remote_command; in process_config_line_depth()
1977 intptr = &options->visual_host_key; in process_config_line_depth()
2031 pw, host, original_host, options, in process_config_line_depth()
2071 if (*activep && options->ip_qos_interactive == -1) { in process_config_line_depth()
2072 options->ip_qos_interactive = value; in process_config_line_depth()
2073 options->ip_qos_bulk = value2; in process_config_line_depth()
2078 intptr = &options->request_tty; in process_config_line_depth()
2083 intptr = &options->session_type; in process_config_line_depth()
2088 intptr = &options->stdin_null; in process_config_line_depth()
2092 intptr = &options->fork_after_authentication; in process_config_line_depth()
2096 charptr = &options->ignored_unknown; in process_config_line_depth()
2100 intptr = &options->proxy_use_fdpass; in process_config_line_depth()
2104 found = options->num_canonical_domains == 0; in process_config_line_depth()
2128 options->canonical_domains = strs; in process_config_line_depth()
2129 options->num_canonical_domains = nstrs; in process_config_line_depth()
2136 found = options->num_permitted_cnames == 0; in process_config_line_depth()
2175 options->permitted_cnames = cnames; in process_config_line_depth()
2176 options->num_permitted_cnames = ncnames; in process_config_line_depth()
2184 intptr = &options->canonicalize_hostname; in process_config_line_depth()
2189 intptr = &options->canonicalize_max_dots; in process_config_line_depth()
2193 intptr = &options->canonicalize_fallback_local; in process_config_line_depth()
2209 options->fwd_opts.streamlocal_bind_mask = (mode_t)value; in process_config_line_depth()
2213 intptr = &options->fwd_opts.streamlocal_bind_unlink; in process_config_line_depth()
2217 charptr = &options->revoked_host_keys; in process_config_line_depth()
2221 intptr = &options->fingerprint_hash; in process_config_line_depth()
2238 intptr = &options->update_hostkeys; in process_config_line_depth()
2243 charptr = &options->hostbased_accepted_algos; in process_config_line_depth()
2248 charptr = &options->pubkey_accepted_algos; in process_config_line_depth()
2277 if (*activep && options->add_keys_to_agent == -1) { in process_config_line_depth()
2278 options->add_keys_to_agent = value; in process_config_line_depth()
2279 options->add_keys_to_agent_lifespan = value2; in process_config_line_depth()
2284 charptr = &options->identity_agent; in process_config_line_depth()
2311 intptr = &options->enable_escape_commandline; in process_config_line_depth()
2315 intptr = &options->required_rsa_size; in process_config_line_depth()
2355 intptr = &options->obscure_keystroke_timing_interval; in process_config_line_depth()
2361 found = options->num_channel_timeouts == 0; in process_config_line_depth()
2384 options->channel_timeouts = strs; in process_config_line_depth()
2385 options->num_channel_timeouts = nstrs; in process_config_line_depth()
2426 * Reads the config file and modifies the options accordingly. Options
2432 const char *original_host, Options *options, int flags, in read_config_file() argument
2438 options, flags, &active, want_final_pass, 0); in read_config_file()
2444 const char *host, const char *original_host, Options *options, in read_config_file_depth() argument
2472 * Mark that we are now processing the options. This flag is turned in read_config_file_depth()
2484 if (process_config_line_depth(options, pw, host, original_host, in read_config_file_depth()
2492 fatal("%s: terminating, %d bad configuration options", in read_config_file_depth()
2509 config_has_permitted_cnames(Options *options) in config_has_permitted_cnames() argument
2511 if (options->num_permitted_cnames == 1 && in config_has_permitted_cnames()
2512 strcasecmp(options->permitted_cnames[0].source_list, "none") == 0 && in config_has_permitted_cnames()
2513 strcmp(options->permitted_cnames[0].target_list, "") == 0) in config_has_permitted_cnames()
2515 return options->num_permitted_cnames > 0; in config_has_permitted_cnames()
2519 * Initializes options to special values that indicate that they have not yet
2520 * been set. Read_config_file will only set options with this value. Options
2526 initialize_options(Options * options) in initialize_options() argument
2528 memset(options, 'X', sizeof(*options)); in initialize_options()
2529 options->host_arg = NULL; in initialize_options()
2530 options->forward_agent = -1; in initialize_options()
2531 options->forward_agent_sock_path = NULL; in initialize_options()
2532 options->forward_x11 = -1; in initialize_options()
2533 options->forward_x11_trusted = -1; in initialize_options()
2534 options->forward_x11_timeout = -1; in initialize_options()
2535 options->stdio_forward_host = NULL; in initialize_options()
2536 options->stdio_forward_port = 0; in initialize_options()
2537 options->clear_forwardings = -1; in initialize_options()
2538 options->exit_on_forward_failure = -1; in initialize_options()
2539 options->xauth_location = NULL; in initialize_options()
2540 options->fwd_opts.gateway_ports = -1; in initialize_options()
2541 options->fwd_opts.streamlocal_bind_mask = (mode_t)-1; in initialize_options()
2542 options->fwd_opts.streamlocal_bind_unlink = -1; in initialize_options()
2543 options->pubkey_authentication = -1; in initialize_options()
2544 options->gss_authentication = -1; in initialize_options()
2545 options->gss_deleg_creds = -1; in initialize_options()
2546 options->password_authentication = -1; in initialize_options()
2547 options->kbd_interactive_authentication = -1; in initialize_options()
2548 options->kbd_interactive_devices = NULL; in initialize_options()
2549 options->hostbased_authentication = -1; in initialize_options()
2550 options->batch_mode = -1; in initialize_options()
2551 options->check_host_ip = -1; in initialize_options()
2552 options->strict_host_key_checking = -1; in initialize_options()
2553 options->compression = -1; in initialize_options()
2554 options->tcp_keep_alive = -1; in initialize_options()
2555 options->port = -1; in initialize_options()
2556 options->address_family = -1; in initialize_options()
2557 options->connection_attempts = -1; in initialize_options()
2558 options->connection_timeout = -1; in initialize_options()
2559 options->number_of_password_prompts = -1; in initialize_options()
2560 options->ciphers = NULL; in initialize_options()
2561 options->macs = NULL; in initialize_options()
2562 options->kex_algorithms = NULL; in initialize_options()
2563 options->hostkeyalgorithms = NULL; in initialize_options()
2564 options->ca_sign_algorithms = NULL; in initialize_options()
2565 options->num_identity_files = 0; in initialize_options()
2566 memset(options->identity_keys, 0, sizeof(options->identity_keys)); in initialize_options()
2567 options->num_certificate_files = 0; in initialize_options()
2568 memset(options->certificates, 0, sizeof(options->certificates)); in initialize_options()
2569 options->hostname = NULL; in initialize_options()
2570 options->host_key_alias = NULL; in initialize_options()
2571 options->proxy_command = NULL; in initialize_options()
2572 options->jump_user = NULL; in initialize_options()
2573 options->jump_host = NULL; in initialize_options()
2574 options->jump_port = -1; in initialize_options()
2575 options->jump_extra = NULL; in initialize_options()
2576 options->user = NULL; in initialize_options()
2577 options->escape_char = -1; in initialize_options()
2578 options->num_system_hostfiles = 0; in initialize_options()
2579 options->num_user_hostfiles = 0; in initialize_options()
2580 options->local_forwards = NULL; in initialize_options()
2581 options->num_local_forwards = 0; in initialize_options()
2582 options->remote_forwards = NULL; in initialize_options()
2583 options->num_remote_forwards = 0; in initialize_options()
2584 options->permitted_remote_opens = NULL; in initialize_options()
2585 options->num_permitted_remote_opens = 0; in initialize_options()
2586 options->log_facility = SYSLOG_FACILITY_NOT_SET; in initialize_options()
2587 options->log_level = SYSLOG_LEVEL_NOT_SET; in initialize_options()
2588 options->num_log_verbose = 0; in initialize_options()
2589 options->log_verbose = NULL; in initialize_options()
2590 options->preferred_authentications = NULL; in initialize_options()
2591 options->bind_address = NULL; in initialize_options()
2592 options->bind_interface = NULL; in initialize_options()
2593 options->pkcs11_provider = NULL; in initialize_options()
2594 options->sk_provider = NULL; in initialize_options()
2595 options->enable_ssh_keysign = - 1; in initialize_options()
2596 options->no_host_authentication_for_localhost = - 1; in initialize_options()
2597 options->identities_only = - 1; in initialize_options()
2598 options->rekey_limit = - 1; in initialize_options()
2599 options->rekey_interval = -1; in initialize_options()
2600 options->verify_host_key_dns = -1; in initialize_options()
2601 options->server_alive_interval = -1; in initialize_options()
2602 options->server_alive_count_max = -1; in initialize_options()
2603 options->send_env = NULL; in initialize_options()
2604 options->num_send_env = 0; in initialize_options()
2605 options->setenv = NULL; in initialize_options()
2606 options->num_setenv = 0; in initialize_options()
2607 options->control_path = NULL; in initialize_options()
2608 options->control_master = -1; in initialize_options()
2609 options->control_persist = -1; in initialize_options()
2610 options->control_persist_timeout = 0; in initialize_options()
2611 options->hash_known_hosts = -1; in initialize_options()
2612 options->tun_open = -1; in initialize_options()
2613 options->tun_local = -1; in initialize_options()
2614 options->tun_remote = -1; in initialize_options()
2615 options->local_command = NULL; in initialize_options()
2616 options->permit_local_command = -1; in initialize_options()
2617 options->remote_command = NULL; in initialize_options()
2618 options->add_keys_to_agent = -1; in initialize_options()
2619 options->add_keys_to_agent_lifespan = -1; in initialize_options()
2620 options->identity_agent = NULL; in initialize_options()
2621 options->visual_host_key = -1; in initialize_options()
2622 options->ip_qos_interactive = -1; in initialize_options()
2623 options->ip_qos_bulk = -1; in initialize_options()
2624 options->request_tty = -1; in initialize_options()
2625 options->session_type = -1; in initialize_options()
2626 options->stdin_null = -1; in initialize_options()
2627 options->fork_after_authentication = -1; in initialize_options()
2628 options->proxy_use_fdpass = -1; in initialize_options()
2629 options->ignored_unknown = NULL; in initialize_options()
2630 options->num_canonical_domains = 0; in initialize_options()
2631 options->num_permitted_cnames = 0; in initialize_options()
2632 options->canonicalize_max_dots = -1; in initialize_options()
2633 options->canonicalize_fallback_local = -1; in initialize_options()
2634 options->canonicalize_hostname = -1; in initialize_options()
2635 options->revoked_host_keys = NULL; in initialize_options()
2636 options->fingerprint_hash = -1; in initialize_options()
2637 options->update_hostkeys = -1; in initialize_options()
2638 options->hostbased_accepted_algos = NULL; in initialize_options()
2639 options->pubkey_accepted_algos = NULL; in initialize_options()
2640 options->known_hosts_command = NULL; in initialize_options()
2641 options->required_rsa_size = -1; in initialize_options()
2642 options->enable_escape_commandline = -1; in initialize_options()
2643 options->obscure_keystroke_timing_interval = -1; in initialize_options()
2644 options->tag = NULL; in initialize_options()
2645 options->channel_timeouts = NULL; in initialize_options()
2646 options->num_channel_timeouts = 0; in initialize_options()
2650 * A petite version of fill_default_options() that just fills the options
2654 fill_default_options_for_canonicalization(Options *options) in fill_default_options_for_canonicalization() argument
2656 if (options->canonicalize_max_dots == -1) in fill_default_options_for_canonicalization()
2657 options->canonicalize_max_dots = 1; in fill_default_options_for_canonicalization()
2658 if (options->canonicalize_fallback_local == -1) in fill_default_options_for_canonicalization()
2659 options->canonicalize_fallback_local = 1; in fill_default_options_for_canonicalization()
2660 if (options->canonicalize_hostname == -1) in fill_default_options_for_canonicalization()
2661 options->canonicalize_hostname = SSH_CANONICALISE_NO; in fill_default_options_for_canonicalization()
2666 * options for which no value has been specified with their default values.
2669 fill_default_options(Options * options) in fill_default_options() argument
2675 if (options->forward_agent == -1) in fill_default_options()
2676 options->forward_agent = 0; in fill_default_options()
2677 if (options->forward_x11 == -1) in fill_default_options()
2678 options->forward_x11 = 0; in fill_default_options()
2679 if (options->forward_x11_trusted == -1) in fill_default_options()
2680 options->forward_x11_trusted = 0; in fill_default_options()
2681 if (options->forward_x11_timeout == -1) in fill_default_options()
2682 options->forward_x11_timeout = 1200; in fill_default_options()
2687 if (options->exit_on_forward_failure == -1) in fill_default_options()
2688 options->exit_on_forward_failure = in fill_default_options()
2689 options->stdio_forward_host != NULL ? 1 : 0; in fill_default_options()
2690 if (options->clear_forwardings == -1) in fill_default_options()
2691 options->clear_forwardings = in fill_default_options()
2692 options->stdio_forward_host != NULL ? 1 : 0; in fill_default_options()
2693 if (options->clear_forwardings == 1) in fill_default_options()
2694 clear_forwardings(options); in fill_default_options()
2696 if (options->xauth_location == NULL) in fill_default_options()
2697 options->xauth_location = xstrdup(_PATH_XAUTH); in fill_default_options()
2698 if (options->fwd_opts.gateway_ports == -1) in fill_default_options()
2699 options->fwd_opts.gateway_ports = 0; in fill_default_options()
2700 if (options->fwd_opts.streamlocal_bind_mask == (mode_t)-1) in fill_default_options()
2701 options->fwd_opts.streamlocal_bind_mask = 0177; in fill_default_options()
2702 if (options->fwd_opts.streamlocal_bind_unlink == -1) in fill_default_options()
2703 options->fwd_opts.streamlocal_bind_unlink = 0; in fill_default_options()
2704 if (options->pubkey_authentication == -1) in fill_default_options()
2705 options->pubkey_authentication = SSH_PUBKEY_AUTH_ALL; in fill_default_options()
2706 if (options->gss_authentication == -1) in fill_default_options()
2707 options->gss_authentication = 0; in fill_default_options()
2708 if (options->gss_deleg_creds == -1) in fill_default_options()
2709 options->gss_deleg_creds = 0; in fill_default_options()
2710 if (options->password_authentication == -1) in fill_default_options()
2711 options->password_authentication = 1; in fill_default_options()
2712 if (options->kbd_interactive_authentication == -1) in fill_default_options()
2713 options->kbd_interactive_authentication = 1; in fill_default_options()
2714 if (options->hostbased_authentication == -1) in fill_default_options()
2715 options->hostbased_authentication = 0; in fill_default_options()
2716 if (options->batch_mode == -1) in fill_default_options()
2717 options->batch_mode = 0; in fill_default_options()
2718 if (options->check_host_ip == -1) in fill_default_options()
2719 options->check_host_ip = 0; in fill_default_options()
2720 if (options->strict_host_key_checking == -1) in fill_default_options()
2721 options->strict_host_key_checking = SSH_STRICT_HOSTKEY_ASK; in fill_default_options()
2722 if (options->compression == -1) in fill_default_options()
2723 options->compression = 0; in fill_default_options()
2724 if (options->tcp_keep_alive == -1) in fill_default_options()
2725 options->tcp_keep_alive = 1; in fill_default_options()
2726 if (options->port == -1) in fill_default_options()
2727 options->port = 0; /* Filled in ssh_connect. */ in fill_default_options()
2728 if (options->address_family == -1) in fill_default_options()
2729 options->address_family = AF_UNSPEC; in fill_default_options()
2730 if (options->connection_attempts == -1) in fill_default_options()
2731 options->connection_attempts = 1; in fill_default_options()
2732 if (options->number_of_password_prompts == -1) in fill_default_options()
2733 options->number_of_password_prompts = 3; in fill_default_options()
2734 /* options->hostkeyalgorithms, default set in myproposals.h */ in fill_default_options()
2735 if (options->add_keys_to_agent == -1) { in fill_default_options()
2736 options->add_keys_to_agent = 0; in fill_default_options()
2737 options->add_keys_to_agent_lifespan = 0; in fill_default_options()
2739 if (options->num_identity_files == 0) { in fill_default_options()
2740 add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_RSA, 0); in fill_default_options()
2742 add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_ECDSA, 0); in fill_default_options()
2743 add_identity_file(options, "~/", in fill_default_options()
2746 add_identity_file(options, "~/", in fill_default_options()
2748 add_identity_file(options, "~/", in fill_default_options()
2750 add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_XMSS, 0); in fill_default_options()
2752 add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_DSA, 0); in fill_default_options()
2755 if (options->escape_char == -1) in fill_default_options()
2756 options->escape_char = '~'; in fill_default_options()
2757 if (options->num_system_hostfiles == 0) { in fill_default_options()
2758 options->system_hostfiles[options->num_system_hostfiles++] = in fill_default_options()
2760 options->system_hostfiles[options->num_system_hostfiles++] = in fill_default_options()
2763 if (options->update_hostkeys == -1) { in fill_default_options()
2764 if (options->verify_host_key_dns <= 0 && in fill_default_options()
2765 (options->num_user_hostfiles == 0 || in fill_default_options()
2766 (options->num_user_hostfiles == 1 && strcmp(options-> in fill_default_options()
2768 options->update_hostkeys = SSH_UPDATE_HOSTKEYS_YES; in fill_default_options()
2770 options->update_hostkeys = SSH_UPDATE_HOSTKEYS_NO; in fill_default_options()
2772 if (options->num_user_hostfiles == 0) { in fill_default_options()
2773 options->user_hostfiles[options->num_user_hostfiles++] = in fill_default_options()
2775 options->user_hostfiles[options->num_user_hostfiles++] = in fill_default_options()
2778 if (options->log_level == SYSLOG_LEVEL_NOT_SET) in fill_default_options()
2779 options->log_level = SYSLOG_LEVEL_INFO; in fill_default_options()
2780 if (options->log_facility == SYSLOG_FACILITY_NOT_SET) in fill_default_options()
2781 options->log_facility = SYSLOG_FACILITY_USER; in fill_default_options()
2782 if (options->no_host_authentication_for_localhost == - 1) in fill_default_options()
2783 options->no_host_authentication_for_localhost = 0; in fill_default_options()
2784 if (options->identities_only == -1) in fill_default_options()
2785 options->identities_only = 0; in fill_default_options()
2786 if (options->enable_ssh_keysign == -1) in fill_default_options()
2787 options->enable_ssh_keysign = 0; in fill_default_options()
2788 if (options->rekey_limit == -1) in fill_default_options()
2789 options->rekey_limit = 0; in fill_default_options()
2790 if (options->rekey_interval == -1) in fill_default_options()
2791 options->rekey_interval = 0; in fill_default_options()
2792 if (options->verify_host_key_dns == -1) in fill_default_options()
2793 options->verify_host_key_dns = 0; in fill_default_options()
2794 if (options->server_alive_interval == -1) in fill_default_options()
2795 options->server_alive_interval = 0; in fill_default_options()
2796 if (options->server_alive_count_max == -1) in fill_default_options()
2797 options->server_alive_count_max = 3; in fill_default_options()
2798 if (options->control_master == -1) in fill_default_options()
2799 options->control_master = 0; in fill_default_options()
2800 if (options->control_persist == -1) { in fill_default_options()
2801 options->control_persist = 0; in fill_default_options()
2802 options->control_persist_timeout = 0; in fill_default_options()
2804 if (options->hash_known_hosts == -1) in fill_default_options()
2805 options->hash_known_hosts = 0; in fill_default_options()
2806 if (options->tun_open == -1) in fill_default_options()
2807 options->tun_open = SSH_TUNMODE_NO; in fill_default_options()
2808 if (options->tun_local == -1) in fill_default_options()
2809 options->tun_local = SSH_TUNID_ANY; in fill_default_options()
2810 if (options->tun_remote == -1) in fill_default_options()
2811 options->tun_remote = SSH_TUNID_ANY; in fill_default_options()
2812 if (options->permit_local_command == -1) in fill_default_options()
2813 options->permit_local_command = 0; in fill_default_options()
2814 if (options->visual_host_key == -1) in fill_default_options()
2815 options->visual_host_key = 0; in fill_default_options()
2816 if (options->ip_qos_interactive == -1) in fill_default_options()
2817 options->ip_qos_interactive = IPTOS_DSCP_AF21; in fill_default_options()
2818 if (options->ip_qos_bulk == -1) in fill_default_options()
2819 options->ip_qos_bulk = IPTOS_DSCP_CS1; in fill_default_options()
2820 if (options->request_tty == -1) in fill_default_options()
2821 options->request_tty = REQUEST_TTY_AUTO; in fill_default_options()
2822 if (options->session_type == -1) in fill_default_options()
2823 options->session_type = SESSION_TYPE_DEFAULT; in fill_default_options()
2824 if (options->stdin_null == -1) in fill_default_options()
2825 options->stdin_null = 0; in fill_default_options()
2826 if (options->fork_after_authentication == -1) in fill_default_options()
2827 options->fork_after_authentication = 0; in fill_default_options()
2828 if (options->proxy_use_fdpass == -1) in fill_default_options()
2829 options->proxy_use_fdpass = 0; in fill_default_options()
2830 if (options->canonicalize_max_dots == -1) in fill_default_options()
2831 options->canonicalize_max_dots = 1; in fill_default_options()
2832 if (options->canonicalize_fallback_local == -1) in fill_default_options()
2833 options->canonicalize_fallback_local = 1; in fill_default_options()
2834 if (options->canonicalize_hostname == -1) in fill_default_options()
2835 options->canonicalize_hostname = SSH_CANONICALISE_NO; in fill_default_options()
2836 if (options->fingerprint_hash == -1) in fill_default_options()
2837 options->fingerprint_hash = SSH_FP_HASH_DEFAULT; in fill_default_options()
2839 if (options->sk_provider == NULL) in fill_default_options()
2840 options->sk_provider = xstrdup("internal"); in fill_default_options()
2842 if (options->sk_provider == NULL) in fill_default_options()
2843 options->sk_provider = xstrdup("$SSH_SK_PROVIDER"); in fill_default_options()
2845 if (options->required_rsa_size == -1) in fill_default_options()
2846 options->required_rsa_size = SSH_RSA_MINIMUM_MODULUS_SIZE; in fill_default_options()
2847 if (options->enable_escape_commandline == -1) in fill_default_options()
2848 options->enable_escape_commandline = 0; in fill_default_options()
2849 if (options->obscure_keystroke_timing_interval == -1) { in fill_default_options()
2850 options->obscure_keystroke_timing_interval = in fill_default_options()
2868 if ((r = kex_assemble_names(&options->what, \ in fill_default_options()
2891 if (options->nv == 1 && \ in fill_default_options()
2892 strcasecmp(options->v[0], none) == 0) { \ in fill_default_options()
2893 free(options->v[0]); \ in fill_default_options()
2894 free(options->v); \ in fill_default_options()
2895 options->v = NULL; \ in fill_default_options()
2896 options->nv = 0; \ in fill_default_options()
2899 CLEAR_ON_NONE(options->local_command); in fill_default_options()
2900 CLEAR_ON_NONE(options->remote_command); in fill_default_options()
2901 CLEAR_ON_NONE(options->proxy_command); in fill_default_options()
2902 CLEAR_ON_NONE(options->control_path); in fill_default_options()
2903 CLEAR_ON_NONE(options->revoked_host_keys); in fill_default_options()
2904 CLEAR_ON_NONE(options->pkcs11_provider); in fill_default_options()
2905 CLEAR_ON_NONE(options->sk_provider); in fill_default_options()
2906 CLEAR_ON_NONE(options->known_hosts_command); in fill_default_options()
2910 if (options->jump_host != NULL && in fill_default_options()
2911 strcmp(options->jump_host, "none") == 0 && in fill_default_options()
2912 options->jump_port == 0 && options->jump_user == NULL) { in fill_default_options()
2913 free(options->jump_host); in fill_default_options()
2914 options->jump_host = NULL; in fill_default_options()
2916 if (options->num_permitted_cnames == 1 && in fill_default_options()
2917 !config_has_permitted_cnames(options)) { in fill_default_options()
2919 free(options->permitted_cnames[0].source_list); in fill_default_options()
2920 free(options->permitted_cnames[0].target_list); in fill_default_options()
2921 memset(options->permitted_cnames, '\0', in fill_default_options()
2922 sizeof(*options->permitted_cnames)); in fill_default_options()
2923 options->num_permitted_cnames = 0; in fill_default_options()
2925 /* options->identity_agent distinguishes NULL from 'none' */ in fill_default_options()
2926 /* options->user will be set in the main program if appropriate */ in fill_default_options()
2927 /* options->hostname will be set in the main program if appropriate */ in fill_default_options()
2928 /* options->host_key_alias should not be set by default */ in fill_default_options()
2929 /* options->preferred_authentications will be set in ssh */ in fill_default_options()
2948 free_options(Options *o) in free_options()
3249 parse_jump(const char *s, Options *o, int active) in parse_jump()
3496 dump_client_config(Options *o, const char *host) in dump_client_config()
3513 /* Most interesting options first: user, host, port */ in dump_client_config()
3519 /* Flag options */ in dump_client_config()
3560 /* Integer options */ in dump_client_config()
3571 /* String options */ in dump_client_config()
3604 /* String array options */ in dump_client_config()