]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mdbox: Make sure we don't try to append to a file we already closed.
authorTimo Sirainen <tss@iki.fi>
Fri, 6 Aug 2010 19:03:44 +0000 (20:03 +0100)
committerTimo Sirainen <tss@iki.fi>
Fri, 6 Aug 2010 19:03:44 +0000 (20:03 +0100)
src/lib-storage/index/dbox-multi/mdbox-map.c

index 736ff8f87344aa521dbd67ae6177223a41ecaf0c..77a668a0fe78244b333045c899ec9005f7e4a13b 100644 (file)
@@ -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 &&