diff options
author | Kevin Steves <stevesk@cvs.openbsd.org> | 2001-07-08 15:23:39 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@cvs.openbsd.org> | 2001-07-08 15:23:39 +0000 |
commit | 9ef486037a1093d48bcf55d23d88f4bf398a6b75 (patch) | |
tree | 1637457343ee1d9a70296de774a5c60207c42360 /usr.bin/ssh/servconf.c | |
parent | 9acfd1ad9b3057c53c30848f1351f78e9a151016 (diff) |
fix ``MaxStartups max''; ok markus@
Diffstat (limited to 'usr.bin/ssh/servconf.c')
-rw-r--r-- | usr.bin/ssh/servconf.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c index 5294d7f5f82..b5be29a3cf7 100644 --- a/usr.bin/ssh/servconf.c +++ b/usr.bin/ssh/servconf.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: servconf.c,v 1.86 2001/06/26 17:41:49 dugsong Exp $"); +RCSID("$OpenBSD: servconf.c,v 1.87 2001/07/08 15:23:38 stevesk Exp $"); #ifdef KRB4 #include <krb.h> @@ -384,7 +384,7 @@ read_server_config(ServerOptions *options, const char *filename) int linenum, *intptr, value; int bad_options = 0; ServerOpCodes opcode; - int i; + int i, n; f = fopen(filename, "r"); if (!f) { @@ -796,20 +796,22 @@ parse_flag: if (!arg || *arg == '\0') fatal("%s line %d: Missing MaxStartups spec.", filename, linenum); - if (sscanf(arg, "%d:%d:%d", + if ((n = sscanf(arg, "%d:%d:%d", &options->max_startups_begin, &options->max_startups_rate, - &options->max_startups) == 3) { + &options->max_startups)) == 3) { if (options->max_startups_begin > options->max_startups || options->max_startups_rate > 100 || options->max_startups_rate < 1) + fatal("%s line %d: Illegal MaxStartups spec.", + filename, linenum); + } else if (n != 1) fatal("%s line %d: Illegal MaxStartups spec.", - filename, linenum); - break; - } - intptr = &options->max_startups; - goto parse_int; + filename, linenum); + else + options->max_startups = options->max_startups_begin; + break; case sBanner: charptr = &options->banner; |