summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'servconf.c')
-rw-r--r--servconf.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/servconf.c b/servconf.c
index 202c45066..1a7a5f182 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
1 1
2/* $OpenBSD: servconf.c,v 1.301 2016/11/30 03:00:05 djm Exp $ */ 2/* $OpenBSD: servconf.c,v 1.306 2017/03/14 07:19:07 djm Exp $ */
3/* 3/*
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved 5 * All rights reserved
@@ -553,7 +553,7 @@ static struct {
553 { "clientalivecountmax", sClientAliveCountMax, SSHCFG_ALL }, 553 { "clientalivecountmax", sClientAliveCountMax, SSHCFG_ALL },
554 { "authorizedkeysfile", sAuthorizedKeysFile, SSHCFG_ALL }, 554 { "authorizedkeysfile", sAuthorizedKeysFile, SSHCFG_ALL },
555 { "authorizedkeysfile2", sDeprecated, SSHCFG_ALL }, 555 { "authorizedkeysfile2", sDeprecated, SSHCFG_ALL },
556 { "useprivilegeseparation", sUsePrivilegeSeparation, SSHCFG_GLOBAL}, 556 { "useprivilegeseparation", sDeprecated, SSHCFG_GLOBAL},
557 { "acceptenv", sAcceptEnv, SSHCFG_ALL }, 557 { "acceptenv", sAcceptEnv, SSHCFG_ALL },
558 { "permittunnel", sPermitTunnel, SSHCFG_ALL }, 558 { "permittunnel", sPermitTunnel, SSHCFG_ALL },
559 { "permittty", sPermitTTY, SSHCFG_ALL }, 559 { "permittty", sPermitTTY, SSHCFG_ALL },
@@ -985,6 +985,15 @@ process_server_config_line(ServerOptions *options, char *line,
985 long long val64; 985 long long val64;
986 const struct multistate *multistate_ptr; 986 const struct multistate *multistate_ptr;
987 987
988 /* Strip trailing whitespace. Allow \f (form feed) at EOL only */
989 if ((len = strlen(line)) == 0)
990 return 0;
991 for (len--; len > 0; len--) {
992 if (strchr(WHITESPACE "\f", line[len]) == NULL)
993 break;
994 line[len] = '\0';
995 }
996
988 cp = line; 997 cp = line;
989 if ((arg = strdelim(&cp)) == NULL) 998 if ((arg = strdelim(&cp)) == NULL)
990 return 0; 999 return 0;
@@ -1187,7 +1196,8 @@ process_server_config_line(ServerOptions *options, char *line,
1187 if (!arg || *arg == '\0') 1196 if (!arg || *arg == '\0')
1188 fatal("%s line %d: Missing argument.", 1197 fatal("%s line %d: Missing argument.",
1189 filename, linenum); 1198 filename, linenum);
1190 if (!sshkey_names_valid2(*arg == '+' ? arg + 1 : arg, 1)) 1199 if (*arg != '-' &&
1200 !sshkey_names_valid2(*arg == '+' ? arg + 1 : arg, 1))
1191 fatal("%s line %d: Bad key types '%s'.", 1201 fatal("%s line %d: Bad key types '%s'.",
1192 filename, linenum, arg ? arg : "<NONE>"); 1202 filename, linenum, arg ? arg : "<NONE>");
1193 if (*activep && *charptr == NULL) 1203 if (*activep && *charptr == NULL)
@@ -1391,11 +1401,6 @@ process_server_config_line(ServerOptions *options, char *line,
1391 intptr = &options->disable_forwarding; 1401 intptr = &options->disable_forwarding;
1392 goto parse_flag; 1402 goto parse_flag;
1393 1403
1394 case sUsePrivilegeSeparation:
1395 intptr = &use_privsep;
1396 multistate_ptr = multistate_privsep;
1397 goto parse_multistate;
1398
1399 case sAllowUsers: 1404 case sAllowUsers:
1400 while ((arg = strdelim(&cp)) && *arg != '\0') { 1405 while ((arg = strdelim(&cp)) && *arg != '\0') {
1401 if (options->num_allow_users >= MAX_ALLOW_USERS) 1406 if (options->num_allow_users >= MAX_ALLOW_USERS)
@@ -1454,7 +1459,7 @@ process_server_config_line(ServerOptions *options, char *line,
1454 arg = strdelim(&cp); 1459 arg = strdelim(&cp);
1455 if (!arg || *arg == '\0') 1460 if (!arg || *arg == '\0')
1456 fatal("%s line %d: Missing argument.", filename, linenum); 1461 fatal("%s line %d: Missing argument.", filename, linenum);
1457 if (!ciphers_valid(*arg == '+' ? arg + 1 : arg)) 1462 if (*arg != '-' && !ciphers_valid(*arg == '+' ? arg + 1 : arg))
1458 fatal("%s line %d: Bad SSH2 cipher spec '%s'.", 1463 fatal("%s line %d: Bad SSH2 cipher spec '%s'.",
1459 filename, linenum, arg ? arg : "<NONE>"); 1464 filename, linenum, arg ? arg : "<NONE>");
1460 if (options->ciphers == NULL) 1465 if (options->ciphers == NULL)
@@ -1465,7 +1470,7 @@ process_server_config_line(ServerOptions *options, char *line,
1465 arg = strdelim(&cp); 1470 arg = strdelim(&cp);
1466 if (!arg || *arg == '\0') 1471 if (!arg || *arg == '\0')
1467 fatal("%s line %d: Missing argument.", filename, linenum); 1472 fatal("%s line %d: Missing argument.", filename, linenum);
1468 if (!mac_valid(*arg == '+' ? arg + 1 : arg)) 1473 if (*arg != '-' && !mac_valid(*arg == '+' ? arg + 1 : arg))
1469 fatal("%s line %d: Bad SSH2 mac spec '%s'.", 1474 fatal("%s line %d: Bad SSH2 mac spec '%s'.",
1470 filename, linenum, arg ? arg : "<NONE>"); 1475 filename, linenum, arg ? arg : "<NONE>");
1471 if (options->macs == NULL) 1476 if (options->macs == NULL)
@@ -1477,7 +1482,8 @@ process_server_config_line(ServerOptions *options, char *line,
1477 if (!arg || *arg == '\0') 1482 if (!arg || *arg == '\0')
1478 fatal("%s line %d: Missing argument.", 1483 fatal("%s line %d: Missing argument.",
1479 filename, linenum); 1484 filename, linenum);
1480 if (!kex_names_valid(*arg == '+' ? arg + 1 : arg)) 1485 if (*arg != '-' &&
1486 !kex_names_valid(*arg == '+' ? arg + 1 : arg))
1481 fatal("%s line %d: Bad SSH2 KexAlgorithms '%s'.", 1487 fatal("%s line %d: Bad SSH2 KexAlgorithms '%s'.",
1482 filename, linenum, arg ? arg : "<NONE>"); 1488 filename, linenum, arg ? arg : "<NONE>");
1483 if (options->kex_algorithms == NULL) 1489 if (options->kex_algorithms == NULL)
@@ -2127,8 +2133,6 @@ fmt_intarg(ServerOpCodes code, int val)
2127 return fmt_multistate_int(val, multistate_gatewayports); 2133 return fmt_multistate_int(val, multistate_gatewayports);
2128 case sCompression: 2134 case sCompression:
2129 return fmt_multistate_int(val, multistate_compression); 2135 return fmt_multistate_int(val, multistate_compression);
2130 case sUsePrivilegeSeparation:
2131 return fmt_multistate_int(val, multistate_privsep);
2132 case sAllowTcpForwarding: 2136 case sAllowTcpForwarding:
2133 return fmt_multistate_int(val, multistate_tcpfwd); 2137 return fmt_multistate_int(val, multistate_tcpfwd);
2134 case sAllowStreamLocalForwarding: 2138 case sAllowStreamLocalForwarding:
@@ -2179,8 +2183,6 @@ dump_cfg_fmtint(ServerOpCodes code, int val)
2179static void 2183static void
2180dump_cfg_string(ServerOpCodes code, const char *val) 2184dump_cfg_string(ServerOpCodes code, const char *val)
2181{ 2185{
2182 if (val == NULL)
2183 return;
2184 printf("%s %s\n", lookup_opcode_name(code), 2186 printf("%s %s\n", lookup_opcode_name(code),
2185 val == NULL ? "none" : val); 2187 val == NULL ? "none" : val);
2186} 2188}
@@ -2309,7 +2311,6 @@ dump_config(ServerOptions *o)
2309 dump_cfg_fmtint(sDisableForwarding, o->disable_forwarding); 2311 dump_cfg_fmtint(sDisableForwarding, o->disable_forwarding);
2310 dump_cfg_fmtint(sAllowStreamLocalForwarding, o->allow_streamlocal_forwarding); 2312 dump_cfg_fmtint(sAllowStreamLocalForwarding, o->allow_streamlocal_forwarding);
2311 dump_cfg_fmtint(sStreamLocalBindUnlink, o->fwd_opts.streamlocal_bind_unlink); 2313 dump_cfg_fmtint(sStreamLocalBindUnlink, o->fwd_opts.streamlocal_bind_unlink);
2312 dump_cfg_fmtint(sUsePrivilegeSeparation, use_privsep);
2313 dump_cfg_fmtint(sFingerprintHash, o->fingerprint_hash); 2314 dump_cfg_fmtint(sFingerprintHash, o->fingerprint_hash);
2314 2315
2315 /* string arguments */ 2316 /* string arguments */