[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c, 1.145.2.14, 1.145.2.15

tss at dovecot.org tss at dovecot.org
Fri Mar 30 17:23:51 EEST 2007


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

Modified Files:
      Tag: branch_1_0
	mbox-storage.c 
Log Message:
Check that mailbox name is valid even when opening a stream.



Index: mbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.145.2.14
retrieving revision 1.145.2.15
diff -u -d -r1.145.2.14 -r1.145.2.15
--- mbox-storage.c	27 Mar 2007 19:59:27 -0000	1.145.2.14
+++ mbox-storage.c	30 Mar 2007 14:23:49 -0000	1.145.2.15
@@ -765,6 +765,11 @@
 
 	mail_storage_clear_error(_storage);
 
+	if (!mbox_is_valid_existing_name(_storage, name)) {
+		mail_storage_set_error(_storage, "Invalid mailbox name");
+		return NULL;
+	}
+
 	if (input != NULL)
 		return mbox_mailbox_open_stream(storage, name, input, flags);
 
@@ -775,11 +780,6 @@
 		return mbox_open(storage, "INBOX", flags);
 	}
 
-	if (!mbox_is_valid_existing_name(_storage, name)) {
-		mail_storage_set_error(_storage, "Invalid mailbox name");
-		return NULL;
-	}
-
 	path = mbox_get_path(istorage, name);
 	if (stat(path, &st) == 0) {
 		if (S_ISDIR(st.st_mode)) {



More information about the dovecot-cvs mailing list