dovecot-2.1: login: Minor potential authentication fix when serv...

dovecot at dovecot.org dovecot at dovecot.org
Fri Nov 18 16:17:05 EET 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/80558d1b7040
changeset: 13721:80558d1b7040
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Nov 18 15:52:23 2011 +0200
description:
login: Minor potential authentication fix when service_count>1

diffstat:

 src/login-common/client-common.c |  7 ++++---
 src/login-common/login-common.h  |  1 +
 src/login-common/main.c          |  2 ++
 3 files changed, 7 insertions(+), 3 deletions(-)

diffs (49 lines):

diff -r 81eff56d8bc1 -r 80558d1b7040 src/login-common/client-common.c
--- a/src/login-common/client-common.c	Thu Nov 17 02:02:30 2011 +0200
+++ b/src/login-common/client-common.c	Fri Nov 18 15:52:23 2011 +0200
@@ -156,11 +156,12 @@
 	if (client->ssl_proxy != NULL)
 		ssl_proxy_free(&client->ssl_proxy);
 	client->v.destroy(client);
-	if (client_unref(&client) &&
-	    master_service_get_service_count(master_service) == 1) {
+	if (client_unref(&client) && initial_service_count == 1) {
 		/* as soon as this connection is done with proxying
 		   (or whatever), the process will die. there's no need for
-		   authentication anymore, so close the connection. */
+		   authentication anymore, so close the connection.
+		   do this only with initial service_count=1, in case there
+		   are other clients with pending authentications */
 		auth_client_disconnect(auth_client);
 	}
 	login_client_destroyed();
diff -r 81eff56d8bc1 -r 80558d1b7040 src/login-common/login-common.h
--- a/src/login-common/login-common.h	Thu Nov 17 02:02:30 2011 +0200
+++ b/src/login-common/login-common.h	Fri Nov 18 15:52:23 2011 +0200
@@ -35,6 +35,7 @@
 extern bool closing_down;
 extern struct anvil_client *anvil;
 extern const char *login_rawlog_dir;
+extern unsigned int initial_service_count;
 
 extern const struct login_settings *global_login_settings;
 extern void **global_other_settings;
diff -r 81eff56d8bc1 -r 80558d1b7040 src/login-common/main.c
--- a/src/login-common/main.c	Thu Nov 17 02:02:30 2011 +0200
+++ b/src/login-common/main.c	Fri Nov 18 15:52:23 2011 +0200
@@ -37,6 +37,7 @@
 bool closing_down;
 struct anvil_client *anvil;
 const char *login_rawlog_dir = NULL;
+unsigned int initial_service_count;
 
 const struct login_settings *global_login_settings;
 void **global_other_settings;
@@ -286,6 +287,7 @@
 	restrict_access_by_env(NULL, TRUE);
 	if (allow_core_dumps)
 		restrict_access_allow_coredumps(TRUE);
+	initial_service_count = master_service_get_service_count(master_service);
 }
 
 static void main_init(const char *login_socket)


More information about the dovecot-cvs mailing list