summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--servconf.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/servconf.c b/servconf.c
index fadfa2757..5606c3c7f 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: servconf.c,v 1.267 2015/05/01 04:17:51 djm Exp $ */ 1/* $OpenBSD: servconf.c,v 1.268 2015/05/01 07:08:08 djm Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -1018,7 +1018,7 @@ process_server_config_line(ServerOptions *options, char *line,
1018 if ((value = convtime(arg)) == -1) 1018 if ((value = convtime(arg)) == -1)
1019 fatal("%s line %d: invalid time value.", 1019 fatal("%s line %d: invalid time value.",
1020 filename, linenum); 1020 filename, linenum);
1021 if (*intptr == -1) 1021 if (*activep && *intptr == -1)
1022 *intptr = value; 1022 *intptr = value;
1023 break; 1023 break;
1024 1024
@@ -1596,7 +1596,7 @@ process_server_config_line(ServerOptions *options, char *line,
1596 if (value == -1) 1596 if (value == -1)
1597 fatal("%s line %d: Bad yes/point-to-point/ethernet/" 1597 fatal("%s line %d: Bad yes/point-to-point/ethernet/"
1598 "no argument: %s", filename, linenum, arg); 1598 "no argument: %s", filename, linenum, arg);
1599 if (*intptr == -1) 1599 if (*activep && *intptr == -1)
1600 *intptr = value; 1600 *intptr = value;
1601 break; 1601 break;
1602 1602
@@ -1735,7 +1735,7 @@ process_server_config_line(ServerOptions *options, char *line,
1735 break; 1735 break;
1736 1736
1737 case sAuthenticationMethods: 1737 case sAuthenticationMethods:
1738 if (*activep && options->num_auth_methods == 0) { 1738 if (options->num_auth_methods == 0) {
1739 while ((arg = strdelim(&cp)) && *arg != '\0') { 1739 while ((arg = strdelim(&cp)) && *arg != '\0') {
1740 if (options->num_auth_methods >= 1740 if (options->num_auth_methods >=
1741 MAX_AUTH_METHODS) 1741 MAX_AUTH_METHODS)
@@ -1746,6 +1746,8 @@ process_server_config_line(ServerOptions *options, char *line,
1746 fatal("%s line %d: invalid " 1746 fatal("%s line %d: invalid "
1747 "authentication method list.", 1747 "authentication method list.",
1748 filename, linenum); 1748 filename, linenum);
1749 if (!*activep)
1750 continue;
1749 options->auth_methods[ 1751 options->auth_methods[
1750 options->num_auth_methods++] = xstrdup(arg); 1752 options->num_auth_methods++] = xstrdup(arg);
1751 } 1753 }
@@ -1755,13 +1757,14 @@ process_server_config_line(ServerOptions *options, char *line,
1755 case sStreamLocalBindMask: 1757 case sStreamLocalBindMask:
1756 arg = strdelim(&cp); 1758 arg = strdelim(&cp);
1757 if (!arg || *arg == '\0') 1759 if (!arg || *arg == '\0')
1758 fatal("%s line %d: missing StreamLocalBindMask argument.", 1760 fatal("%s line %d: missing StreamLocalBindMask "
1759 filename, linenum); 1761 "argument.", filename, linenum);
1760 /* Parse mode in octal format */ 1762 /* Parse mode in octal format */
1761 value = strtol(arg, &p, 8); 1763 value = strtol(arg, &p, 8);
1762 if (arg == p || value < 0 || value > 0777) 1764 if (arg == p || value < 0 || value > 0777)
1763 fatal("%s line %d: Bad mask.", filename, linenum); 1765 fatal("%s line %d: Bad mask.", filename, linenum);
1764 options->fwd_opts.streamlocal_bind_mask = (mode_t)value; 1766 if (*activep)
1767 options->fwd_opts.streamlocal_bind_mask = (mode_t)value;
1765 break; 1768 break;
1766 1769
1767 case sStreamLocalBindUnlink: 1770 case sStreamLocalBindUnlink: