Lines Matching full:options
157 * General data structure for command line options and options configurable
160 Options options; variable
235 * NB. this function must operate with a options having undefined members.
249 hints.ai_family = options.address_family == -1 ? in resolve_host()
250 AF_UNSPEC : options.address_family; in resolve_host()
276 * NB. this function must operate with a options having undefined members.
289 hints.ai_family = options.address_family == -1 ? in resolve_addr()
290 AF_UNSPEC : options.address_family; in resolve_addr()
329 * NB. this function must operate with a options having undefined members.
337 if (*cname == '\0' || options.num_permitted_cnames == 0 || in check_follow_cname()
340 if (options.canonicalize_hostname == SSH_CANONICALISE_NO) in check_follow_cname()
347 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS) in check_follow_cname()
350 for (i = 0; i < options.num_permitted_cnames; i++) { in check_follow_cname()
351 rule = options.permitted_cnames + i; in check_follow_cname()
368 * NB. this function must operate with a options having undefined members.
377 if (options.canonicalize_hostname == SSH_CANONICALISE_NO) in resolve_canonicalize()
384 direct = option_clear_or_none(options.proxy_command) && in resolve_canonicalize()
385 options.jump_host == NULL; in resolve_canonicalize()
387 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS) in resolve_canonicalize()
420 if (ndots > options.canonicalize_max_dots) { in resolve_canonicalize()
422 __func__, *hostp, options.canonicalize_max_dots); in resolve_canonicalize()
426 for (i = 0; i < options.num_canonical_domains; i++) { in resolve_canonicalize()
429 options.canonical_domains[i]); in resolve_canonicalize()
450 if (!options.canonicalize_fallback_local) in resolve_canonicalize()
468 !read_config_file(config, pw, host, host_arg, &options, in process_config_files()
477 &options, SSHCONF_CHECKPERM | SSHCONF_USERCONF | in process_config_files()
482 host, host_arg, &options, in process_config_files()
599 initialize_options(&options); in main()
612 options.protocol = SSH_PROTO_1; in main()
615 options.protocol = SSH_PROTO_2; in main()
618 options.address_family = AF_INET; in main()
621 options.address_family = AF_INET6; in main()
631 options.forward_x11 = 0; in main()
634 options.forward_x11 = 1; in main()
646 options.forward_x11 = 1; in main()
647 options.forward_x11_trusted = 1; in main()
650 options.fwd_opts.gateway_ports = 1; in main()
653 if (options.stdio_forward_host != NULL) in main()
674 options.use_privileged_port = 0; in main()
706 options.forward_agent = 0; in main()
709 options.forward_agent = 1; in main()
712 options.gss_deleg_creds = 0; in main()
715 options.gss_authentication = 1; in main()
716 options.gss_deleg_creds = 1; in main()
725 add_identity_file(&options, NULL, p, 1); in main()
730 free(options.pkcs11_provider); in main()
731 options.pkcs11_provider = xstrdup(optarg); in main()
737 if (options.jump_host != NULL) in main()
739 if (options.proxy_command != NULL) in main()
741 if (parse_jump(optarg, &options, 1) == -1) in main()
743 options.proxy_command = xstrdup("none"); in main()
746 if (options.request_tty == REQUEST_TTY_YES) in main()
747 options.request_tty = REQUEST_TTY_FORCE; in main()
749 options.request_tty = REQUEST_TTY_YES; in main()
754 options.log_level = SYSLOG_LEVEL_DEBUG1; in main()
756 if (options.log_level < SYSLOG_LEVEL_DEBUG3) { in main()
758 options.log_level++; in main()
775 if (options.tun_open == -1) in main()
776 options.tun_open = SSH_TUNMODE_DEFAULT; in main()
777 options.tun_local = a2tun(optarg, &options.tun_remote); in main()
778 if (options.tun_local == SSH_TUNID_ERR) { in main()
785 if (options.stdio_forward_host != NULL) in main()
790 options.stdio_forward_host = fwd.listen_host; in main()
791 options.stdio_forward_port = fwd.listen_port; in main()
799 options.request_tty = REQUEST_TTY_NO; in main()
803 options.log_level = SYSLOG_LEVEL_QUIET; in main()
809 options.escape_char = (u_char) optarg[1] & 31; in main()
811 options.escape_char = (u_char) optarg[0]; in main()
813 options.escape_char = SSH_ESCAPECHAR_NONE; in main()
824 free(options.ciphers); in main()
825 options.ciphers = xstrdup(optarg); in main()
826 options.cipher = SSH_CIPHER_INVALID; in main()
830 options.cipher = cipher_number(optarg); in main()
831 if (options.cipher == -1) { in main()
836 if (options.cipher == SSH_CIPHER_3DES) in main()
837 options.ciphers = xstrdup("3des-cbc"); in main()
838 else if (options.cipher == SSH_CIPHER_BLOWFISH) in main()
839 options.ciphers = xstrdup("blowfish-cbc"); in main()
841 options.ciphers = xstrdup(KEX_CLIENT_ENCRYPT); in main()
845 free(options.macs); in main()
846 options.macs = xstrdup(optarg); in main()
854 if (options.control_master == SSHCTL_MASTER_YES) in main()
855 options.control_master = SSHCTL_MASTER_ASK; in main()
857 options.control_master = SSHCTL_MASTER_YES; in main()
860 options.port = a2port(optarg); in main()
861 if (options.port <= 0) { in main()
867 options.user = optarg; in main()
872 add_local_forward(&options, &fwd); in main()
883 add_remote_forward(&options, &fwd); in main()
894 add_local_forward(&options, &fwd); in main()
904 options.compression = 1; in main()
908 options.request_tty = REQUEST_TTY_NO; in main()
911 options.request_tty = REQUEST_TTY_NO; in main()
915 if (process_config_line(&options, pw, in main()
925 free(options.control_path); in main()
926 options.control_path = xstrdup(optarg); in main()
929 options.bind_address = optarg; in main()
948 options.user = p; in main()
1010 options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, in main()
1025 /* Hostname canonicalisation needs a few options filled. */ in main()
1026 fill_default_options_for_canonicalization(&options); in main()
1029 if (options.hostname != NULL) { in main()
1031 cp = percent_expand(options.hostname, in main()
1035 free(options.hostname); in main()
1036 options.hostname = xstrdup(host); in main()
1041 if (options.canonicalize_hostname != SSH_CANONICALISE_NO) in main()
1042 addrs = resolve_canonicalize(&host, options.port); in main()
1057 direct = option_clear_or_none(options.proxy_command) && in main()
1058 options.jump_host == NULL; in main()
1059 if (addrs == NULL && options.num_permitted_cnames != 0 && (direct || in main()
1060 options.canonicalize_hostname == SSH_CANONICALISE_ALWAYS)) { in main()
1061 if ((addrs = resolve_host(host, options.port, in main()
1062 option_clear_or_none(options.proxy_command), in main()
1065 if (option_clear_or_none(options.proxy_command)) in main()
1075 if (options.canonicalize_hostname != 0) { in main()
1078 free(options.hostname); in main()
1079 options.hostname = xstrdup(host); in main()
1086 if (addrs != NULL && options.port > 0) in main()
1087 set_addrinfo_port(addrs, options.port); in main()
1091 fill_default_options(&options); in main()
1096 if (options.jump_host != NULL) { in main()
1100 if (options.proxy_command != NULL) in main()
1101 fatal("inconsistent options: ProxyCommand+ProxyJump"); in main()
1103 options.proxy_use_fdpass = 0; in main()
1104 snprintf(port_s, sizeof(port_s), "%d", options.jump_port); in main()
1105 xasprintf(&options.proxy_command, in main()
1108 options.jump_user == NULL ? "" : " -l ", in main()
1109 options.jump_user == NULL ? "" : options.jump_user, in main()
1111 options.jump_port <= 0 ? "" : " -p ", in main()
1112 options.jump_port <= 0 ? "" : port_s, in main()
1114 options.jump_extra == NULL ? "" : " -J ", in main()
1115 options.jump_extra == NULL ? "" : options.jump_extra, in main()
1123 options.jump_host); in main()
1125 options.proxy_command); in main()
1128 if (options.port == 0) in main()
1129 options.port = default_ssh_port(); in main()
1130 channel_set_af(options.address_family); in main()
1132 /* Tidy and check options */ in main()
1133 if (options.host_key_alias != NULL) in main()
1134 lowercase(options.host_key_alias); in main()
1135 if (options.proxy_command != NULL && in main()
1136 strcmp(options.proxy_command, "-") == 0 && in main()
1137 options.proxy_use_fdpass) in main()
1139 if (options.control_persist && in main()
1140 options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK) { in main()
1143 options.update_hostkeys = 0; in main()
1145 if (options.connection_attempts <= 0) in main()
1149 options.use_privileged_port = 0; in main()
1153 log_init(argv0, options.log_level, SYSLOG_FACILITY_USER, !use_syslog); in main()
1155 if (options.request_tty == REQUEST_TTY_YES || in main()
1156 options.request_tty == REQUEST_TTY_FORCE) in main()
1161 tty_flag = options.request_tty != REQUEST_TTY_NO; in main()
1164 if (options.request_tty == REQUEST_TTY_NO || in main()
1169 options.request_tty != REQUEST_TTY_FORCE) { in main()
1178 if (options.user == NULL) in main()
1179 options.user = xstrdup(pw->pw_name); in main()
1185 snprintf(portstr, sizeof(portstr), "%d", options.port); in main()
1192 ssh_digest_update(md, options.user, strlen(options.user)) < 0 || in main()
1198 if (options.local_command != NULL) { in main()
1199 debug3("expanding LocalCommand: %s", options.local_command); in main()
1200 cp = options.local_command; in main()
1201 options.local_command = percent_expand(cp, in main()
1209 "r", options.user, in main()
1212 debug3("expanded LocalCommand: %s", options.local_command); in main()
1216 if (options.control_path != NULL) { in main()
1217 cp = tilde_expand_filename(options.control_path, in main()
1219 free(options.control_path); in main()
1220 options.control_path = percent_expand(cp, in main()
1227 "r", options.user, in main()
1236 dump_client_config(&options, host); in main()
1240 if (muxclient_command != 0 && options.control_path == NULL) in main()
1242 if (options.control_path != NULL) { in main()
1244 if ((sock = muxclient(options.control_path)) >= 0) { in main()
1257 if (addrs == NULL && options.proxy_command == NULL) { in main()
1258 debug2("resolving \"%s\" port %d", host, options.port); in main()
1259 if ((addrs = resolve_host(host, options.port, 1, in main()
1264 timeout_ms = options.connection_timeout * 1000; in main()
1267 if (ssh_connect(host, addrs, &hostaddr, options.port, in main()
1268 options.address_family, options.connection_attempts, in main()
1269 &timeout_ms, options.tcp_keep_alive, in main()
1270 options.use_privileged_port) != 0) in main()
1276 packet_set_timeout(options.server_alive_interval, in main()
1277 options.server_alive_count_max); in main()
1295 if (options.rhosts_rsa_authentication || in main()
1296 options.hostbased_authentication) { in main()
1330 if (options.hostbased_authentication == 1 && in main()
1390 /* load options.identity_files */ in main()
1394 if (options.identity_agent && in main()
1395 strcmp(options.identity_agent, SSH_AUTHSOCKET_ENV_NAME) != 0) { in main()
1396 if (strcmp(options.identity_agent, "none") == 0) { in main()
1399 p = tilde_expand_filename(options.identity_agent, in main()
1403 "r", options.user, (char *)NULL); in main()
1411 tilde_expand_paths(options.system_hostfiles, in main()
1412 options.num_system_hostfiles); in main()
1413 tilde_expand_paths(options.user_hostfiles, options.num_user_hostfiles); in main()
1420 options.port, pw, timeout_ms); in main()
1441 for (i = 0; i < options.num_identity_files; i++) { in main()
1442 free(options.identity_files[i]); in main()
1443 options.identity_files[i] = NULL; in main()
1444 if (options.identity_keys[i]) { in main()
1445 key_free(options.identity_keys[i]); in main()
1446 options.identity_keys[i] = NULL; in main()
1449 for (i = 0; i < options.num_certificate_files; i++) { in main()
1450 free(options.certificate_files[i]); in main()
1451 options.certificate_files[i] = NULL; in main()
1458 if (options.control_path != NULL && muxserver_sock != -1) in main()
1459 unlink(options.control_path); in main()
1489 options.request_tty = orequest_tty; in control_persist_detach()
1493 options.control_master = SSHCTL_MASTER_NO; in control_persist_detach()
1494 muxclient(options.control_path); in control_persist_detach()
1511 setproctitle("%s [mux]", options.control_path); in control_persist_detach()
1554 if (options.exit_on_forward_failure) { in ssh_confirm_remote_forward()
1570 if (++remote_forward_confirms_received == options.num_remote_forwards) { in ssh_confirm_remote_forward()
1597 if (options.stdio_forward_host == NULL) in ssh_init_stdio_forwarding()
1602 debug3("%s: %s:%d", __func__, options.stdio_forward_host, in ssh_init_stdio_forwarding()
1603 options.stdio_forward_port); in ssh_init_stdio_forwarding()
1608 if ((c = channel_connect_stdio_fwd(options.stdio_forward_host, in ssh_init_stdio_forwarding()
1609 options.stdio_forward_port, in, out)) == NULL) in ssh_init_stdio_forwarding()
1622 for (i = 0; i < options.num_local_forwards; i++) { in ssh_init_forwarding()
1625 (options.local_forwards[i].listen_path != NULL) ? in ssh_init_forwarding()
1626 options.local_forwards[i].listen_path : in ssh_init_forwarding()
1627 (options.local_forwards[i].listen_host == NULL) ? in ssh_init_forwarding()
1628 (options.fwd_opts.gateway_ports ? "*" : "LOCALHOST") : in ssh_init_forwarding()
1629 options.local_forwards[i].listen_host, in ssh_init_forwarding()
1630 options.local_forwards[i].listen_port, in ssh_init_forwarding()
1631 (options.local_forwards[i].connect_path != NULL) ? in ssh_init_forwarding()
1632 options.local_forwards[i].connect_path : in ssh_init_forwarding()
1633 options.local_forwards[i].connect_host, in ssh_init_forwarding()
1634 options.local_forwards[i].connect_port); in ssh_init_forwarding()
1636 &options.local_forwards[i], &options.fwd_opts); in ssh_init_forwarding()
1638 if (i > 0 && success != i && options.exit_on_forward_failure) in ssh_init_forwarding()
1644 for (i = 0; i < options.num_remote_forwards; i++) { in ssh_init_forwarding()
1647 (options.remote_forwards[i].listen_path != NULL) ? in ssh_init_forwarding()
1648 options.remote_forwards[i].listen_path : in ssh_init_forwarding()
1649 (options.remote_forwards[i].listen_host == NULL) ? in ssh_init_forwarding()
1650 "LOCALHOST" : options.remote_forwards[i].listen_host, in ssh_init_forwarding()
1651 options.remote_forwards[i].listen_port, in ssh_init_forwarding()
1652 (options.remote_forwards[i].connect_path != NULL) ? in ssh_init_forwarding()
1653 options.remote_forwards[i].connect_path : in ssh_init_forwarding()
1654 options.remote_forwards[i].connect_host, in ssh_init_forwarding()
1655 options.remote_forwards[i].connect_port); in ssh_init_forwarding()
1656 options.remote_forwards[i].handle = in ssh_init_forwarding()
1658 &options.remote_forwards[i]); in ssh_init_forwarding()
1659 if (options.remote_forwards[i].handle < 0) { in ssh_init_forwarding()
1660 if (options.exit_on_forward_failure) in ssh_init_forwarding()
1667 &options.remote_forwards[i]); in ssh_init_forwarding()
1672 if (options.tun_open != SSH_TUNMODE_NO) { in ssh_init_forwarding()
1673 if (client_request_tun_fwd(options.tun_open, in ssh_init_forwarding()
1674 options.tun_local, options.tun_remote) == -1) { in ssh_init_forwarding()
1675 if (options.exit_on_forward_failure) in ssh_init_forwarding()
1688 if (options.forward_agent) { in check_agent_present()
1691 options.forward_agent = 0; in check_agent_present()
1711 if (options.compression) { in ssh_session()
1713 options.compression_level); in ssh_session()
1715 if (options.compression_level < 1 || in ssh_session()
1716 options.compression_level > 9) in ssh_session()
1722 packet_put_int(options.compression_level); in ssh_session()
1727 packet_start_compression(options.compression_level); in ssh_session()
1777 if (display == NULL && options.forward_x11) in ssh_session()
1779 if (options.forward_x11 && client_x11_get_proto(display, in ssh_session()
1780 options.xauth_location, options.forward_x11_trusted, in ssh_session()
1781 options.forward_x11_timeout, &proto, &data) == 0) { in ssh_session()
1800 options.ip_qos_interactive, options.ip_qos_bulk); in ssh_session()
1805 if (options.forward_agent) { in ssh_session()
1821 if (options.local_command != NULL && in ssh_session()
1822 options.permit_local_command) in ssh_session()
1823 ssh_local_cmd(options.local_command); in ssh_session()
1830 if (options.exit_on_forward_failure && in ssh_session()
1831 options.num_remote_forwards > 0) { in ssh_session()
1861 options.escape_char : SSH_ESCAPECHAR_NONE, 0); in ssh_session()
1877 if (display == NULL && options.forward_x11) in ssh_session2_setup()
1879 if (options.forward_x11 && client_x11_get_proto(display, in ssh_session2_setup()
1880 options.xauth_location, options.forward_x11_trusted, in ssh_session2_setup()
1881 options.forward_x11_timeout, &proto, &data) == 0) { in ssh_session2_setup()
1893 if (options.forward_agent) { in ssh_session2_setup()
1901 options.ip_qos_interactive, options.ip_qos_bulk); in ssh_session2_setup()
1960 if (!options.control_persist) in ssh_session2()
1977 if (options.control_persist && muxserver_sock != -1) { in ssh_session2()
1980 orequest_tty = options.request_tty; in ssh_session2()
1993 if (options.control_persist && muxserver_sock == -1) in ssh_session2()
2000 options.control_master == SSHCTL_MASTER_NO, in ssh_session2()
2001 options.ip_qos_interactive, options.ip_qos_bulk); in ssh_session2()
2005 if (options.control_master == SSHCTL_MASTER_NO && in ssh_session2()
2015 if (options.local_command != NULL && in ssh_session2()
2016 options.permit_local_command) in ssh_session2()
2017 ssh_local_cmd(options.local_command); in ssh_session2()
2024 if (options.exit_on_forward_failure && in ssh_session2()
2025 options.num_remote_forwards > 0) { in ssh_session2()
2033 options.escape_char : SSH_ESCAPECHAR_NONE, id); in ssh_session2()
2062 if (options.pkcs11_provider != NULL && in load_public_identity_files()
2063 options.num_identity_files < SSH_MAX_IDENTITY_FILES && in load_public_identity_files()
2064 (pkcs11_init(!options.batch_mode) == 0) && in load_public_identity_files()
2065 (nkeys = pkcs11_add_provider(options.pkcs11_provider, NULL, in load_public_identity_files()
2074 xstrdup(options.pkcs11_provider); /* XXX */ in load_public_identity_files()
2087 for (i = 0; i < options.num_identity_files; i++) { in load_public_identity_files()
2089 strcasecmp(options.identity_files[i], "none") == 0) { in load_public_identity_files()
2090 free(options.identity_files[i]); in load_public_identity_files()
2091 options.identity_files[i] = NULL; in load_public_identity_files()
2094 cp = tilde_expand_filename(options.identity_files[i], in load_public_identity_files()
2098 "r", options.user, (char *)NULL); in load_public_identity_files()
2103 free(options.identity_files[i]); in load_public_identity_files()
2114 if (options.num_certificate_files != 0) in load_public_identity_files()
2137 if (options.num_certificate_files > SSH_MAX_CERTIFICATE_FILES) in load_public_identity_files()
2139 for (i = 0; i < options.num_certificate_files; i++) { in load_public_identity_files()
2140 cp = tilde_expand_filename(options.certificate_files[i], in load_public_identity_files()
2144 "r", options.user, (char *)NULL); in load_public_identity_files()
2150 free(options.certificate_files[i]); in load_public_identity_files()
2151 options.certificate_files[i] = NULL; in load_public_identity_files()
2168 options.num_identity_files = n_ids; in load_public_identity_files()
2169 memcpy(options.identity_files, identity_files, sizeof(identity_files)); in load_public_identity_files()
2170 memcpy(options.identity_keys, identity_keys, sizeof(identity_keys)); in load_public_identity_files()
2172 options.num_certificate_files = n_certs; in load_public_identity_files()
2173 memcpy(options.certificate_files, in load_public_identity_files()
2175 memcpy(options.certificates, certificates, sizeof(certificates)); in load_public_identity_files()