]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Never set user's timestamp higher than our ioloop_time.
authorTimo Sirainen <tss@iki.fi>
Thu, 19 Apr 2012 19:17:34 +0000 (22:17 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 19 Apr 2012 19:17:34 +0000 (22:17 +0300)
src/director/user-directory.c

index 18f19b6a8cd88825132f313716deda079931ecf4..87236ee5e5172431cfc2bceb1a4d877e5f0bf3a8 100644 (file)
@@ -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);