dovecot-2.0-sslstream: acl: Merge group rights if user belongs t...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:56:20 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/b55069127635
changeset: 10307:b55069127635
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 10 19:13:36 2009 -0500
description:
acl: Merge group rights if user belongs to more than one.

diffstat:

1 file changed, 6 insertions(+), 2 deletions(-)
src/plugins/acl/acl-backend-vfile.c |    8 ++++++--

diffs (27 lines):

diff -r 9cf3caefec2c -r b55069127635 src/plugins/acl/acl-backend-vfile.c
--- a/src/plugins/acl/acl-backend-vfile.c	Tue Nov 10 18:57:14 2009 -0500
+++ b/src/plugins/acl/acl-backend-vfile.c	Tue Nov 10 19:13:36 2009 -0500
@@ -763,6 +763,7 @@ static void acl_backend_vfile_cache_rebu
 	struct mail_namespace *ns;
 	struct acl_object *_aclobj = &aclobj->aclobj;
 	struct acl_rights_update ru, ru2;
+	enum acl_modify_mode add_mode;
 	const struct acl_rights *rights;
 	unsigned int i, count;
 	bool owner_applied, first_global = TRUE;
@@ -795,10 +796,13 @@ static void acl_backend_vfile_cache_rebu
 		/* If [neg_]rights is NULL it needs to be ignored.
 		   The easiest way to do that is to just mark it with
 		   REMOVE mode */
+		add_mode = i > 0 && rights[i-1].id_type == rights[i].id_type &&
+			rights[i-1].global == rights[i].global ?
+			ACL_MODIFY_MODE_ADD : ACL_MODIFY_MODE_REPLACE;
 		ru.modify_mode = rights[i].rights == NULL ?
-			ACL_MODIFY_MODE_REMOVE : ACL_MODIFY_MODE_REPLACE;
+			ACL_MODIFY_MODE_REMOVE : add_mode;
 		ru.neg_modify_mode = rights[i].neg_rights == NULL ?
-			ACL_MODIFY_MODE_REMOVE : ACL_MODIFY_MODE_REPLACE;
+			ACL_MODIFY_MODE_REMOVE : add_mode;
 		ru.rights = rights[i];
 		if (rights[i].global && first_global) {
 			/* first global: reset negative ACLs so local ACLs


More information about the dovecot-cvs mailing list