From: Timo Sirainen Date: Wed, 19 Nov 2008 18:03:33 +0000 (+0200) Subject: IMAP: SETACL + or - was broken. X-Git-Tag: 1.2.alpha4~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c3d40f3092af25cad9e807a85eaad4d92aab107b;p=thirdparty%2Fdovecot%2Fcore.git IMAP: SETACL + or - was broken. --HG-- branch : HEAD --- diff --git a/src/plugins/imap-acl/imap-acl-plugin.c b/src/plugins/imap-acl/imap-acl-plugin.c index b418434dd9..0912de480d 100644 --- a/src/plugins/imap-acl/imap-acl-plugin.c +++ b/src/plugins/imap-acl/imap-acl-plugin.c @@ -382,20 +382,6 @@ static bool cmd_setacl(struct client_command_context *cmd) identifier++; } - if (imap_acl_identifier_parse(identifier, &update.rights, - TRUE, &error) < 0) { - client_send_command_error(cmd, error); - return TRUE; - } - if (imap_acl_letters_parse(rights, &update.rights.rights, &error) < 0) { - client_send_command_error(cmd, error); - return TRUE; - } - - box = acl_mailbox_open_as_admin(cmd, mailbox); - if (box == NULL) - return TRUE; - switch (*rights) { case '-': update.modify_mode = ACL_MODIFY_MODE_REMOVE; @@ -410,6 +396,20 @@ static bool cmd_setacl(struct client_command_context *cmd) break; } + if (imap_acl_identifier_parse(identifier, &update.rights, + TRUE, &error) < 0) { + client_send_command_error(cmd, error); + return TRUE; + } + if (imap_acl_letters_parse(rights, &update.rights.rights, &error) < 0) { + client_send_command_error(cmd, error); + return TRUE; + } + + box = acl_mailbox_open_as_admin(cmd, mailbox); + if (box == NULL) + return TRUE; + if (negative) { update.neg_modify_mode = update.modify_mode; update.modify_mode = ACL_MODIFY_MODE_REMOVE;