]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
IMAP: SETACL +<rights> or -<rights> was broken.
authorTimo Sirainen <tss@iki.fi>
Wed, 19 Nov 2008 18:03:33 +0000 (20:03 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 19 Nov 2008 18:03:33 +0000 (20:03 +0200)
--HG--
branch : HEAD

src/plugins/imap-acl/imap-acl-plugin.c

index b418434dd9f63f8e0b447aed30fefaf4ccf6a36e..0912de480d0ef52e7235c2c1e1e8da92424f2d43 100644 (file)
@@ -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;