dovecot-2.0: director: If same user gets redirected to two hosts...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 18 18:37:13 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/ecf195115922
changeset: 11581:ecf195115922
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 18 16:37:09 2010 +0100
description:
director: If same user gets redirected to two hosts, don't crash later.

diffstat:

 src/director/director-connection.c |  6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r 6aa749b789ef -r ecf195115922 src/director/director-connection.c
--- a/src/director/director-connection.c	Fri Jun 18 16:28:49 2010 +0100
+++ b/src/director/director-connection.c	Fri Jun 18 16:37:09 2010 +0100
@@ -175,7 +175,13 @@
 			"%s and %s", username_hash,
 			net_ip2addr(&user->host->ip),
 			net_ip2addr(&host->ip));
+
+		/* change the host anyway. we'll also need to remove the user
+		   from the old host's user_count, because we can't keep track
+		   of the user for more than one host */
+		user->host->user_count--;
 		user->host = host;
+		user->host->user_count++;
 		ret = TRUE;
 	}
 	*user_r = user;


More information about the dovecot-cvs mailing list