Fix off-by-one connection limit check
authorRalph Boehme <sloowfranklin@gmail.com>
Mon, 23 Sep 2013 09:47:11 +0000 (11:47 +0200)
committerRalph Boehme <sloowfranklin@gmail.com>
Mon, 23 Sep 2013 09:47:11 +0000 (11:47 +0200)
etc/afpd/auth.c

index ed08bbfa8532fec275ac8c92d5ddc58d1c2a88da..3759538fa82aa5d725938cdf24566a26d592004e 100644 (file)
@@ -222,7 +222,7 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expi
         return AFPERR_NOTAUTH;
     }
 
-    if (obj->cnx_cnt >= obj->cnx_max) {
+    if (obj->cnx_cnt > obj->cnx_max) {
         LOG(log_error, logtype_dsi, "login: too many connections, limit: %d", obj->cnx_max);
         return AFPERR_MAXSESS;
     }