[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c, 1.95, 1.96

cras at dovecot.org cras at dovecot.org
Sun Sep 5 21:37:19 EEST 2004


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

Modified Files:
	mbox-storage.c 
Log Message:
Don't allow renaming mailboxes under INBOX.



Index: mbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- mbox-storage.c	5 Sep 2004 17:53:46 -0000	1.95
+++ mbox-storage.c	5 Sep 2004 18:37:17 -0000	1.96
@@ -501,7 +501,8 @@
 		   in the root mail directory. that would anyway be a special
 		   case which would require special handling elsewhere, so just
 		   don't allow it. */
-		mail_storage_set_error(_storage, "Mailbox already exists");
+		mail_storage_set_error(_storage,
+				"Mailbox doesn't allow inferior mailboxes");
 		return -1;
 	}
 
@@ -665,6 +666,13 @@
 		return -1;
 	}
 
+	if (strncasecmp(newname, "INBOX/", 6) == 0) {
+		/* Not allowed - see explanation in mbox_mailbox_create */
+		mail_storage_set_error(_storage,
+			"Target mailbox doesn't allow inferior mailboxes");
+		return -1;
+	}
+
 	oldpath = mbox_get_path(storage, oldname);
 	newpath = mbox_get_path(storage, newname);
 



More information about the dovecot-cvs mailing list