From: Timo Sirainen Date: Mon, 22 Jun 2009 04:10:00 +0000 (-0400) Subject: imap-acl: Command parameter reading wasn't done correctly. X-Git-Tag: 2.0.alpha1~550 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=04a7b696e5255aa956277a0f7cabee736c69ec96;p=thirdparty%2Fdovecot%2Fcore.git imap-acl: Command parameter reading wasn't done correctly. --HG-- branch : HEAD --- diff --git a/src/plugins/imap-acl/imap-acl-plugin.c b/src/plugins/imap-acl/imap-acl-plugin.c index 23b32b1ca1..572db6e0ee 100644 --- a/src/plugins/imap-acl/imap-acl-plugin.c +++ b/src/plugins/imap-acl/imap-acl-plugin.c @@ -248,10 +248,8 @@ static bool cmd_getacl(struct client_command_context *cmd) string_t *str; int ret; - if (!client_read_string_args(cmd, 1, &mailbox)) { - client_send_command_error(cmd, "Invalid arguments."); - return TRUE; - } + if (!client_read_string_args(cmd, 1, &mailbox)) + return FALSE; box = acl_mailbox_open_as_admin(cmd, mailbox); if (box == NULL) @@ -284,10 +282,8 @@ static bool cmd_myrights(struct client_command_context *cmd) const char *const *rights; string_t *str; - if (!client_read_string_args(cmd, 1, &mailbox)) { - client_send_command_error(cmd, "Invalid arguments."); - return TRUE; - } + if (!client_read_string_args(cmd, 1, &mailbox)) + return FALSE; if (ACL_USER_CONTEXT(cmd->client->user) == NULL) { client_send_command_error(cmd, "ACLs disabled."); @@ -336,10 +332,8 @@ static bool cmd_listrights(struct client_command_context *cmd) const char *mailbox, *identifier; string_t *str; - if (!client_read_string_args(cmd, 2, &mailbox, &identifier)) { - client_send_command_error(cmd, "Invalid arguments."); - return TRUE; - } + if (!client_read_string_args(cmd, 2, &mailbox, &identifier)) + return FALSE; box = acl_mailbox_open_as_admin(cmd, mailbox); if (box == NULL) @@ -502,8 +496,10 @@ static bool cmd_setacl(struct client_command_context *cmd) const char *mailbox, *identifier, *rights, *error; bool negative = FALSE; - if (!client_read_string_args(cmd, 3, &mailbox, &identifier, &rights) || - *identifier == '\0') { + if (!client_read_string_args(cmd, 3, &mailbox, &identifier, &rights)) + return FALSE; + + if (*identifier == '\0') { client_send_command_error(cmd, "Invalid arguments."); return TRUE; } @@ -593,8 +589,9 @@ static bool cmd_deleteacl(struct client_command_context *cmd) struct acl_rights_update update; const char *mailbox, *identifier, *error; - if (!client_read_string_args(cmd, 2, &mailbox, &identifier) || - *identifier == '\0') { + if (!client_read_string_args(cmd, 2, &mailbox, &identifier)) + return FALSE; + if (*identifier == '\0') { client_send_command_error(cmd, "Invalid arguments."); return TRUE; }