]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: Stop accepting new connections after auth-master gets disconnected.
authorTimo Sirainen <tss@iki.fi>
Tue, 2 Nov 2010 18:21:05 +0000 (18:21 +0000)
committerTimo Sirainen <tss@iki.fi>
Tue, 2 Nov 2010 18:21:05 +0000 (18:21 +0000)
src/lib-master/master-login-auth.c

index 374740c9835ff78423048c238f8e5970221bfe3a..faa5c37a9eab7735d2fa6f5248fe4eccf12a3f23 100644 (file)
@@ -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;