From c3d40f3092af25cad9e807a85eaad4d92aab107b Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 19 Nov 2008 20:03:33 +0200 Subject: [PATCH] IMAP: SETACL + or - was broken. --HG-- branch : HEAD --- src/plugins/imap-acl/imap-acl-plugin.c | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) 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; -- 2.47.3