From: Timo Sirainen Date: Fri, 18 Jun 2010 15:37:09 +0000 (+0100) Subject: director: If same user gets redirected to two hosts, don't crash later. X-Git-Tag: 2.0.rc1~137 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36a687c1ed3ce55520bdf28cd2fa1f653360068d;p=thirdparty%2Fdovecot%2Fcore.git director: If same user gets redirected to two hosts, don't crash later. --HG-- branch : HEAD --- diff --git a/src/director/director-connection.c b/src/director/director-connection.c index b398497c2f..4fff94e684 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -175,7 +175,13 @@ director_user_refresh(struct director *dir, unsigned int username_hash, "%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;