[dovecot-cvs] dovecot/src/lib-index mail-index-fsck.c, 1.20, 1.21 mail-index.c, 1.124, 1.125

cras at procontrol.fi cras at procontrol.fi
Mon May 24 05:29:45 EEST 2004


Update of /home/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv27871/lib-index

Modified Files:
	mail-index-fsck.c mail-index.c 
Log Message:
Some more UIDVALIDITY issues fixed.



Index: mail-index-fsck.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index-fsck.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- a/mail-index-fsck.c	22 May 2004 22:23:29 -0000	1.20
+++ b/mail-index-fsck.c	24 May 2004 02:29:43 -0000	1.21
@@ -35,8 +35,8 @@
 	/* locking already does the most important sanity checks for header */
 	hdr = *index->hdr;
 
-	if (hdr.uid_validity == 0) {
-		*error_r = "uid_validity = 0";
+	if (hdr.uid_validity == 0 && hdr.next_uid != 1) {
+		*error_r = "uid_validity = 0 && next_uid != 1";
 		return 0;
 	}
 

Index: mail-index.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- a/mail-index.c	24 May 2004 01:50:16 -0000	1.124
+++ b/mail-index.c	24 May 2004 02:29:43 -0000	1.125
@@ -68,9 +68,10 @@
 	}
 
 	/* following some extra checks that only take a bit of CPU */
-	if (hdr->uid_validity == 0) {
+	if (hdr->uid_validity == 0 && hdr->next_uid != 1) {
 		mail_index_set_error(index, "Corrupted index file %s: "
-				     "uid_validity = 0", index->filepath);
+				     "uid_validity = 0, next_uid = %u",
+				     index->filepath, hdr->next_uid);
 		return -1;
 	}
 
@@ -379,7 +380,6 @@
 
 	hdr->indexid = now;
 
-	hdr->uid_validity = now;
 	hdr->next_uid = 1;
 }
 



More information about the dovecot-cvs mailing list