From: Timo Sirainen Date: Thu, 19 Apr 2012 19:17:34 +0000 (+0300) Subject: director: Never set user's timestamp higher than our ioloop_time. X-Git-Tag: 2.1.5~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=069d9f1da8dffdce72a80650217eb92450dee643;p=thirdparty%2Fdovecot%2Fcore.git director: Never set user's timestamp higher than our ioloop_time. --- diff --git a/src/director/user-directory.c b/src/director/user-directory.c index 18f19b6a8c..87236ee5e5 100644 --- a/src/director/user-directory.c +++ b/src/director/user-directory.c @@ -132,11 +132,12 @@ user_directory_add(struct user_directory *dir, unsigned int username_hash, struct user *user; if (timestamp == (time_t)-1) { - /* make sure we add it at the end */ + /* add it at the end */ timestamp = ioloop_time; - if (dir->tail != NULL && - timestamp < (time_t)dir->tail->timestamp) - timestamp = (time_t)dir->tail->timestamp; + } else { + /* make sure we don't add timestamps higher than ioloop time */ + if (timestamp > ioloop_time) + timestamp = ioloop_time; } user = i_new(struct user, 1);