dovecot-1.2: imap-acl: Fixed handling SETACL with empty rights.
dovecot at dovecot.org
dovecot at dovecot.org
Fri Feb 20 22:35:50 EET 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/ee02ea08ce30
changeset: 8752:ee02ea08ce30
user: Timo Sirainen <tss at iki.fi>
date: Fri Feb 20 15:35:43 2009 -0500
description:
imap-acl: Fixed handling SETACL with empty rights.
Patch by Bernhard Herzog.
diffstat:
1 file changed, 14 insertions(+), 2 deletions(-)
src/plugins/imap-acl/imap-acl-plugin.c | 16 ++++++++++++++--
diffs (33 lines):
diff -r 98e46e8153e4 -r ee02ea08ce30 src/plugins/imap-acl/imap-acl-plugin.c
--- a/src/plugins/imap-acl/imap-acl-plugin.c Fri Feb 20 15:27:03 2009 -0500
+++ b/src/plugins/imap-acl/imap-acl-plugin.c Fri Feb 20 15:35:43 2009 -0500
@@ -375,7 +375,7 @@ static bool cmd_setacl(struct client_com
bool negative = FALSE;
if (!client_read_string_args(cmd, 3, &mailbox, &identifier, &rights) ||
- *identifier == '\0' || *rights == '\0') {
+ *identifier == '\0') {
client_send_command_error(cmd, "Invalid arguments.");
return TRUE;
}
@@ -414,7 +414,19 @@ static bool cmd_setacl(struct client_com
if (box == NULL)
return TRUE;
- if (negative) {
+ if (update.rights.rights[0] == NULL) {
+ if (negative) {
+ update.modify_mode = 0;
+ update.rights.rights = NULL;
+ update.neg_modify_mode = ACL_MODIFY_MODE_CLEAR;
+ update.rights.neg_rights = NULL;
+ } else {
+ update.modify_mode = ACL_MODIFY_MODE_CLEAR;
+ update.rights.rights = NULL;
+ update.neg_modify_mode = 0;
+ update.rights.neg_rights = NULL;
+ }
+ } else if (negative) {
update.neg_modify_mode = update.modify_mode;
update.modify_mode = ACL_MODIFY_MODE_REMOVE;
update.rights.neg_rights = update.rights.rights;
More information about the dovecot-cvs
mailing list