dovecot-2.0: sdbox: Fixed moving files from alt storage to prima...

dovecot at dovecot.org dovecot at dovecot.org
Wed Feb 1 23:34:29 EET 2012


details:   http://hg.dovecot.org/dovecot-2.0/rev/dcc19b00e748
changeset: 13035:dcc19b00e748
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Feb 01 23:34:24 2012 +0200
description:
sdbox: Fixed moving files from alt storage to primary storage.

diffstat:

 src/lib-storage/index/dbox-single/sdbox-sync.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (21 lines):

diff -r c30ea8aec902 -r dcc19b00e748 src/lib-storage/index/dbox-single/sdbox-sync.c
--- a/src/lib-storage/index/dbox-single/sdbox-sync.c	Sun Jan 29 00:35:40 2012 +0200
+++ b/src/lib-storage/index/dbox-single/sdbox-sync.c	Wed Feb 01 23:34:24 2012 +0200
@@ -12,9 +12,17 @@
 dbox_sync_file_move_if_needed(struct dbox_file *file,
 			      enum sdbox_sync_entry_type type)
 {
+	struct stat st;
 	bool move_to_alt = type == SDBOX_SYNC_ENTRY_TYPE_MOVE_TO_ALT;
 	bool deleted;
 
+	if (move_to_alt == dbox_file_is_in_alt(file) &&
+	    !move_to_alt) {
+		/* unopened dbox files default to primary dir.
+		   stat the file to update its location. */
+		(void)dbox_file_stat(file, &st);
+
+	}
 	if (move_to_alt != dbox_file_is_in_alt(file)) {
 		/* move the file. if it fails, nothing broke so
 		   don't worry about it. */


More information about the dovecot-cvs mailing list