From: Timo Sirainen Date: Mon, 22 Jun 2009 04:28:33 +0000 (-0400) Subject: acl: Handle empty rights (no rights) properly. X-Git-Tag: 2.0.alpha1~548 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65ee37fdc16508f58d99e4c13d4bd9f96c403a6e;p=thirdparty%2Fdovecot%2Fcore.git acl: Handle empty rights (no rights) properly. --HG-- branch : HEAD --- diff --git a/src/plugins/acl/acl-backend-vfile.c b/src/plugins/acl/acl-backend-vfile.c index 542de61f5e..696ea26f60 100644 --- a/src/plugins/acl/acl-backend-vfile.c +++ b/src/plugins/acl/acl-backend-vfile.c @@ -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)