From 40857852760cec8b0207fccfd4e091ea9fc953dd Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 14 Jul 2001 12:17:33 +1000 Subject: [PATCH] - OpenBSD CVS Sync - stevesk@cvs.openbsd.org 2001/07/08 15:23:38 [servconf.c] fix ``MaxStartups max''; ok markus@ --- ChangeLog | 5 ++++- servconf.c | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3ef541c6..cfa3983cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,9 @@ - stevesk@cvs.openbsd.org 2001/07/05 20:32:47 [sshconnect1.c] statement after label; ok dugsong@ + - stevesk@cvs.openbsd.org 2001/07/08 15:23:38 + [servconf.c] + fix ``MaxStartups max''; ok markus@ 20010711 - (djm) dirname(3) may modify its argument on glibc and other systems. @@ -5997,4 +6000,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1391 2001/07/14 02:16:59 djm Exp $ +$Id: ChangeLog,v 1.1392 2001/07/14 02:17:33 djm Exp $ diff --git a/servconf.c b/servconf.c index 858ad3164..47eb66d83 100644 --- a/servconf.c +++ b/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 @@ -389,7 +389,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) { @@ -801,20 +801,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;