dovecot-2.0: imap-acl: Don't allow accessing "" as mailbox.

dovecot at dovecot.org dovecot at dovecot.org
Wed Aug 4 19:19:22 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/85bdc6f6ff30
changeset: 11931:85bdc6f6ff30
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Aug 04 17:18:54 2010 +0100
description:
imap-acl: Don't allow accessing "" as mailbox.

diffstat:

 src/plugins/imap-acl/imap-acl-plugin.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r eb1f471a924d -r 85bdc6f6ff30 src/plugins/imap-acl/imap-acl-plugin.c
--- a/src/plugins/imap-acl/imap-acl-plugin.c	Wed Aug 04 16:54:17 2010 +0100
+++ b/src/plugins/imap-acl/imap-acl-plugin.c	Wed Aug 04 17:18:54 2010 +0100
@@ -58,6 +58,7 @@
 	struct mail_namespace *ns;
 	struct mailbox *box;
 	const char *storage_name;
+	enum mailbox_name_status status;
 	int ret;
 
 	if (ACL_USER_CONTEXT(cmd->client->user) == NULL) {
@@ -65,10 +66,15 @@
 		return NULL;
 	}
 
-	ns = client_find_namespace(cmd, name, &storage_name, NULL);
+	ns = client_find_namespace(cmd, name, &storage_name, &status);
 	if (ns == NULL)
 		return NULL;
 
+	if (status == MAILBOX_NAME_INVALID) {
+		client_fail_mailbox_name_status(cmd, name, NULL, status);
+		return NULL;
+	}
+
 	/* Force opening the mailbox so that we can give a nicer error message
 	   if mailbox isn't selectable but is listable. */
 	box = mailbox_alloc(ns->list, storage_name, ACL_MAILBOX_FLAGS |


More information about the dovecot-cvs mailing list