dovecot-1.2: imap-acl: Handle empty rights (no rights) properly.
dovecot at dovecot.org
dovecot at dovecot.org
Mon Jun 22 07:29:44 EEST 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/f2426d980426
changeset: 9153:f2426d980426
user: Timo Sirainen <tss at iki.fi>
date: Mon Jun 22 00:29:13 2009 -0400
description:
imap-acl: Handle empty rights (no rights) properly.
diffstat:
1 file changed, 4 insertions(+), 14 deletions(-)
src/plugins/imap-acl/imap-acl-plugin.c | 18 ++++--------------
diffs (42 lines):
diff -r ef644130d6c2 -r f2426d980426 src/plugins/imap-acl/imap-acl-plugin.c
--- a/src/plugins/imap-acl/imap-acl-plugin.c Mon Jun 22 00:28:33 2009 -0400
+++ b/src/plugins/imap-acl/imap-acl-plugin.c Mon Jun 22 00:29:13 2009 -0400
@@ -102,7 +102,7 @@ imap_acl_write_rights_list(string_t *des
imap_acl_write_rights_list(string_t *dest, const char *const *rights)
{
const struct imap_acl_letter_map *map;
- unsigned int i;
+ unsigned int i, orig_len = str_len(dest);
bool append_c = FALSE, append_d = FALSE;
for (i = 0; rights[i] != NULL; i++) {
@@ -120,6 +120,8 @@ imap_acl_write_rights_list(string_t *des
str_append_c(dest, 'c');
if (append_d)
str_append_c(dest, 'd');
+ if (orig_len == str_len(dest))
+ str_append(dest, "\"\"");
}
static void
@@ -539,19 +541,7 @@ static bool cmd_setacl(struct client_com
return TRUE;
}
- if (r->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) {
+ 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