dovecot-2.0: mdbox: Storage rebuild now silently ignores m.*.loc...

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 29 17:48:59 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/1f5570ec0682
changeset: 11214:1f5570ec0682
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 29 17:48:57 2010 +0300
description:
mdbox: Storage rebuild now silently ignores m.*.lock files if they exist.

diffstat:

 src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (31 lines):

diff -r 7493f94d544c -r 1f5570ec0682 src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c
--- a/src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c	Thu Apr 29 17:33:05 2010 +0300
+++ b/src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c	Thu Apr 29 17:48:57 2010 +0300
@@ -214,8 +214,7 @@
 {
 	struct dbox_file *file;
 	uint32_t file_id;
-	const char *fname;
-	unsigned int len;
+	const char *fname, *ext;
 	bool deleted;
 	int ret = 0;
 
@@ -224,10 +223,13 @@
 	fname += strlen(MDBOX_MAIL_FILE_PREFIX) + 1;
 
 	if (str_to_uint32(fname, &file_id) < 0 || file_id == 0) {
-		len = strlen(fname);
-		if (len > 7 && strcmp(fname + len - 7, ".broken") != 0) {
-			i_warning("dbox rebuild: File name is missing ID: %s",
-				  path);
+		/* m.*.broken files are created by file fixing
+		   m.*.lock files are created if flock() isn't available */
+		ext = strrchr(fname, '.');
+		if (ext == NULL || (strcmp(ext, ".broken") != 0 &&
+				    strcmp(ext, ".lock") != 0)) {
+			i_warning("dbox rebuild: "
+				  "Skipping file with missing ID: %s", path);
 		}
 		return 0;
 	}


More information about the dovecot-cvs mailing list