Lines Matching refs:options

69 initialize_server_options(ServerOptions *options)  in initialize_server_options()  argument
71 (void) memset(options, 0, sizeof(*options)); in initialize_server_options()
74 options->num_ports = 0; in initialize_server_options()
75 options->ports_from_cmdline = 0; in initialize_server_options()
76 options->listen_addrs = NULL; in initialize_server_options()
77 options->num_host_key_files = 0; in initialize_server_options()
78 options->pid_file = NULL; in initialize_server_options()
79 options->server_key_bits = -1; in initialize_server_options()
80 options->login_grace_time = -1; in initialize_server_options()
81 options->key_regeneration_time = -1; in initialize_server_options()
82 options->permit_root_login = PERMIT_NOT_SET; in initialize_server_options()
83 options->ignore_rhosts = -1; in initialize_server_options()
84 options->ignore_user_known_hosts = -1; in initialize_server_options()
85 options->print_motd = -1; in initialize_server_options()
86 options->print_lastlog = -1; in initialize_server_options()
87 options->x11_forwarding = -1; in initialize_server_options()
88 options->x11_display_offset = -1; in initialize_server_options()
89 options->x11_use_localhost = -1; in initialize_server_options()
90 options->xauth_location = NULL; in initialize_server_options()
91 options->strict_modes = -1; in initialize_server_options()
92 options->keepalives = -1; in initialize_server_options()
93 options->log_facility = SYSLOG_FACILITY_NOT_SET; in initialize_server_options()
94 options->log_level = SYSLOG_LEVEL_NOT_SET; in initialize_server_options()
95 options->rhosts_authentication = -1; in initialize_server_options()
96 options->rhosts_rsa_authentication = -1; in initialize_server_options()
97 options->hostbased_authentication = -1; in initialize_server_options()
98 options->hostbased_uses_name_from_packet_only = -1; in initialize_server_options()
99 options->rsa_authentication = -1; in initialize_server_options()
100 options->pubkey_authentication = -1; in initialize_server_options()
102 options->gss_authentication = -1; in initialize_server_options()
103 options->gss_keyex = -1; in initialize_server_options()
104 options->gss_store_creds = -1; in initialize_server_options()
105 options->gss_use_session_ccache = -1; in initialize_server_options()
106 options->gss_cleanup_creds = -1; in initialize_server_options()
109 options->kerberos_authentication = -1; in initialize_server_options()
110 options->kerberos_or_local_passwd = -1; in initialize_server_options()
111 options->kerberos_ticket_cleanup = -1; in initialize_server_options()
114 options->kerberos_tgt_passing = -1; in initialize_server_options()
117 options->afs_token_passing = -1; in initialize_server_options()
119 options->password_authentication = -1; in initialize_server_options()
120 options->kbd_interactive_authentication = -1; in initialize_server_options()
121 options->challenge_response_authentication = -1; in initialize_server_options()
122 options->pam_authentication_via_kbd_int = -1; in initialize_server_options()
123 options->permit_empty_passwd = -1; in initialize_server_options()
124 options->permit_user_env = -1; in initialize_server_options()
125 options->compression = -1; in initialize_server_options()
126 options->allow_tcp_forwarding = -1; in initialize_server_options()
127 options->num_allow_users = 0; in initialize_server_options()
128 options->num_deny_users = 0; in initialize_server_options()
129 options->num_allow_groups = 0; in initialize_server_options()
130 options->num_deny_groups = 0; in initialize_server_options()
131 options->ciphers = NULL; in initialize_server_options()
132 options->macs = NULL; in initialize_server_options()
133 options->protocol = SSH_PROTO_UNKNOWN; in initialize_server_options()
134 options->gateway_ports = -1; in initialize_server_options()
135 options->num_subsystems = 0; in initialize_server_options()
136 options->max_startups_begin = -1; in initialize_server_options()
137 options->max_startups_rate = -1; in initialize_server_options()
138 options->max_startups = -1; in initialize_server_options()
139 options->banner = NULL; in initialize_server_options()
140 options->verify_reverse_mapping = -1; in initialize_server_options()
141 options->client_alive_interval = -1; in initialize_server_options()
142 options->client_alive_count_max = -1; in initialize_server_options()
143 options->authorized_keys_file = NULL; in initialize_server_options()
144 options->authorized_keys_file2 = NULL; in initialize_server_options()
146 options->max_auth_tries = -1; in initialize_server_options()
147 options->max_auth_tries_log = -1; in initialize_server_options()
149 options->max_init_auth_tries = -1; in initialize_server_options()
150 options->max_init_auth_tries_log = -1; in initialize_server_options()
152 options->lookup_client_hostnames = -1; in initialize_server_options()
153 options->use_openssl_engine = -1; in initialize_server_options()
154 options->chroot_directory = NULL; in initialize_server_options()
155 options->pre_userauth_hook = NULL; in initialize_server_options()
156 options->pam_service_name = NULL; in initialize_server_options()
157 options->pam_service_prefix = NULL; in initialize_server_options()
180 deflt_fill_default_server_options(ServerOptions *options) in deflt_fill_default_server_options() argument
193 if (options->permit_root_login == PERMIT_NOT_SET && in deflt_fill_default_server_options()
195 options->permit_root_login = PERMIT_NO_PASSWD; in deflt_fill_default_server_options()
197 if (options->permit_empty_passwd == -1 && in deflt_fill_default_server_options()
200 options->permit_empty_passwd = 0; in deflt_fill_default_server_options()
202 options->permit_empty_passwd = 1; in deflt_fill_default_server_options()
205 if (options->max_init_auth_tries == -1 && in deflt_fill_default_server_options()
207 options->max_init_auth_tries = atoi(ptr); in deflt_fill_default_server_options()
210 if (options->max_init_auth_tries_log == -1 && in deflt_fill_default_server_options()
212 options->max_init_auth_tries_log = atoi(ptr); in deflt_fill_default_server_options()
215 if (options->login_grace_time == -1) { in deflt_fill_default_server_options()
217 options->login_grace_time = (unsigned)atoi(ptr); in deflt_fill_default_server_options()
219 options->login_grace_time = 300; in deflt_fill_default_server_options()
227 fill_default_server_options(ServerOptions *options) in fill_default_server_options() argument
231 deflt_fill_default_server_options(options); in fill_default_server_options()
235 if (options->protocol == SSH_PROTO_UNKNOWN) in fill_default_server_options()
236 options->protocol = SSH_PROTO_1|SSH_PROTO_2; in fill_default_server_options()
237 if (options->num_host_key_files == 0) { in fill_default_server_options()
239 if (options->protocol & SSH_PROTO_1) in fill_default_server_options()
240 options->host_key_files[options->num_host_key_files++] = in fill_default_server_options()
244 if (options->protocol & SSH_PROTO_2) { in fill_default_server_options()
245 options->host_key_files[options->num_host_key_files++] = in fill_default_server_options()
247 options->host_key_files[options->num_host_key_files++] = in fill_default_server_options()
252 if (options->num_ports == 0) in fill_default_server_options()
253 options->ports[options->num_ports++] = SSH_DEFAULT_PORT; in fill_default_server_options()
254 if (options->listen_addrs == NULL) in fill_default_server_options()
255 add_listen_addr(options, NULL, 0); in fill_default_server_options()
256 if (options->pid_file == NULL) in fill_default_server_options()
257 options->pid_file = _PATH_SSH_DAEMON_PID_FILE; in fill_default_server_options()
258 if (options->server_key_bits == -1) in fill_default_server_options()
259 options->server_key_bits = 768; in fill_default_server_options()
260 if (options->login_grace_time == -1) in fill_default_server_options()
261 options->login_grace_time = 120; in fill_default_server_options()
262 if (options->key_regeneration_time == -1) in fill_default_server_options()
263 options->key_regeneration_time = 3600; in fill_default_server_options()
264 if (options->permit_root_login == PERMIT_NOT_SET) in fill_default_server_options()
265 options->permit_root_login = PERMIT_YES; in fill_default_server_options()
266 if (options->ignore_rhosts == -1) in fill_default_server_options()
267 options->ignore_rhosts = 1; in fill_default_server_options()
268 if (options->ignore_user_known_hosts == -1) in fill_default_server_options()
269 options->ignore_user_known_hosts = 0; in fill_default_server_options()
270 if (options->print_motd == -1) in fill_default_server_options()
271 options->print_motd = 1; in fill_default_server_options()
272 if (options->print_lastlog == -1) in fill_default_server_options()
273 options->print_lastlog = 1; in fill_default_server_options()
274 if (options->x11_forwarding == -1) in fill_default_server_options()
275 options->x11_forwarding = 1; in fill_default_server_options()
276 if (options->x11_display_offset == -1) in fill_default_server_options()
277 options->x11_display_offset = 10; in fill_default_server_options()
278 if (options->x11_use_localhost == -1) in fill_default_server_options()
279 options->x11_use_localhost = 1; in fill_default_server_options()
280 if (options->xauth_location == NULL) in fill_default_server_options()
281 options->xauth_location = _PATH_XAUTH; in fill_default_server_options()
282 if (options->strict_modes == -1) in fill_default_server_options()
283 options->strict_modes = 1; in fill_default_server_options()
284 if (options->keepalives == -1) in fill_default_server_options()
285 options->keepalives = 1; in fill_default_server_options()
286 if (options->log_facility == SYSLOG_FACILITY_NOT_SET) in fill_default_server_options()
287 options->log_facility = SYSLOG_FACILITY_AUTH; in fill_default_server_options()
288 if (options->log_level == SYSLOG_LEVEL_NOT_SET) in fill_default_server_options()
289 options->log_level = SYSLOG_LEVEL_INFO; in fill_default_server_options()
290 if (options->rhosts_authentication == -1) in fill_default_server_options()
291 options->rhosts_authentication = 0; in fill_default_server_options()
292 if (options->rhosts_rsa_authentication == -1) in fill_default_server_options()
293 options->rhosts_rsa_authentication = 0; in fill_default_server_options()
294 if (options->hostbased_authentication == -1) in fill_default_server_options()
295 options->hostbased_authentication = 0; in fill_default_server_options()
296 if (options->hostbased_uses_name_from_packet_only == -1) in fill_default_server_options()
297 options->hostbased_uses_name_from_packet_only = 0; in fill_default_server_options()
298 if (options->rsa_authentication == -1) in fill_default_server_options()
299 options->rsa_authentication = 1; in fill_default_server_options()
300 if (options->pubkey_authentication == -1) in fill_default_server_options()
301 options->pubkey_authentication = 1; in fill_default_server_options()
303 if (options->gss_authentication == -1) in fill_default_server_options()
304 options->gss_authentication = 1; in fill_default_server_options()
305 if (options->gss_keyex == -1) in fill_default_server_options()
306 options->gss_keyex = 1; in fill_default_server_options()
307 if (options->gss_store_creds == -1) in fill_default_server_options()
308 options->gss_store_creds = 1; in fill_default_server_options()
309 if (options->gss_use_session_ccache == -1) in fill_default_server_options()
310 options->gss_use_session_ccache = 1; in fill_default_server_options()
311 if (options->gss_cleanup_creds == -1) in fill_default_server_options()
312 options->gss_cleanup_creds = 1; in fill_default_server_options()
315 if (options->kerberos_authentication == -1) in fill_default_server_options()
316 options->kerberos_authentication = 0; in fill_default_server_options()
317 if (options->kerberos_or_local_passwd == -1) in fill_default_server_options()
318 options->kerberos_or_local_passwd = 1; in fill_default_server_options()
319 if (options->kerberos_ticket_cleanup == -1) in fill_default_server_options()
320 options->kerberos_ticket_cleanup = 1; in fill_default_server_options()
323 if (options->kerberos_tgt_passing == -1) in fill_default_server_options()
324 options->kerberos_tgt_passing = 0; in fill_default_server_options()
327 if (options->afs_token_passing == -1) in fill_default_server_options()
328 options->afs_token_passing = 0; in fill_default_server_options()
330 if (options->password_authentication == -1) in fill_default_server_options()
331 options->password_authentication = 1; in fill_default_server_options()
336 if (options->kbd_interactive_authentication == -1) in fill_default_server_options()
337 options->kbd_interactive_authentication = 1; in fill_default_server_options()
338 if (options->challenge_response_authentication == -1) in fill_default_server_options()
339 options->challenge_response_authentication = 1; in fill_default_server_options()
340 if (options->permit_empty_passwd == -1) in fill_default_server_options()
341 options->permit_empty_passwd = 0; in fill_default_server_options()
342 if (options->permit_user_env == -1) in fill_default_server_options()
343 options->permit_user_env = 0; in fill_default_server_options()
344 if (options->compression == -1) in fill_default_server_options()
345 options->compression = 1; in fill_default_server_options()
346 if (options->allow_tcp_forwarding == -1) in fill_default_server_options()
347 options->allow_tcp_forwarding = 1; in fill_default_server_options()
348 if (options->gateway_ports == -1) in fill_default_server_options()
349 options->gateway_ports = 0; in fill_default_server_options()
350 if (options->max_startups == -1) in fill_default_server_options()
351 options->max_startups = 10; in fill_default_server_options()
352 if (options->max_startups_rate == -1) in fill_default_server_options()
353 options->max_startups_rate = 100; /* 100% */ in fill_default_server_options()
354 if (options->max_startups_begin == -1) in fill_default_server_options()
355 options->max_startups_begin = options->max_startups; in fill_default_server_options()
356 if (options->verify_reverse_mapping == -1) in fill_default_server_options()
357 options->verify_reverse_mapping = 0; in fill_default_server_options()
358 if (options->client_alive_interval == -1) in fill_default_server_options()
359 options->client_alive_interval = 0; in fill_default_server_options()
360 if (options->client_alive_count_max == -1) in fill_default_server_options()
361 options->client_alive_count_max = 3; in fill_default_server_options()
362 if (options->authorized_keys_file2 == NULL) { in fill_default_server_options()
364 if (options->authorized_keys_file != NULL) in fill_default_server_options()
365 options->authorized_keys_file2 = options->authorized_keys_file; in fill_default_server_options()
367 options->authorized_keys_file2 = _PATH_SSH_USER_PERMITTED_KEYS2; in fill_default_server_options()
369 if (options->authorized_keys_file == NULL) in fill_default_server_options()
370 options->authorized_keys_file = _PATH_SSH_USER_PERMITTED_KEYS; in fill_default_server_options()
372 if (options->max_auth_tries == -1) in fill_default_server_options()
373 options->max_auth_tries = AUTH_FAIL_MAX; in fill_default_server_options()
374 if (options->max_auth_tries_log == -1) in fill_default_server_options()
375 options->max_auth_tries_log = options->max_auth_tries / 2; in fill_default_server_options()
377 if (options->max_init_auth_tries == -1) in fill_default_server_options()
378 options->max_init_auth_tries = AUTH_FAIL_MAX; in fill_default_server_options()
379 if (options->max_init_auth_tries_log == -1) in fill_default_server_options()
380 options->max_init_auth_tries_log = options->max_init_auth_tries / 2; in fill_default_server_options()
382 if (options->lookup_client_hostnames == -1) in fill_default_server_options()
383 options->lookup_client_hostnames = 1; in fill_default_server_options()
384 if (options->use_openssl_engine == -1) in fill_default_server_options()
385 options->use_openssl_engine = 1; in fill_default_server_options()
386 if (options->pam_service_prefix == NULL) in fill_default_server_options()
387 options->pam_service_prefix = _SSH_PAM_SERVICE_PREFIX; in fill_default_server_options()
388 if (options->pam_service_name == NULL) in fill_default_server_options()
389 options->pam_service_name = NULL; in fill_default_server_options()
561 add_listen_addr(ServerOptions *options, char *addr, u_short port) in add_listen_addr() argument
565 if (options->num_ports == 0) in add_listen_addr()
566 options->ports[options->num_ports++] = SSH_DEFAULT_PORT; in add_listen_addr()
568 for (i = 0; i < options->num_ports; i++) in add_listen_addr()
569 add_one_listen_addr(options, addr, options->ports[i]); in add_listen_addr()
571 add_one_listen_addr(options, addr, port); in add_listen_addr()
575 add_one_listen_addr(ServerOptions *options, char *addr, u_short port) in add_one_listen_addr() argument
592 ai->ai_next = options->listen_addrs; in add_one_listen_addr()
593 options->listen_addrs = aitop; in add_one_listen_addr()
732 process_server_config_line(ServerOptions *options, char *line, in process_server_config_line() argument
776 intptr = &options->pam_authentication_via_kbd_int; in process_server_config_line()
784 if (options->ports_from_cmdline) in process_server_config_line()
786 if (options->listen_addrs != NULL) in process_server_config_line()
789 if (options->num_ports >= MAX_PORTS) in process_server_config_line()
796 options->ports[options->num_ports++] = a2port(arg); in process_server_config_line()
797 if (options->ports[options->num_ports-1] == 0) in process_server_config_line()
803 intptr = &options->server_key_bits; in process_server_config_line()
815 intptr = &options->login_grace_time; in process_server_config_line()
829 intptr = &options->key_regeneration_time; in process_server_config_line()
845 add_listen_addr(options, arg, 0); in process_server_config_line()
860 add_listen_addr(options, arg, port); in process_server_config_line()
863 add_listen_addr(options, arg, 0); in process_server_config_line()
870 intptr = &options->num_host_key_files; in process_server_config_line()
874 charptr = &options->host_key_files[*intptr]; in process_server_config_line()
889 charptr = &options->pid_file; in process_server_config_line()
893 intptr = &options->permit_root_login; in process_server_config_line()
917 intptr = &options->ignore_rhosts; in process_server_config_line()
936 intptr = &options->ignore_user_known_hosts; in process_server_config_line()
940 intptr = &options->rhosts_authentication; in process_server_config_line()
944 intptr = &options->rhosts_rsa_authentication; in process_server_config_line()
948 intptr = &options->hostbased_authentication; in process_server_config_line()
952 intptr = &options->hostbased_uses_name_from_packet_only; in process_server_config_line()
956 intptr = &options->rsa_authentication; in process_server_config_line()
960 intptr = &options->pubkey_authentication; in process_server_config_line()
964 intptr = &options->gss_authentication; in process_server_config_line()
967 intptr = &options->gss_keyex; in process_server_config_line()
970 intptr = &options->gss_keyex; in process_server_config_line()
974 intptr = &options->gss_use_session_ccache; in process_server_config_line()
977 intptr = &options->gss_cleanup_creds; in process_server_config_line()
983 intptr = &options->kerberos_authentication; in process_server_config_line()
987 intptr = &options->kerberos_or_local_passwd; in process_server_config_line()
991 intptr = &options->kerberos_ticket_cleanup; in process_server_config_line()
996 intptr = &options->kerberos_tgt_passing; in process_server_config_line()
1001 intptr = &options->afs_token_passing; in process_server_config_line()
1006 intptr = &options->password_authentication; in process_server_config_line()
1010 intptr = &options->kbd_interactive_authentication; in process_server_config_line()
1014 intptr = &options->challenge_response_authentication; in process_server_config_line()
1018 intptr = &options->print_motd; in process_server_config_line()
1022 intptr = &options->print_lastlog; in process_server_config_line()
1026 intptr = &options->x11_forwarding; in process_server_config_line()
1030 intptr = &options->x11_display_offset; in process_server_config_line()
1034 intptr = &options->x11_use_localhost; in process_server_config_line()
1038 charptr = &options->xauth_location; in process_server_config_line()
1042 intptr = &options->strict_modes; in process_server_config_line()
1046 intptr = &options->keepalives; in process_server_config_line()
1050 intptr = &options->permit_empty_passwd; in process_server_config_line()
1054 intptr = &options->permit_user_env; in process_server_config_line()
1065 intptr = &options->compression; in process_server_config_line()
1069 intptr = &options->gateway_ports; in process_server_config_line()
1089 intptr = &options->verify_reverse_mapping; in process_server_config_line()
1093 intptr = (int *) &options->log_facility; in process_server_config_line()
1104 intptr = (int *) &options->log_level; in process_server_config_line()
1115 intptr = &options->allow_tcp_forwarding; in process_server_config_line()
1127 if (options->num_allow_users >= MAX_ALLOW_USERS) in process_server_config_line()
1130 options->allow_users[options->num_allow_users++] = in process_server_config_line()
1137 if (options->num_deny_users >= MAX_DENY_USERS) in process_server_config_line()
1140 options->deny_users[options->num_deny_users++] = in process_server_config_line()
1147 if (options->num_allow_groups >= MAX_ALLOW_GROUPS) in process_server_config_line()
1150 options->allow_groups[options->num_allow_groups++] = in process_server_config_line()
1157 if (options->num_deny_groups >= MAX_DENY_GROUPS) in process_server_config_line()
1160 options->deny_groups[options->num_deny_groups++] = xstrdup(arg); in process_server_config_line()
1171 if (options->ciphers == NULL) in process_server_config_line()
1172 options->ciphers = xstrdup(arg); in process_server_config_line()
1182 if (options->macs == NULL) in process_server_config_line()
1183 options->macs = xstrdup(arg); in process_server_config_line()
1187 intptr = &options->protocol; in process_server_config_line()
1200 if (options->num_subsystems >= MAX_SUBSYSTEMS) { in process_server_config_line()
1212 for (i = 0; i < options->num_subsystems; i++) in process_server_config_line()
1213 if (strcmp(arg, options->subsystem_name[i]) == 0) in process_server_config_line()
1216 options->subsystem_name[options->num_subsystems] = xstrdup(arg); in process_server_config_line()
1221 options->subsystem_command[options->num_subsystems] = xstrdup(arg); in process_server_config_line()
1236 options->subsystem_args[options->num_subsystems] = p; in process_server_config_line()
1237 options->num_subsystems++; in process_server_config_line()
1246 &options->max_startups_begin, in process_server_config_line()
1247 &options->max_startups_rate, in process_server_config_line()
1248 &options->max_startups)) == 3) { in process_server_config_line()
1249 if (options->max_startups_begin > in process_server_config_line()
1250 options->max_startups || in process_server_config_line()
1251 options->max_startups_rate > 100 || in process_server_config_line()
1252 options->max_startups_rate < 1) in process_server_config_line()
1259 options->max_startups = options->max_startups_begin; in process_server_config_line()
1263 charptr = &options->banner; in process_server_config_line()
1274 &options->authorized_keys_file : in process_server_config_line()
1275 &options->authorized_keys_file2; in process_server_config_line()
1279 intptr = &options->client_alive_interval; in process_server_config_line()
1283 intptr = &options->client_alive_count_max; in process_server_config_line()
1287 intptr = &options->max_auth_tries; in process_server_config_line()
1291 intptr = &options->max_auth_tries_log; in process_server_config_line()
1295 intptr = &options->lookup_client_hostnames; in process_server_config_line()
1299 intptr = &options->use_openssl_engine; in process_server_config_line()
1303 charptr = &options->chroot_directory; in process_server_config_line()
1314 charptr = &options->pre_userauth_hook; in process_server_config_line()
1340 if (options->pam_service_name != NULL) in process_server_config_line()
1343 if (options->pam_service_prefix == NULL) in process_server_config_line()
1344 options->pam_service_prefix = xstrdup(arg); in process_server_config_line()
1352 if (options->pam_service_prefix != NULL) in process_server_config_line()
1355 if (options->pam_service_name == NULL) in process_server_config_line()
1356 options->pam_service_name = xstrdup(arg); in process_server_config_line()
1402 parse_server_match_config(ServerOptions *options, const char *user, in parse_server_match_config() argument
1409 copy_set_server_options(options, &mo, 0); in parse_server_match_config()
1462 parse_server_config(ServerOptions *options, const char *filename, Buffer *conf, in parse_server_config() argument
1474 if (process_server_config_line(options, cp, filename, in parse_server_config()