dovecot-2.0: imap-acl: Command parameter reading wasn't done cor...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 22 07:12:10 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/a268f8fd89b7
changeset: 9502:a268f8fd89b7
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 22 00:10:00 2009 -0400
description:
imap-acl: Command parameter reading wasn't done correctly.

diffstat:

1 file changed, 13 insertions(+), 16 deletions(-)
src/plugins/imap-acl/imap-acl-plugin.c |   29 +++++++++++++----------------

diffs (67 lines):

diff -r e22e36a61fdd -r a268f8fd89b7 src/plugins/imap-acl/imap-acl-plugin.c
--- a/src/plugins/imap-acl/imap-acl-plugin.c	Sun Jun 21 23:31:46 2009 -0400
+++ b/src/plugins/imap-acl/imap-acl-plugin.c	Mon Jun 22 00:10:00 2009 -0400
@@ -248,10 +248,8 @@ static bool cmd_getacl(struct client_com
 	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_c
 	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
 	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_com
 	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_
 	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;
 	}


More information about the dovecot-cvs mailing list