dovecot-1.2: 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/ef644130d6c2
changeset: 9152:ef644130d6c2
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 22 00:28:33 2009 -0400
description:
acl: Handle empty rights (no rights) properly.

diffstat:

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

diffs (27 lines):

diff -r 31fe9a8740c3 -r ef644130d6c2 src/plugins/acl/acl-backend-vfile.c
--- a/src/plugins/acl/acl-backend-vfile.c	Mon Jun 22 00:11:43 2009 -0400
+++ b/src/plugins/acl/acl-backend-vfile.c	Mon Jun 22 00:28:33 2009 -0400
@@ -881,12 +881,9 @@ static bool modify_right_list(pool_t poo
 		return FALSE;
 	}
 
-	if (old_rights == NULL)
-		old_rights = &null;
-
 	switch (modify_mode) {
 	case ACL_MODIFY_MODE_REMOVE:
-		if (*old_rights == NULL) {
+		if (old_rights == NULL || *old_rights == NULL) {
 			/* nothing to do */
 			return FALSE;
 		}
@@ -922,6 +919,9 @@ static bool modify_right_list(pool_t poo
 	}
 	*rightsp = new_rights;
 
+	if (old_rights == NULL)
+		return new_rights != NULL;
+
 	/* see if anything changed */
 	for (i = 0; old_rights[i] != NULL && new_rights[i] != NULL; i++) {
 		if (strcmp(old_rights[i], new_rights[i]) != 0)


More information about the dovecot-cvs mailing list