dovecot: Changed assert to first check if dotlock had been overr...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Jan 7 07:38:22 EET 2008
details: http://hg.dovecot.org/dovecot/rev/9fef306a0d95
changeset: 7135:9fef306a0d95
user: Timo Sirainen <tss at iki.fi>
date: Mon Jan 07 07:38:16 2008 +0200
description:
Changed assert to first check if dotlock had been overridden, and if so log
an error instead of crashing.
diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
src/lib-storage/index/maildir/maildir-uidlist.c | 7 ++++++-
diffs (18 lines):
diff -r 9c2b65bfe604 -r 9fef306a0d95 src/lib-storage/index/maildir/maildir-uidlist.c
--- a/src/lib-storage/index/maildir/maildir-uidlist.c Mon Jan 07 07:37:37 2008 +0200
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c Mon Jan 07 07:38:16 2008 +0200
@@ -1015,8 +1015,13 @@ static int maildir_uidlist_recreate(stru
i_error("fstat(%s) failed: %m", temp_path);
(void)close(fd);
ret = -1;
+ } else if (file_size != (uoff_t)st.st_size) {
+ i_assert(!file_dotlock_is_locked(uidlist->dotlock));
+ i_error("Maildir uidlist dotlock overridden: %s",
+ uidlist->path);
+ (void)close(fd);
+ ret = -1;
} else {
- i_assert(file_size == (uoff_t)st.st_size);
maildir_uidlist_close(uidlist);
uidlist->fd = fd;
uidlist->fd_dev = st.st_dev;
More information about the dovecot-cvs
mailing list