dovecot-2.0: dbox: dbox file could have been closed too early in...

dovecot at dovecot.org dovecot at dovecot.org
Mon Nov 15 17:42:25 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/967de059f94d
changeset: 12417:967de059f94d
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Nov 15 15:42:21 2010 +0000
description:
dbox: dbox file could have been closed too early in some situations, causing EBADF errors.

diffstat:

 src/lib-storage/index/dbox-common/dbox-mail.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r eb08ed7c6a7b -r 967de059f94d src/lib-storage/index/dbox-common/dbox-mail.c
--- a/src/lib-storage/index/dbox-common/dbox-mail.c	Mon Nov 15 15:31:26 2010 +0000
+++ b/src/lib-storage/index/dbox-common/dbox-mail.c	Mon Nov 15 15:42:21 2010 +0000
@@ -32,9 +32,11 @@
 {
 	struct dbox_mail *mail = (struct dbox_mail *)_mail;
 
+	index_mail_close(_mail);
+	/* close the dbox file only after index is closed, since it may still
+	   try to read from it. */
 	if (mail->open_file != NULL)
 		dbox_file_unref(&mail->open_file);
-	index_mail_close(_mail);
 }
 
 int dbox_mail_metadata_read(struct dbox_mail *mail, struct dbox_file **file_r)


More information about the dovecot-cvs mailing list