From: Timo Sirainen Date: Fri, 6 Aug 2010 19:03:44 +0000 (+0100) Subject: mdbox: Make sure we don't try to append to a file we already closed. X-Git-Tag: 2.0.rc5~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2584a4cfb8d952362808af4298d5f5a0969377f8;p=thirdparty%2Fdovecot%2Fcore.git mdbox: Make sure we don't try to append to a file we already closed. --- diff --git a/src/lib-storage/index/dbox-multi/mdbox-map.c b/src/lib-storage/index/dbox-multi/mdbox-map.c index 736ff8f873..77a668a0fe 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-map.c +++ b/src/lib-storage/index/dbox-multi/mdbox-map.c @@ -848,6 +848,12 @@ mdbox_map_find_existing_append(struct mdbox_map_append_context *ctx, if (dbox_file_is_in_alt(append->file) != want_altpath) continue; + if (append->file->fd == -1) { + /* already closed it (below). we might be able to still + fit some small mail there, but that's too much + trouble */ + continue; + } append_offset = append->output->offset; if (append_offset + mail_size <= map->set->mdbox_rotate_size &&