Mercurial > dovecot > core-2.2
changeset 10936:6b03aee63752 HEAD
acl: Don't crash if opening dovecot-acl fails with EACCES.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 16 Mar 2010 21:39:47 +0200 |
parents | 1de4b554c914 |
children | b7c66370b0f7 |
files | src/plugins/acl/acl-backend-vfile.c |
diffstat | 1 files changed, 11 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/acl/acl-backend-vfile.c Tue Mar 16 21:04:59 2010 +0200 +++ b/src/plugins/acl/acl-backend-vfile.c Tue Mar 16 21:39:47 2010 +0200 @@ -456,14 +456,19 @@ return 0; } -static void acl_backend_remove_all_access(struct acl_object *aclobj) +static void acl_backend_remove_all_access(struct acl_object_vfile *aclobj) { - struct acl_rights_update rights; + static const char *null = NULL; + struct acl_rights rights; memset(&rights, 0, sizeof(rights)); - rights.rights.id_type = ACL_ID_ANYONE; - rights.modify_mode = ACL_MODIFY_MODE_REPLACE; - acl_cache_update(aclobj->backend->cache, aclobj->name, &rights); + rights.id_type = ACL_ID_ANYONE; + rights.rights = &null; + array_append(&aclobj->rights, &rights, 1); + + rights.id_type = ACL_ID_OWNER; + rights.rights = &null; + array_append(&aclobj->rights, &rights, 1); } static int @@ -491,7 +496,7 @@ i_debug("acl vfile: no access to file %s", path); - acl_backend_remove_all_access(&aclobj->aclobj); + acl_backend_remove_all_access(aclobj); validity->last_mtime = VALIDITY_MTIME_NOACCESS; } else { i_error("open(%s) failed: %m", path);