]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/auth.c
Enhance handling of connection attempts when hitting the connection limit
[netatalk.git] / etc / afpd / auth.c
index bec624dc6cd32efc72b9838381a5b8f12ad6593b..ed08bbfa8532fec275ac8c92d5ddc58d1c2a88da 100644 (file)
@@ -222,6 +222,11 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expi
         return AFPERR_NOTAUTH;
     }
 
+    if (obj->cnx_cnt >= obj->cnx_max) {
+        LOG(log_error, logtype_dsi, "login: too many connections, limit: %d", obj->cnx_max);
+        return AFPERR_MAXSESS;
+    }
+
     LOG(log_note, logtype_afpd, "%s Login by %s",
         afp_versions[afp_version_index].av_name, pwd->pw_name);