Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8466:4553e28eb4f5 HEAD
acl: Update acl_dict correctly also for other visible users' shared namespaces.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 21 Nov 2008 17:41:59 +0200 |
parents | 027a61241ebb |
children | 03c418eadc8b |
files | src/plugins/acl/acl-lookup-dict.c |
diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/acl/acl-lookup-dict.c Fri Nov 21 17:41:30 2008 +0200 +++ b/src/plugins/acl/acl-lookup-dict.c Fri Nov 21 17:41:59 2008 +0200 @@ -112,7 +112,7 @@ string_t *id; int ret, ret2 = 0; - if ((ns->flags & NAMESPACE_FLAG_INTERNAL) != 0) + if ((ns->flags & NAMESPACE_FLAG_INTERNAL) != 0 || ns->owner == NULL) return 0; id = t_str_new(128); @@ -126,6 +126,8 @@ if (acl_rights_has_nonowner_lookup_changes(&rights)) { str_truncate(id, 0); acl_lookup_dict_write_rights_id(id, &rights); + str_append_c(id, '/'); + str_append(id, ns->owner); id_dup = t_strdup(str_c(id)); array_append(ids, &id_dup, 1); } @@ -154,7 +156,11 @@ unsigned int prefix_len; int ret; - /* get all existing identifiers for the user */ + /* get all existing identifiers for the user. we might be able to + sync identifiers also for other users whose shared namespaces we + have, but it's possible that the other users have other namespaces + that aren't visible to us, so we don't want to remove anything + that could break them. */ t_array_init(&old_ids_arr, 128); prefix = DICT_PATH_SHARED DICT_SHARED_BOXES_PATH; prefix_len = strlen(prefix); @@ -194,8 +200,6 @@ /* new identifier, add it */ str_truncate(path, prefix_len); str_append(path, new_ids[newi]); - str_append_c(path, '/'); - str_append(path, username); dict_set(dt, str_c(path), "1"); newi++; } else if (!no_removes) {