]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: If same user gets redirected to two hosts, don't crash later.
authorTimo Sirainen <tss@iki.fi>
Fri, 18 Jun 2010 15:37:09 +0000 (16:37 +0100)
committerTimo Sirainen <tss@iki.fi>
Fri, 18 Jun 2010 15:37:09 +0000 (16:37 +0100)
--HG--
branch : HEAD

src/director/director-connection.c

index b398497c2f5726b598f15479a26f06fd22bffbac..4fff94e6848a773440bb63f2328559a22a33551b 100644 (file)
@@ -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;