# HG changeset patch # User Timo Sirainen # Date 1247021521 14400 # Node ID 5d1a52e8d3203b6ba6142b6a7a4be6c5f9151b2f # Parent bf4f542ec6dfc00612b06a3b114b9d39ddc8e739 acl: dovecot-acl file caching fixes. diff -r bf4f542ec6df -r 5d1a52e8d320 src/plugins/acl/acl-backend-vfile.c --- a/src/plugins/acl/acl-backend-vfile.c Tue Jul 07 22:37:42 2009 -0400 +++ b/src/plugins/acl/acl-backend-vfile.c Tue Jul 07 22:52:01 2009 -0400 @@ -583,6 +583,7 @@ struct acl_backend_vfile *backend = (struct acl_backend_vfile *)aclobj->backend; struct stat st; + int ret; if (validity == NULL) return 1; @@ -591,7 +592,14 @@ return 0; validity->last_check = ioloop_time; - if (stat(path, &st) < 0) { + ret = stat(path, &st); + if (ret == 0 && S_ISDIR(st.st_mode)) { + /* it's a directory. use dir/.DEFAULT instead */ + path = t_strconcat(path, "/.DEFAULT", NULL); + ret = stat(path, &st); + } + + if (ret < 0) { if (errno == ENOENT || errno == ENOTDIR) { /* if the file used to exist, we have to re-read it */ return validity->last_mtime != VALIDITY_MTIME_NOTFOUND;