diff options
Diffstat (limited to 'servconf.c')
-rw-r--r-- | servconf.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/servconf.c b/servconf.c index 477204cfd..6affb51e9 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: servconf.c,v 1.49 2000/07/14 22:59:46 markus Exp $"); | 15 | RCSID("$OpenBSD: servconf.c,v 1.50 2000/07/22 09:14:36 markus Exp $"); |
16 | 16 | ||
17 | #include "ssh.h" | 17 | #include "ssh.h" |
18 | #include "servconf.h" | 18 | #include "servconf.h" |
@@ -76,6 +76,8 @@ initialize_server_options(ServerOptions *options) | |||
76 | options->protocol = SSH_PROTO_UNKNOWN; | 76 | options->protocol = SSH_PROTO_UNKNOWN; |
77 | options->gateway_ports = -1; | 77 | options->gateway_ports = -1; |
78 | options->num_subsystems = 0; | 78 | options->num_subsystems = 0; |
79 | options->max_startups_begin = -1; | ||
80 | options->max_startups_rate = -1; | ||
79 | options->max_startups = -1; | 81 | options->max_startups = -1; |
80 | } | 82 | } |
81 | 83 | ||
@@ -162,6 +164,10 @@ fill_default_server_options(ServerOptions *options) | |||
162 | options->gateway_ports = 0; | 164 | options->gateway_ports = 0; |
163 | if (options->max_startups == -1) | 165 | if (options->max_startups == -1) |
164 | options->max_startups = 10; | 166 | options->max_startups = 10; |
167 | if (options->max_startups_rate == -1) | ||
168 | options->max_startups_rate = 100; /* 100% */ | ||
169 | if (options->max_startups_begin == -1) | ||
170 | options->max_startups_begin = options->max_startups; | ||
165 | } | 171 | } |
166 | 172 | ||
167 | /* Keyword tokens. */ | 173 | /* Keyword tokens. */ |
@@ -644,6 +650,22 @@ parse_flag: | |||
644 | break; | 650 | break; |
645 | 651 | ||
646 | case sMaxStartups: | 652 | case sMaxStartups: |
653 | arg = strdelim(&cp); | ||
654 | if (!arg || *arg == '\0') | ||
655 | fatal("%s line %d: Missing MaxStartups spec.", | ||
656 | filename, linenum); | ||
657 | if (sscanf(arg, "%d:%d:%d", | ||
658 | &options->max_startups_begin, | ||
659 | &options->max_startups_rate, | ||
660 | &options->max_startups) == 3) { | ||
661 | if (options->max_startups_begin > | ||
662 | options->max_startups || | ||
663 | options->max_startups_rate > 100 || | ||
664 | options->max_startups_rate < 1) | ||
665 | fatal("%s line %d: Illegal MaxStartups spec.", | ||
666 | filename, linenum); | ||
667 | break; | ||
668 | } | ||
647 | intptr = &options->max_startups; | 669 | intptr = &options->max_startups; |
648 | goto parse_int; | 670 | goto parse_int; |
649 | 671 | ||