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

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


details:   http://hg.dovecot.org/dovecot-1.2/rev/c7402e49132a
changeset: 9150:c7402e49132a
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 283f52768314 -r c7402e49132a src/plugins/imap-acl/imap-acl-plugin.c
--- a/src/plugins/imap-acl/imap-acl-plugin.c	Sun Jun 21 23:44:18 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)
@@ -285,10 +283,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;
 
 	real_mailbox = mailbox;
 	storage = client_find_storage(cmd, &real_mailbox);
@@ -337,10 +333,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)
@@ -493,8 +487,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;
 	}
@@ -585,8 +581,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