[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c, 1.145.2.5, 1.145.2.6

tss at dovecot.org tss at dovecot.org
Wed Jan 3 22:40:33 UTC 2007


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

Modified Files:
      Tag: branch_1_0
	mbox-storage.c 
Log Message:
mail_full_filesystem_access=yes: If trying to access ~user directory for a user that doesn't exist, just treat it as a normal mailbox that begins with '~'. Before we created such mailboxes into home directory and trying to delete them crashed.



Index: mbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.145.2.5
retrieving revision 1.145.2.6
diff -u -d -r1.145.2.5 -r1.145.2.6
--- mbox-storage.c	3 Dec 2006 13:29:56 -0000	1.145.2.5
+++ mbox-storage.c	3 Jan 2007 22:40:31 -0000	1.145.2.6
@@ -448,10 +448,14 @@
 
 	if ((storage->storage.flags & MAIL_STORAGE_FLAG_FULL_FS_ACCESS) != 0 &&
 	    (*name == '/' || *name == '~')) {
-		name = home_expand(name);
-		p = strrchr(name, '/');
-		return t_strconcat(t_strdup_until(name, p),
-				   "/"MBOX_INDEX_DIR_NAME"/", p+1, NULL);
+		if (home_try_expand(&name) == 0) {
+			p = strrchr(name, '/');
+			return t_strconcat(p == NULL ? name :
+					   t_strdup_until(name, p),
+					   "/"MBOX_INDEX_DIR_NAME"/",
+					   p+1, NULL);
+		}
+		/* home expansion failed. just create the directory as ~dir. */
 	}
 
 	p = strrchr(name, '/');
@@ -505,8 +509,11 @@
 	if (strcmp(name, "INBOX") == 0)
 		return storage->inbox_path;
 	if ((storage->storage.flags & MAIL_STORAGE_FLAG_FULL_FS_ACCESS) != 0 &&
-	    (*name == '/' || *name == '~'))
-		return home_expand(name);
+	    (*name == '/' || *name == '~')) {
+		if (home_try_expand(&name) == 0)
+			return name;
+		/* fallback to using ~dir */
+	}
 	return t_strconcat(storage->dir, "/", name, NULL);
 }
 



More information about the dovecot-cvs mailing list