From: Timo Sirainen Date: Mon, 9 Aug 2010 14:33:20 +0000 (+0100) Subject: imap-acl: Don't allow ACL commands for mailboxes that don't exist. X-Git-Tag: 2.0.rc5~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1367c36972e6c98920c8f8b5e71cd03564ca8955;p=thirdparty%2Fdovecot%2Fcore.git imap-acl: Don't allow ACL commands for mailboxes that don't exist. --- diff --git a/src/plugins/imap-acl/imap-acl-plugin.c b/src/plugins/imap-acl/imap-acl-plugin.c index 0d70b366d0..f32ee32240 100644 --- a/src/plugins/imap-acl/imap-acl-plugin.c +++ b/src/plugins/imap-acl/imap-acl-plugin.c @@ -70,9 +70,13 @@ acl_mailbox_open_as_admin(struct client_command_context *cmd, const char *name) if (ns == NULL) return NULL; - if (status == MAILBOX_NAME_INVALID) { + switch (status) { + case MAILBOX_NAME_INVALID: + case MAILBOX_NAME_VALID: client_fail_mailbox_name_status(cmd, name, NULL, status); return NULL; + default: + break; } /* Force opening the mailbox so that we can give a nicer error message