Lines Matching full:options
155 * General data structure for command line options and options configurable
158 Options options; variable
243 * Expands the set of percent_expand options used by the majority of keywords
266 * NB. this function must operate with a options having undefined members.
283 hints.ai_family = options.address_family == -1 ? in resolve_host()
284 AF_UNSPEC : options.address_family; in resolve_host()
326 hints.ai_family = options.address_family == -1 ? in is_addr()
327 AF_UNSPEC : options.address_family; in is_addr()
344 * NB. this function must operate with a options having undefined members.
357 hints.ai_family = options.address_family == -1 ? in resolve_addr()
358 AF_UNSPEC : options.address_family; in resolve_addr()
397 * NB. this function must operate with a options having undefined members.
405 if (*cname == '\0' || options.num_permitted_cnames == 0 || in check_follow_cname()
408 if (options.canonicalize_hostname == SSH_CANONICALISE_NO) in check_follow_cname()
415 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS) in check_follow_cname()
418 for (i = 0; i < options.num_permitted_cnames; i++) { in check_follow_cname()
419 rule = options.permitted_cnames + i; in check_follow_cname()
436 * NB. this function must operate with a options having undefined members.
472 if (options.canonicalize_hostname == SSH_CANONICALISE_NO) in resolve_canonicalize()
479 direct = option_clear_or_none(options.proxy_command) && in resolve_canonicalize()
480 options.jump_host == NULL; in resolve_canonicalize()
482 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS) in resolve_canonicalize()
502 if (ndots > options.canonicalize_max_dots) { in resolve_canonicalize()
504 __func__, *hostp, options.canonicalize_max_dots); in resolve_canonicalize()
508 for (i = 0; i < options.num_canonical_domains; i++) { in resolve_canonicalize()
510 options.canonical_domains[i]); in resolve_canonicalize()
531 if (!options.canonicalize_fallback_local) in resolve_canonicalize()
574 !read_config_file(config, pw, host, host_name, &options, in process_config_files()
584 &options, SSHCONF_CHECKPERM | SSHCONF_USERCONF | in process_config_files()
589 host, host_name, &options, in process_config_files()
680 initialize_options(&options); in main()
706 options.address_family = AF_INET; in main()
709 options.address_family = AF_INET6; in main()
719 options.forward_x11 = 0; in main()
722 options.forward_x11 = 1; in main()
734 options.forward_x11 = 1; in main()
735 options.forward_x11_trusted = 1; in main()
738 options.fwd_opts.gateway_ports = 1; in main()
741 if (options.stdio_forward_host != NULL) in main()
811 options.forward_agent = 0; in main()
814 options.forward_agent = 1; in main()
817 options.gss_deleg_creds = 0; in main()
820 options.gss_authentication = 1; in main()
821 options.gss_deleg_creds = 1; in main()
830 add_identity_file(&options, NULL, p, 1); in main()
835 free(options.pkcs11_provider); in main()
836 options.pkcs11_provider = xstrdup(optarg); in main()
842 if (options.jump_host != NULL) { in main()
847 if (options.proxy_command != NULL) in main()
849 if (parse_jump(optarg, &options, 1) == -1) in main()
851 options.proxy_command = xstrdup("none"); in main()
854 if (options.request_tty == REQUEST_TTY_YES) in main()
855 options.request_tty = REQUEST_TTY_FORCE; in main()
857 options.request_tty = REQUEST_TTY_YES; in main()
862 options.log_level = SYSLOG_LEVEL_DEBUG1; in main()
864 if (options.log_level < SYSLOG_LEVEL_DEBUG3) { in main()
866 options.log_level++; in main()
883 if (options.tun_open == -1) in main()
884 options.tun_open = SSH_TUNMODE_DEFAULT; in main()
885 options.tun_local = a2tun(optarg, &options.tun_remote); in main()
886 if (options.tun_local == SSH_TUNID_ERR) { in main()
893 if (options.stdio_forward_host != NULL) in main()
898 options.stdio_forward_host = fwd.listen_host; in main()
899 options.stdio_forward_port = fwd.listen_port; in main()
907 options.request_tty = REQUEST_TTY_NO; in main()
911 options.log_level = SYSLOG_LEVEL_QUIET; in main()
917 options.escape_char = (u_char) optarg[1] & 31; in main()
919 options.escape_char = (u_char) optarg[0]; in main()
921 options.escape_char = SSH_ESCAPECHAR_NONE; in main()
935 free(options.ciphers); in main()
936 options.ciphers = xstrdup(optarg); in main()
940 free(options.macs); in main()
941 options.macs = xstrdup(optarg); in main()
949 if (options.control_master == SSHCTL_MASTER_YES) in main()
950 options.control_master = SSHCTL_MASTER_ASK; in main()
952 options.control_master = SSHCTL_MASTER_YES; in main()
955 if (options.port == -1) { in main()
956 options.port = a2port(optarg); in main()
957 if (options.port <= 0) { in main()
965 if (options.user == NULL) in main()
966 options.user = optarg; in main()
971 add_local_forward(&options, &fwd); in main()
983 add_remote_forward(&options, &fwd); in main()
994 add_local_forward(&options, &fwd); in main()
1005 options.compression = 1; in main()
1012 options.request_tty = REQUEST_TTY_NO; in main()
1015 options.request_tty = REQUEST_TTY_NO; in main()
1019 if (process_config_line(&options, pw, in main()
1029 free(options.control_path); in main()
1030 options.control_path = xstrdup(optarg); in main()
1033 options.bind_address = optarg; in main()
1036 options.bind_interface = optarg; in main()
1060 if (options.user == NULL) { in main()
1061 options.user = tuser; in main()
1065 if (options.port == -1 && tport != -1) in main()
1066 options.port = tport; in main()
1074 if (options.user == NULL) { in main()
1075 options.user = p; in main()
1133 options.log_level == SYSLOG_LEVEL_NOT_SET ? in main()
1134 SYSLOG_LEVEL_INFO : options.log_level, in main()
1135 options.log_facility == SYSLOG_FACILITY_NOT_SET ? in main()
1136 SYSLOG_FACILITY_USER : options.log_facility, in main()
1153 /* Hostname canonicalisation needs a few options filled. */ in main()
1154 fill_default_options_for_canonicalization(&options); in main()
1157 if (options.hostname != NULL) { in main()
1159 cp = percent_expand(options.hostname, in main()
1163 free(options.hostname); in main()
1164 options.hostname = xstrdup(host); in main()
1175 if (options.canonicalize_hostname != SSH_CANONICALISE_NO || was_addr) in main()
1176 addrs = resolve_canonicalize(&host, options.port); in main()
1191 direct = option_clear_or_none(options.proxy_command) && in main()
1192 options.jump_host == NULL; in main()
1193 if (addrs == NULL && options.num_permitted_cnames != 0 && (direct || in main()
1194 options.canonicalize_hostname == SSH_CANONICALISE_ALWAYS)) { in main()
1195 if ((addrs = resolve_host(host, options.port, in main()
1208 if (options.canonicalize_hostname != 0 && !want_final_pass) { in main()
1216 free(options.hostname); in main()
1217 options.hostname = xstrdup(host); in main()
1224 if (addrs != NULL && options.port > 0) in main()
1225 set_addrinfo_port(addrs, options.port); in main()
1229 fill_default_options(&options); in main()
1234 if (options.jump_host != NULL) { in main()
1237 int port = options.port, jumpport = options.jump_port; in main()
1243 if (strcmp(options.jump_host, host) == 0 && port == jumpport) in main()
1244 fatal("jumphost loop via %s", options.jump_host); in main()
1254 if (options.proxy_command != NULL) in main()
1255 fatal("inconsistent options: ProxyCommand+ProxyJump"); in main()
1257 options.proxy_use_fdpass = 0; in main()
1258 snprintf(port_s, sizeof(port_s), "%d", options.jump_port); in main()
1259 xasprintf(&options.proxy_command, in main()
1263 options.jump_user == NULL ? "" : " -l ", in main()
1264 options.jump_user == NULL ? "" : options.jump_user, in main()
1266 options.jump_port <= 0 ? "" : " -p ", in main()
1267 options.jump_port <= 0 ? "" : port_s, in main()
1269 options.jump_extra == NULL ? "" : " -J ", in main()
1270 options.jump_extra == NULL ? "" : options.jump_extra, in main()
1278 options.jump_host); in main()
1280 options.proxy_command); in main()
1283 if (options.port == 0) in main()
1284 options.port = default_ssh_port(); in main()
1285 channel_set_af(ssh, options.address_family); in main()
1287 /* Tidy and check options */ in main()
1288 if (options.host_key_alias != NULL) in main()
1289 lowercase(options.host_key_alias); in main()
1290 if (options.proxy_command != NULL && in main()
1291 strcmp(options.proxy_command, "-") == 0 && in main()
1292 options.proxy_use_fdpass) in main()
1294 if (options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK) { in main()
1295 if (options.control_persist && options.control_path != NULL) { in main()
1298 options.update_hostkeys = 0; in main()
1300 options.remote_command != NULL || in main()
1301 options.request_tty == REQUEST_TTY_NO) { in main()
1304 options.update_hostkeys = 0; in main()
1305 } else if (options.log_level < SYSLOG_LEVEL_INFO) { in main()
1307 options.update_hostkeys = 0; in main()
1310 if (options.connection_attempts <= 0) in main()
1313 if (sshbuf_len(command) != 0 && options.remote_command != NULL) in main()
1318 options.remote_command == NULL && !no_shell_flag) in main()
1323 log_init(argv0, options.log_level, options.log_facility, !use_syslog); in main()
1325 if (options.request_tty == REQUEST_TTY_YES || in main()
1326 options.request_tty == REQUEST_TTY_FORCE) in main()
1330 if (sshbuf_len(command) == 0 && options.remote_command == NULL) in main()
1331 tty_flag = options.request_tty != REQUEST_TTY_NO; in main()
1334 if (options.request_tty == REQUEST_TTY_NO || in main()
1339 options.request_tty != REQUEST_TTY_FORCE) { in main()
1346 if (options.user == NULL) in main()
1347 options.user = xstrdup(pw->pw_name); in main()
1354 snprintf(portstr, sizeof(portstr), "%d", options.port); in main()
1359 options.user); in main()
1366 if (options.remote_command != NULL) { in main()
1367 debug3("expanding RemoteCommand: %s", options.remote_command); in main()
1368 cp = options.remote_command; in main()
1369 options.remote_command = default_client_percent_expand(cp, in main()
1370 pw->pw_dir, host, options.user, pw->pw_name); in main()
1371 debug3("expanded RemoteCommand: %s", options.remote_command); in main()
1373 if ((r = sshbuf_put(command, options.remote_command, in main()
1374 strlen(options.remote_command))) != 0) in main()
1378 if (options.control_path != NULL) { in main()
1379 cp = tilde_expand_filename(options.control_path, getuid()); in main()
1380 free(options.control_path); in main()
1381 options.control_path = default_client_percent_expand(cp, in main()
1382 pw->pw_dir, host, options.user, pw->pw_name); in main()
1386 if (options.identity_agent != NULL) { in main()
1387 p = tilde_expand_filename(options.identity_agent, getuid()); in main()
1389 pw->pw_dir, host, options.user, pw->pw_name); in main()
1391 free(options.identity_agent); in main()
1392 options.identity_agent = cp; in main()
1395 if (options.forward_agent_sock_path != NULL) { in main()
1396 p = tilde_expand_filename(options.forward_agent_sock_path, in main()
1399 pw->pw_dir, host, options.user, pw->pw_name); in main()
1401 free(options.forward_agent_sock_path); in main()
1402 options.forward_agent_sock_path = cp; in main()
1405 for (i = 0; i < options.num_local_forwards; i++) { in main()
1406 if (options.local_forwards[i].listen_path != NULL) { in main()
1407 cp = options.local_forwards[i].listen_path; in main()
1408 p = options.local_forwards[i].listen_path = in main()
1410 pw->pw_dir, host, options.user, pw->pw_name); in main()
1416 if (options.local_forwards[i].connect_path != NULL) { in main()
1417 cp = options.local_forwards[i].connect_path; in main()
1418 p = options.local_forwards[i].connect_path = in main()
1420 pw->pw_dir, host, options.user, pw->pw_name); in main()
1428 for (i = 0; i < options.num_remote_forwards; i++) { in main()
1429 if (options.remote_forwards[i].listen_path != NULL) { in main()
1430 cp = options.remote_forwards[i].listen_path; in main()
1431 p = options.remote_forwards[i].listen_path = in main()
1433 pw->pw_dir, host, options.user, pw->pw_name); in main()
1439 if (options.remote_forwards[i].connect_path != NULL) { in main()
1440 cp = options.remote_forwards[i].connect_path; in main()
1441 p = options.remote_forwards[i].connect_path = in main()
1443 pw->pw_dir, host, options.user, pw->pw_name); in main()
1452 dump_client_config(&options, host); in main()
1457 if (options.sk_provider != NULL && *options.sk_provider == '$' && in main()
1458 strlen(options.sk_provider) > 1) { in main()
1459 if ((cp = getenv(options.sk_provider + 1)) == NULL) { in main()
1461 "disabling", options.sk_provider); in main()
1462 free(options.sk_provider); in main()
1463 options.sk_provider = NULL; in main()
1466 options.sk_provider, cp); in main()
1467 free(options.sk_provider); in main()
1468 options.sk_provider = xstrdup(cp); in main()
1472 if (muxclient_command != 0 && options.control_path == NULL) in main()
1474 if (options.control_path != NULL) { in main()
1476 if ((sock = muxclient(options.control_path)) >= 0) { in main()
1487 if (addrs == NULL && options.proxy_command == NULL) { in main()
1488 debug2("resolving \"%s\" port %d", host, options.port); in main()
1489 if ((addrs = resolve_host(host, options.port, 1, in main()
1494 timeout_ms = options.connection_timeout * 1000; in main()
1497 if (ssh_connect(ssh, host, host_arg, addrs, &hostaddr, options.port, in main()
1498 options.address_family, options.connection_attempts, in main()
1499 &timeout_ms, options.tcp_keep_alive) != 0) in main()
1505 ssh_packet_set_timeout(ssh, options.server_alive_interval, in main()
1506 options.server_alive_count_max); in main()
1518 if (options.hostbased_authentication) { in main()
1536 if (options.hostbased_authentication == 1) { in main()
1566 /* load options.identity_files */ in main()
1570 if (options.identity_agent && in main()
1571 strcmp(options.identity_agent, SSH_AUTHSOCKET_ENV_NAME) != 0) { in main()
1572 if (strcmp(options.identity_agent, "none") == 0) { in main()
1575 cp = options.identity_agent; in main()
1592 if (options.forward_agent && options.forward_agent_sock_path != NULL) { in main()
1593 cp = options.forward_agent_sock_path; in main()
1601 options.forward_agent = 0; in main()
1609 tilde_expand_paths(options.system_hostfiles, in main()
1610 options.num_system_hostfiles); in main()
1611 tilde_expand_paths(options.user_hostfiles, options.num_user_hostfiles); in main()
1618 options.port, pw, timeout_ms); in main()
1639 for (i = 0; i < options.num_identity_files; i++) { in main()
1640 free(options.identity_files[i]); in main()
1641 options.identity_files[i] = NULL; in main()
1642 if (options.identity_keys[i]) { in main()
1643 sshkey_free(options.identity_keys[i]); in main()
1644 options.identity_keys[i] = NULL; in main()
1647 for (i = 0; i < options.num_certificate_files; i++) { in main()
1648 free(options.certificate_files[i]); in main()
1649 options.certificate_files[i] = NULL; in main()
1656 if (options.control_path != NULL && muxserver_sock != -1) in main()
1657 unlink(options.control_path); in main()
1687 options.request_tty = orequest_tty; in control_persist_detach()
1691 options.control_master = SSHCTL_MASTER_NO; in control_persist_detach()
1692 muxclient(options.control_path); in control_persist_detach()
1709 setproctitle("%s [mux]", options.control_path); in control_persist_detach()
1782 if (options.exit_on_forward_failure) { in ssh_confirm_remote_forward()
1820 if (options.exit_on_forward_failure) in ssh_tun_confirm()
1834 if (options.stdio_forward_host == NULL) in ssh_init_stdio_forwarding()
1837 debug3("%s: %s:%d", __func__, options.stdio_forward_host, in ssh_init_stdio_forwarding()
1838 options.stdio_forward_port); in ssh_init_stdio_forwarding()
1843 if ((c = channel_connect_stdio_fwd(ssh, options.stdio_forward_host, in ssh_init_stdio_forwarding()
1844 options.stdio_forward_port, in, out)) == NULL) in ssh_init_stdio_forwarding()
1856 if (options.exit_on_forward_failure) in ssh_init_forwarding()
1859 for (i = 0; i < options.num_local_forwards; i++) { in ssh_init_forwarding()
1862 (options.local_forwards[i].listen_path != NULL) ? in ssh_init_forwarding()
1863 options.local_forwards[i].listen_path : in ssh_init_forwarding()
1864 (options.local_forwards[i].listen_host == NULL) ? in ssh_init_forwarding()
1865 (options.fwd_opts.gateway_ports ? "*" : "LOCALHOST") : in ssh_init_forwarding()
1866 options.local_forwards[i].listen_host, in ssh_init_forwarding()
1867 options.local_forwards[i].listen_port, in ssh_init_forwarding()
1868 (options.local_forwards[i].connect_path != NULL) ? in ssh_init_forwarding()
1869 options.local_forwards[i].connect_path : in ssh_init_forwarding()
1870 options.local_forwards[i].connect_host, in ssh_init_forwarding()
1871 options.local_forwards[i].connect_port); in ssh_init_forwarding()
1873 &options.local_forwards[i], &options.fwd_opts); in ssh_init_forwarding()
1875 if (i > 0 && success != i && options.exit_on_forward_failure) in ssh_init_forwarding()
1881 for (i = 0; i < options.num_remote_forwards; i++) { in ssh_init_forwarding()
1884 (options.remote_forwards[i].listen_path != NULL) ? in ssh_init_forwarding()
1885 options.remote_forwards[i].listen_path : in ssh_init_forwarding()
1886 (options.remote_forwards[i].listen_host == NULL) ? in ssh_init_forwarding()
1887 "LOCALHOST" : options.remote_forwards[i].listen_host, in ssh_init_forwarding()
1888 options.remote_forwards[i].listen_port, in ssh_init_forwarding()
1889 (options.remote_forwards[i].connect_path != NULL) ? in ssh_init_forwarding()
1890 options.remote_forwards[i].connect_path : in ssh_init_forwarding()
1891 options.remote_forwards[i].connect_host, in ssh_init_forwarding()
1892 options.remote_forwards[i].connect_port); in ssh_init_forwarding()
1893 if ((options.remote_forwards[i].handle = in ssh_init_forwarding()
1895 &options.remote_forwards[i])) >= 0) { in ssh_init_forwarding()
1898 &options.remote_forwards[i]); in ssh_init_forwarding()
1900 } else if (options.exit_on_forward_failure) in ssh_init_forwarding()
1907 if (options.tun_open != SSH_TUNMODE_NO) { in ssh_init_forwarding()
1909 options.tun_open, options.tun_local, in ssh_init_forwarding()
1910 options.tun_remote, ssh_tun_confirm, NULL)) != NULL) in ssh_init_forwarding()
1912 else if (options.exit_on_forward_failure) in ssh_init_forwarding()
1928 if (options.forward_agent) { in check_agent_present()
1931 options.forward_agent = 0; in check_agent_present()
1951 if (display == NULL && options.forward_x11) in ssh_session2_setup()
1953 if (options.forward_x11 && client_x11_get_proto(ssh, display, in ssh_session2_setup()
1954 options.xauth_location, options.forward_x11_trusted, in ssh_session2_setup()
1955 options.forward_x11_timeout, &proto, &data) == 0) { in ssh_session2_setup()
1967 if (options.forward_agent) { in ssh_session2_setup()
1976 options.ip_qos_interactive, options.ip_qos_bulk); in ssh_session2_setup()
2036 if (!options.control_persist) in ssh_session2()
2041 if (options.local_command != NULL) { in ssh_session2()
2042 debug3("expanding LocalCommand: %s", options.local_command); in ssh_session2()
2043 cp = options.local_command; in ssh_session2()
2044 options.local_command = percent_expand(cp, in ssh_session2()
2048 "r", options.user, in ssh_session2()
2052 debug3("expanded LocalCommand: %s", options.local_command); in ssh_session2()
2069 if (options.control_persist && muxserver_sock != -1) { in ssh_session2()
2072 orequest_tty = options.request_tty; in ssh_session2()
2085 if (options.control_persist && muxserver_sock == -1) in ssh_session2()
2092 options.control_master == SSHCTL_MASTER_NO, in ssh_session2()
2093 options.ip_qos_interactive, options.ip_qos_bulk); in ssh_session2()
2097 if (options.control_master == SSHCTL_MASTER_NO && in ssh_session2()
2109 if (options.local_command != NULL && in ssh_session2()
2110 options.permit_local_command) in ssh_session2()
2111 ssh_local_cmd(options.local_command); in ssh_session2()
2134 if (options.exit_on_forward_failure && in ssh_session2()
2135 options.num_remote_forwards > 0) { in ssh_session2()
2143 options.escape_char : SSH_ESCAPECHAR_NONE, id); in ssh_session2()
2177 if (options.pkcs11_provider != NULL && in load_public_identity_files()
2178 options.num_identity_files < SSH_MAX_IDENTITY_FILES && in load_public_identity_files()
2179 (pkcs11_init(!options.batch_mode) == 0) && in load_public_identity_files()
2180 (nkeys = pkcs11_add_provider(options.pkcs11_provider, NULL, in load_public_identity_files()
2196 for (i = 0; i < options.num_identity_files; i++) { in load_public_identity_files()
2198 strcasecmp(options.identity_files[i], "none") == 0) { in load_public_identity_files()
2199 free(options.identity_files[i]); in load_public_identity_files()
2200 options.identity_files[i] = NULL; in load_public_identity_files()
2203 cp = tilde_expand_filename(options.identity_files[i], getuid()); in load_public_identity_files()
2205 pw->pw_dir, host, options.user, pw->pw_name); in load_public_identity_files()
2211 free(options.identity_files[i]); in load_public_identity_files()
2215 options.identity_file_userprovided[i]; in load_public_identity_files()
2223 if (options.num_certificate_files != 0) in load_public_identity_files()
2245 options.identity_file_userprovided[i]; in load_public_identity_files()
2249 if (options.num_certificate_files > SSH_MAX_CERTIFICATE_FILES) in load_public_identity_files()
2251 for (i = 0; i < options.num_certificate_files; i++) { in load_public_identity_files()
2252 cp = tilde_expand_filename(options.certificate_files[i], in load_public_identity_files()
2255 pw->pw_dir, host, options.user, pw->pw_name); in load_public_identity_files()
2262 free(options.certificate_files[i]); in load_public_identity_files()
2263 options.certificate_files[i] = NULL; in load_public_identity_files()
2278 options.certificate_file_userprovided[i]; in load_public_identity_files()
2282 options.num_identity_files = n_ids; in load_public_identity_files()
2283 memcpy(options.identity_files, identity_files, sizeof(identity_files)); in load_public_identity_files()
2284 memcpy(options.identity_keys, identity_keys, sizeof(identity_keys)); in load_public_identity_files()
2285 memcpy(options.identity_file_userprovided, in load_public_identity_files()
2288 options.num_certificate_files = n_certs; in load_public_identity_files()
2289 memcpy(options.certificate_files, in load_public_identity_files()
2291 memcpy(options.certificates, certificates, sizeof(certificates)); in load_public_identity_files()
2292 memcpy(options.certificate_file_userprovided, in load_public_identity_files()