[dovecot-cvs] dovecot/src/lib-storage/index/dbox dbox-save.c, 1.17, 1.18

cras at dovecot.org cras at dovecot.org
Mon Jul 24 01:40:57 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/dbox
In directory talvi:/tmp/cvs-serv4506

Modified Files:
	dbox-save.c 
Log Message:
When saving a mail with initial keywords, lock the uidlist before doing
anything with the file's header.



Index: dbox-save.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/dbox/dbox-save.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- dbox-save.c	23 Jul 2006 15:37:56 -0000	1.17
+++ dbox-save.c	23 Jul 2006 22:40:54 -0000	1.18
@@ -154,6 +154,18 @@
 
 	t_push();
 	if (keywords != NULL && keywords->count > 0) {
+		uint32_t uid;
+		time_t mtime;
+
+		/* uidlist must be locked while we're reading or modifying
+		   file's header */
+		if (dbox_uidlist_append_get_first_uid(ctx->append_ctx,
+						      &uid, &mtime) < 0) {
+			ctx->failed = TRUE;
+			t_pop();
+			return -1;
+		}
+
 		/* write keywords to the file */
 		file_keywords = buffer_create_dynamic(pool_datastack_create(),
 						      DBOX_KEYWORD_COUNT);



More information about the dovecot-cvs mailing list