Lines Matching refs:options
159 Options options; variable
247 hints.ai_family = options.address_family == -1 ? in resolve_host()
248 AF_UNSPEC : options.address_family; in resolve_host()
290 hints.ai_family = options.address_family == -1 ? in is_addr()
291 AF_UNSPEC : options.address_family; in is_addr()
321 hints.ai_family = options.address_family == -1 ? in resolve_addr()
322 AF_UNSPEC : options.address_family; in resolve_addr()
369 if (*cname == '\0' || options.num_permitted_cnames == 0 || in check_follow_cname()
372 if (options.canonicalize_hostname == SSH_CANONICALISE_NO) in check_follow_cname()
379 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS) in check_follow_cname()
382 for (i = 0; i < options.num_permitted_cnames; i++) { in check_follow_cname()
383 rule = options.permitted_cnames + i; in check_follow_cname()
436 if (options.canonicalize_hostname == SSH_CANONICALISE_NO) in resolve_canonicalize()
443 direct = option_clear_or_none(options.proxy_command) && in resolve_canonicalize()
444 options.jump_host == NULL; in resolve_canonicalize()
446 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS) in resolve_canonicalize()
466 if (ndots > options.canonicalize_max_dots) { in resolve_canonicalize()
468 __func__, *hostp, options.canonicalize_max_dots); in resolve_canonicalize()
472 for (i = 0; i < options.num_canonical_domains; i++) { in resolve_canonicalize()
475 options.canonical_domains[i]); in resolve_canonicalize()
496 if (!options.canonicalize_fallback_local) in resolve_canonicalize()
538 !read_config_file(config, pw, host, host_name, &options, in process_config_files()
547 &options, SSHCONF_CHECKPERM | SSHCONF_USERCONF | in process_config_files()
552 host, host_name, &options, in process_config_files()
643 initialize_options(&options); in main()
670 options.address_family = AF_INET; in main()
673 options.address_family = AF_INET6; in main()
683 options.forward_x11 = 0; in main()
686 options.forward_x11 = 1; in main()
698 options.forward_x11 = 1; in main()
699 options.forward_x11_trusted = 1; in main()
702 options.fwd_opts.gateway_ports = 1; in main()
705 if (options.stdio_forward_host != NULL) in main()
753 options.forward_agent = 0; in main()
756 options.forward_agent = 1; in main()
759 options.gss_deleg_creds = 0; in main()
762 options.gss_authentication = 1; in main()
763 options.gss_deleg_creds = 1; in main()
772 add_identity_file(&options, NULL, p, 1); in main()
777 free(options.pkcs11_provider); in main()
778 options.pkcs11_provider = xstrdup(optarg); in main()
784 if (options.jump_host != NULL) in main()
786 if (options.proxy_command != NULL) in main()
788 if (parse_jump(optarg, &options, 1) == -1) in main()
790 options.proxy_command = xstrdup("none"); in main()
793 if (options.request_tty == REQUEST_TTY_YES) in main()
794 options.request_tty = REQUEST_TTY_FORCE; in main()
796 options.request_tty = REQUEST_TTY_YES; in main()
801 options.log_level = SYSLOG_LEVEL_DEBUG1; in main()
803 if (options.log_level < SYSLOG_LEVEL_DEBUG3) { in main()
805 options.log_level++; in main()
810 if (options.version_addendum && in main()
811 *options.version_addendum != '\0') in main()
813 options.version_addendum, in main()
822 if (options.tun_open == -1) in main()
823 options.tun_open = SSH_TUNMODE_DEFAULT; in main()
824 options.tun_local = a2tun(optarg, &options.tun_remote); in main()
825 if (options.tun_local == SSH_TUNID_ERR) { in main()
832 if (options.stdio_forward_host != NULL) in main()
837 options.stdio_forward_host = fwd.listen_host; in main()
838 options.stdio_forward_port = fwd.listen_port; in main()
846 options.request_tty = REQUEST_TTY_NO; in main()
850 options.log_level = SYSLOG_LEVEL_QUIET; in main()
856 options.escape_char = (u_char) optarg[1] & 31; in main()
858 options.escape_char = (u_char) optarg[0]; in main()
860 options.escape_char = SSH_ESCAPECHAR_NONE; in main()
874 free(options.ciphers); in main()
875 options.ciphers = xstrdup(optarg); in main()
879 free(options.macs); in main()
880 options.macs = xstrdup(optarg); in main()
888 if (options.control_master == SSHCTL_MASTER_YES) in main()
889 options.control_master = SSHCTL_MASTER_ASK; in main()
891 options.control_master = SSHCTL_MASTER_YES; in main()
894 if (options.port == -1) { in main()
895 options.port = a2port(optarg); in main()
896 if (options.port <= 0) { in main()
904 if (options.user == NULL) in main()
905 options.user = optarg; in main()
910 add_local_forward(&options, &fwd); in main()
922 add_remote_forward(&options, &fwd); in main()
933 add_local_forward(&options, &fwd); in main()
943 options.compression = 1; in main()
947 options.request_tty = REQUEST_TTY_NO; in main()
950 options.request_tty = REQUEST_TTY_NO; in main()
954 if (process_config_line(&options, pw, in main()
964 free(options.control_path); in main()
965 options.control_path = xstrdup(optarg); in main()
968 options.bind_address = optarg; in main()
971 options.bind_interface = optarg; in main()
995 if (options.user == NULL) { in main()
996 options.user = tuser; in main()
1000 if (options.port == -1 && tport != -1) in main()
1001 options.port = tport; in main()
1009 if (options.user == NULL) { in main()
1010 options.user = p; in main()
1073 options.log_level == SYSLOG_LEVEL_NOT_SET ? in main()
1074 SYSLOG_LEVEL_INFO : options.log_level, in main()
1075 options.log_facility == SYSLOG_FACILITY_NOT_SET ? in main()
1076 SYSLOG_FACILITY_USER : options.log_facility, in main()
1087 fill_default_options_for_canonicalization(&options); in main()
1090 if (options.hostname != NULL) { in main()
1092 cp = percent_expand(options.hostname, in main()
1096 free(options.hostname); in main()
1097 options.hostname = xstrdup(host); in main()
1108 if (options.canonicalize_hostname != SSH_CANONICALISE_NO || was_addr) in main()
1109 addrs = resolve_canonicalize(&host, options.port); in main()
1124 direct = option_clear_or_none(options.proxy_command) && in main()
1125 options.jump_host == NULL; in main()
1126 if (addrs == NULL && options.num_permitted_cnames != 0 && (direct || in main()
1127 options.canonicalize_hostname == SSH_CANONICALISE_ALWAYS)) { in main()
1128 if ((addrs = resolve_host(host, options.port, in main()
1129 option_clear_or_none(options.proxy_command), in main()
1132 if (option_clear_or_none(options.proxy_command)) in main()
1142 if (options.canonicalize_hostname != 0) { in main()
1145 free(options.hostname); in main()
1146 options.hostname = xstrdup(host); in main()
1153 if (addrs != NULL && options.port > 0) in main()
1154 set_addrinfo_port(addrs, options.port); in main()
1158 fill_default_options(&options); in main()
1163 if (options.jump_host != NULL) { in main()
1175 if (options.proxy_command != NULL) in main()
1178 options.proxy_use_fdpass = 0; in main()
1179 snprintf(port_s, sizeof(port_s), "%d", options.jump_port); in main()
1180 xasprintf(&options.proxy_command, in main()
1184 options.jump_user == NULL ? "" : " -l ", in main()
1185 options.jump_user == NULL ? "" : options.jump_user, in main()
1187 options.jump_port <= 0 ? "" : " -p ", in main()
1188 options.jump_port <= 0 ? "" : port_s, in main()
1190 options.jump_extra == NULL ? "" : " -J ", in main()
1191 options.jump_extra == NULL ? "" : options.jump_extra, in main()
1199 options.jump_host); in main()
1201 options.proxy_command); in main()
1204 if (options.port == 0) in main()
1205 options.port = default_ssh_port(); in main()
1206 channel_set_af(ssh, options.address_family); in main()
1209 if (options.host_key_alias != NULL) in main()
1210 lowercase(options.host_key_alias); in main()
1211 if (options.proxy_command != NULL && in main()
1212 strcmp(options.proxy_command, "-") == 0 && in main()
1213 options.proxy_use_fdpass) in main()
1215 if (options.control_persist && in main()
1216 options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK) { in main()
1219 options.update_hostkeys = 0; in main()
1221 if (options.connection_attempts <= 0) in main()
1224 if (sshbuf_len(command) != 0 && options.remote_command != NULL) in main()
1229 options.remote_command == NULL && !no_shell_flag) in main()
1234 log_init(argv0, options.log_level, options.log_facility, !use_syslog); in main()
1236 if (options.request_tty == REQUEST_TTY_YES || in main()
1237 options.request_tty == REQUEST_TTY_FORCE) in main()
1241 if (sshbuf_len(command) == 0 && options.remote_command == NULL) in main()
1242 tty_flag = options.request_tty != REQUEST_TTY_NO; in main()
1245 if (options.request_tty == REQUEST_TTY_NO || in main()
1250 options.request_tty != REQUEST_TTY_FORCE) { in main()
1259 if (options.user == NULL) in main()
1260 options.user = xstrdup(pw->pw_name); in main()
1267 snprintf(portstr, sizeof(portstr), "%d", options.port); in main()
1277 hints.ai_family = options.address_family; in main()
1292 ssh_digest_update(md, options.user, strlen(options.user)) < 0 || in main()
1303 if (options.remote_command != NULL) { in main()
1304 debug3("expanding RemoteCommand: %s", options.remote_command); in main()
1305 cp = options.remote_command; in main()
1306 options.remote_command = percent_expand(cp, in main()
1315 "r", options.user, in main()
1318 debug3("expanded RemoteCommand: %s", options.remote_command); in main()
1320 if ((r = sshbuf_put(command, options.remote_command, in main()
1321 strlen(options.remote_command))) != 0) in main()
1325 if (options.control_path != NULL) { in main()
1326 cp = tilde_expand_filename(options.control_path, getuid()); in main()
1327 free(options.control_path); in main()
1328 options.control_path = percent_expand(cp, in main()
1336 "r", options.user, in main()
1344 dump_client_config(&options, host); in main()
1348 if (muxclient_command != 0 && options.control_path == NULL) in main()
1350 if (options.control_path != NULL) { in main()
1352 if ((sock = muxclient(options.control_path)) >= 0) { in main()
1363 if (addrs == NULL && options.proxy_command == NULL) { in main()
1364 debug2("resolving \"%s\" port %d", host, options.port); in main()
1365 if ((addrs = resolve_host(host, options.port, 1, in main()
1370 timeout_ms = options.connection_timeout * 1000; in main()
1373 if (ssh_connect(ssh, host, addrs, &hostaddr, options.port, in main()
1374 options.address_family, options.connection_attempts, in main()
1375 &timeout_ms, options.tcp_keep_alive) != 0) in main()
1381 packet_set_timeout(options.server_alive_interval, in main()
1382 options.server_alive_count_max); in main()
1396 if (options.hostbased_authentication) { in main()
1414 if (options.hostbased_authentication == 1) { in main()
1448 if (options.identity_agent && in main()
1449 strcmp(options.identity_agent, SSH_AUTHSOCKET_ENV_NAME) != 0) { in main()
1450 if (strcmp(options.identity_agent, "none") == 0) { in main()
1453 p = tilde_expand_filename(options.identity_agent, in main()
1460 "r", options.user, in main()
1470 tilde_expand_paths(options.system_hostfiles, in main()
1471 options.num_system_hostfiles); in main()
1472 tilde_expand_paths(options.user_hostfiles, options.num_user_hostfiles); in main()
1479 options.port, pw, timeout_ms); in main()
1500 for (i = 0; i < options.num_identity_files; i++) { in main()
1501 free(options.identity_files[i]); in main()
1502 options.identity_files[i] = NULL; in main()
1503 if (options.identity_keys[i]) { in main()
1504 sshkey_free(options.identity_keys[i]); in main()
1505 options.identity_keys[i] = NULL; in main()
1508 for (i = 0; i < options.num_certificate_files; i++) { in main()
1509 free(options.certificate_files[i]); in main()
1510 options.certificate_files[i] = NULL; in main()
1517 if (options.control_path != NULL && muxserver_sock != -1) in main()
1518 unlink(options.control_path); in main()
1548 options.request_tty = orequest_tty; in control_persist_detach()
1552 options.control_master = SSHCTL_MASTER_NO; in control_persist_detach()
1553 muxclient(options.control_path); in control_persist_detach()
1570 setproctitle("%s [mux]", options.control_path); in control_persist_detach()
1613 if (options.exit_on_forward_failure) { in ssh_confirm_remote_forward()
1629 if (++remote_forward_confirms_received == options.num_remote_forwards) { in ssh_confirm_remote_forward()
1656 if (options.stdio_forward_host == NULL) in ssh_init_stdio_forwarding()
1659 debug3("%s: %s:%d", __func__, options.stdio_forward_host, in ssh_init_stdio_forwarding()
1660 options.stdio_forward_port); in ssh_init_stdio_forwarding()
1665 if ((c = channel_connect_stdio_fwd(ssh, options.stdio_forward_host, in ssh_init_stdio_forwarding()
1666 options.stdio_forward_port, in, out)) == NULL) in ssh_init_stdio_forwarding()
1679 for (i = 0; i < options.num_local_forwards; i++) { in ssh_init_forwarding()
1682 (options.local_forwards[i].listen_path != NULL) ? in ssh_init_forwarding()
1683 options.local_forwards[i].listen_path : in ssh_init_forwarding()
1684 (options.local_forwards[i].listen_host == NULL) ? in ssh_init_forwarding()
1685 (options.fwd_opts.gateway_ports ? "*" : "LOCALHOST") : in ssh_init_forwarding()
1686 options.local_forwards[i].listen_host, in ssh_init_forwarding()
1687 options.local_forwards[i].listen_port, in ssh_init_forwarding()
1688 (options.local_forwards[i].connect_path != NULL) ? in ssh_init_forwarding()
1689 options.local_forwards[i].connect_path : in ssh_init_forwarding()
1690 options.local_forwards[i].connect_host, in ssh_init_forwarding()
1691 options.local_forwards[i].connect_port); in ssh_init_forwarding()
1693 &options.local_forwards[i], &options.fwd_opts); in ssh_init_forwarding()
1695 if (i > 0 && success != i && options.exit_on_forward_failure) in ssh_init_forwarding()
1701 for (i = 0; i < options.num_remote_forwards; i++) { in ssh_init_forwarding()
1704 (options.remote_forwards[i].listen_path != NULL) ? in ssh_init_forwarding()
1705 options.remote_forwards[i].listen_path : in ssh_init_forwarding()
1706 (options.remote_forwards[i].listen_host == NULL) ? in ssh_init_forwarding()
1707 "LOCALHOST" : options.remote_forwards[i].listen_host, in ssh_init_forwarding()
1708 options.remote_forwards[i].listen_port, in ssh_init_forwarding()
1709 (options.remote_forwards[i].connect_path != NULL) ? in ssh_init_forwarding()
1710 options.remote_forwards[i].connect_path : in ssh_init_forwarding()
1711 options.remote_forwards[i].connect_host, in ssh_init_forwarding()
1712 options.remote_forwards[i].connect_port); in ssh_init_forwarding()
1713 options.remote_forwards[i].handle = in ssh_init_forwarding()
1715 &options.remote_forwards[i]); in ssh_init_forwarding()
1716 if (options.remote_forwards[i].handle < 0) { in ssh_init_forwarding()
1717 if (options.exit_on_forward_failure) in ssh_init_forwarding()
1725 &options.remote_forwards[i]); in ssh_init_forwarding()
1730 if (options.tun_open != SSH_TUNMODE_NO) { in ssh_init_forwarding()
1732 options.tun_open, options.tun_local, in ssh_init_forwarding()
1733 options.tun_remote)) == NULL) { in ssh_init_forwarding()
1734 if (options.exit_on_forward_failure) in ssh_init_forwarding()
1747 if (options.forward_agent) { in check_agent_present()
1750 options.forward_agent = 0; in check_agent_present()
1770 if (display == NULL && options.forward_x11) in ssh_session2_setup()
1772 if (options.forward_x11 && client_x11_get_proto(ssh, display, in ssh_session2_setup()
1773 options.xauth_location, options.forward_x11_trusted, in ssh_session2_setup()
1774 options.forward_x11_timeout, &proto, &data) == 0) { in ssh_session2_setup()
1786 if (options.forward_agent) { in ssh_session2_setup()
1794 options.ip_qos_interactive, options.ip_qos_bulk); in ssh_session2_setup()
1854 if (!options.control_persist) in ssh_session2()
1859 if (options.local_command != NULL) { in ssh_session2()
1860 debug3("expanding LocalCommand: %s", options.local_command); in ssh_session2()
1861 cp = options.local_command; in ssh_session2()
1862 options.local_command = percent_expand(cp, in ssh_session2()
1871 "r", options.user, in ssh_session2()
1875 debug3("expanded LocalCommand: %s", options.local_command); in ssh_session2()
1892 if (options.control_persist && muxserver_sock != -1) { in ssh_session2()
1895 orequest_tty = options.request_tty; in ssh_session2()
1908 if (options.control_persist && muxserver_sock == -1) in ssh_session2()
1915 options.control_master == SSHCTL_MASTER_NO, in ssh_session2()
1916 options.ip_qos_interactive, options.ip_qos_bulk); in ssh_session2()
1920 if (options.control_master == SSHCTL_MASTER_NO && in ssh_session2()
1930 if (options.local_command != NULL && in ssh_session2()
1931 options.permit_local_command) in ssh_session2()
1932 ssh_local_cmd(options.local_command); in ssh_session2()
1955 if (options.exit_on_forward_failure && in ssh_session2()
1956 options.num_remote_forwards > 0) { in ssh_session2()
1964 options.escape_char : SSH_ESCAPECHAR_NONE, id); in ssh_session2()
1997 if (options.pkcs11_provider != NULL && in load_public_identity_files()
1998 options.num_identity_files < SSH_MAX_IDENTITY_FILES && in load_public_identity_files()
1999 (pkcs11_init(!options.batch_mode) == 0) && in load_public_identity_files()
2000 (nkeys = pkcs11_add_provider(options.pkcs11_provider, NULL, in load_public_identity_files()
2009 xstrdup(options.pkcs11_provider); /* XXX */ in load_public_identity_files()
2015 for (i = 0; i < options.num_identity_files; i++) { in load_public_identity_files()
2017 strcasecmp(options.identity_files[i], "none") == 0) { in load_public_identity_files()
2018 free(options.identity_files[i]); in load_public_identity_files()
2019 options.identity_files[i] = NULL; in load_public_identity_files()
2022 cp = tilde_expand_filename(options.identity_files[i], getuid()); in load_public_identity_files()
2025 "r", options.user, (char *)NULL); in load_public_identity_files()
2031 free(options.identity_files[i]); in load_public_identity_files()
2035 options.identity_file_userprovided[i]; in load_public_identity_files()
2043 if (options.num_certificate_files != 0) in load_public_identity_files()
2065 options.identity_file_userprovided[i]; in load_public_identity_files()
2069 if (options.num_certificate_files > SSH_MAX_CERTIFICATE_FILES) in load_public_identity_files()
2071 for (i = 0; i < options.num_certificate_files; i++) { in load_public_identity_files()
2072 cp = tilde_expand_filename(options.certificate_files[i], in load_public_identity_files()
2079 "r", options.user, in load_public_identity_files()
2088 free(options.certificate_files[i]); in load_public_identity_files()
2089 options.certificate_files[i] = NULL; in load_public_identity_files()
2104 options.certificate_file_userprovided[i]; in load_public_identity_files()
2108 options.num_identity_files = n_ids; in load_public_identity_files()
2109 memcpy(options.identity_files, identity_files, sizeof(identity_files)); in load_public_identity_files()
2110 memcpy(options.identity_keys, identity_keys, sizeof(identity_keys)); in load_public_identity_files()
2111 memcpy(options.identity_file_userprovided, in load_public_identity_files()
2114 options.num_certificate_files = n_certs; in load_public_identity_files()
2115 memcpy(options.certificate_files, in load_public_identity_files()
2117 memcpy(options.certificates, certificates, sizeof(certificates)); in load_public_identity_files()
2118 memcpy(options.certificate_file_userprovided, in load_public_identity_files()