dovecot-2.0: acl: dovecot-acl file caching fixes.
dovecot at dovecot.org
dovecot at dovecot.org
Wed Jul 8 05:52:14 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/b64aa73a34dc
changeset: 9585:b64aa73a34dc
user: Timo Sirainen <tss at iki.fi>
date: Tue Jul 07 22:52:01 2009 -0400
description:
acl: dovecot-acl file caching fixes.
diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
src/plugins/acl/acl-backend-vfile.c | 10 +++++++++-
diffs (27 lines):
diff -r fd83d1f43ce5 -r b64aa73a34dc 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
@@ -584,6 +584,7 @@ acl_backend_vfile_refresh(struct acl_obj
struct acl_backend_vfile *backend =
(struct acl_backend_vfile *)aclobj->backend;
struct stat st;
+ int ret;
if (validity == NULL)
return 1;
@@ -592,7 +593,14 @@ acl_backend_vfile_refresh(struct acl_obj
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;
More information about the dovecot-cvs
mailing list