From: Timo Sirainen Date: Tue, 2 Nov 2010 18:21:05 +0000 (+0000) Subject: lib-master: Stop accepting new connections after auth-master gets disconnected. X-Git-Tag: 2.0.7~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4c8182e19f1a74706473ee88aa4701458ea5b1d;p=thirdparty%2Fdovecot%2Fcore.git lib-master: Stop accepting new connections after auth-master gets disconnected. --- diff --git a/src/lib-master/master-login-auth.c b/src/lib-master/master-login-auth.c index 374740c983..faa5c37a9e 100644 --- a/src/lib-master/master-login-auth.c +++ b/src/lib-master/master-login-auth.c @@ -10,6 +10,7 @@ #include "hash.h" #include "str.h" #include "master-interface.h" +#include "master-service.h" #include "master-auth.h" #include "master-login-auth.h" @@ -282,7 +283,10 @@ static void master_login_auth_input(struct master_login_auth *auth) case 0: return; case -1: - /* disconnected */ + /* disconnected. stop accepting new connections, because in + default configuration we no longer have permissions to + connect back to auth-master */ + master_service_stop_new_connections(master_service); master_login_auth_disconnect(auth); return; case -2: @@ -411,6 +415,9 @@ void master_login_auth_request(struct master_login_auth *auth, if (auth->fd == -1) { if (master_login_auth_connect(auth) < 0) { + /* we couldn't connect to auth now, + so we probably can't in future either. */ + master_service_stop_new_connections(master_service); callback(NULL, MASTER_AUTH_ERRMSG_INTERNAL_FAILURE, context); return;