[dovecot-cvs] dovecot/src/lib-storage/index/dbox dbox-storage.c, 1.15.2.8, 1.15.2.9

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


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

Modified Files:
      Tag: branch_1_0
	dbox-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: dbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/dbox/dbox-storage.c,v
retrieving revision 1.15.2.8
retrieving revision 1.15.2.9
diff -u -d -r1.15.2.8 -r1.15.2.9
--- dbox-storage.c	28 Dec 2006 16:51:06 -0000	1.15.2.8
+++ dbox-storage.c	3 Jan 2007 22:40:30 -0000	1.15.2.9
@@ -285,8 +285,11 @@
 dbox_get_path(struct index_storage *storage, const char *name)
 {
 	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);
 }
@@ -344,10 +347,13 @@
 
 	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),
-				   "/"DBOX_MAILDIR_NAME"/", p+1, NULL);
+		if (home_try_expand(&name) == 0) {
+			p = strrchr(name, '/');
+			return t_strconcat(p == NULL ? name :
+					   t_strdup_until(name, p),
+					   "/"DBOX_MAILDIR_NAME"/", p+1, NULL);
+		}
+		/* home expansion failed. just create the directory as ~dir. */
 	}
 
 	return t_strconcat(storage->index_dir,



More information about the dovecot-cvs mailing list