]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
acl: Handle empty rights (no rights) properly.
authorTimo Sirainen <tss@iki.fi>
Mon, 22 Jun 2009 04:28:33 +0000 (00:28 -0400)
committerTimo Sirainen <tss@iki.fi>
Mon, 22 Jun 2009 04:28:33 +0000 (00:28 -0400)
--HG--
branch : HEAD

src/plugins/acl/acl-backend-vfile.c

index 542de61f5e2131ac6c3f2048044e225f1e6dec9d..696ea26f60203cf03511cbc571d89b2889a88216 100644 (file)
@@ -887,12 +887,9 @@ static bool modify_right_list(pool_t pool,
                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;
                }
@@ -928,6 +925,9 @@ static bool modify_right_list(pool_t pool,
        }
        *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)