dovecot-2.2: acl: Delay initializing default backend ACLs.

dovecot at dovecot.org dovecot at dovecot.org
Mon Mar 11 14:44:58 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/20955c64bde3
changeset: 16017:20955c64bde3
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Mar 11 14:44:48 2013 +0200
description:
acl: Delay initializing default backend ACLs.
This fixes a crash with LAYOUT=index.

diffstat:

 src/plugins/acl/acl-backend.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 30baa62d8e72 -r 20955c64bde3 src/plugins/acl/acl-backend.c
--- a/src/plugins/acl/acl-backend.c	Sun Mar 10 20:52:10 2013 +0200
+++ b/src/plugins/acl/acl-backend.c	Mon Mar 11 14:44:48 2013 +0200
@@ -82,8 +82,6 @@
 	backend->default_aclmask =
 		acl_cache_mask_init(backend->cache, backend->pool,
 				    backend->default_rights);
-
-	backend->default_aclobj = acl_object_init_from_name(backend, "");
 	return backend;
 }
 
@@ -93,7 +91,8 @@
 
 	*_backend = NULL;
 
-	acl_object_deinit(&backend->default_aclobj);
+	if (backend->default_aclobj != NULL)
+		acl_object_deinit(&backend->default_aclobj);
 	acl_cache_deinit(&backend->cache);
 	backend->v.deinit(backend);
 }
@@ -161,6 +160,10 @@
 int acl_backend_get_default_rights(struct acl_backend *backend,
 				   const struct acl_mask **mask_r)
 {
+	if (backend->default_aclobj == NULL) {
+		backend->default_aclobj =
+			acl_object_init_from_name(backend, "");
+	}
 	if (backend->v.object_refresh_cache(backend->default_aclobj) < 0)
 		return -1;
 


More information about the dovecot-cvs mailing list