[dovecot-cvs] dovecot/src/plugins/acl acl-backend-vfile.c,1.2,1.3

cras at dovecot.org cras at dovecot.org
Mon Mar 6 23:20:11 EET 2006


Update of /var/lib/cvs/dovecot/src/plugins/acl
In directory talvi:/tmp/cvs-serv16482/src/plugins/acl

Modified Files:
	acl-backend-vfile.c 
Log Message:
Global ACL dir is now optional.



Index: acl-backend-vfile.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/acl/acl-backend-vfile.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- acl-backend-vfile.c	28 Feb 2006 12:38:20 -0000	1.2
+++ acl-backend-vfile.c	6 Mar 2006 21:20:08 -0000	1.3
@@ -89,7 +89,7 @@
 	aclobj = i_new(struct acl_object_vfile, 1);
 	aclobj->aclobj.backend = _backend;
 	aclobj->aclobj.name = i_strdup(name);
-	aclobj->global_path =
+	aclobj->global_path = *backend->global_dir == '\0' ? NULL :
 		i_strconcat(backend->global_dir, "/", name, NULL);
 	aclobj->local_path =
 		i_strconcat(control_dir, "/"ACL_FILENAME, NULL);
@@ -292,6 +292,9 @@
 	unsigned int i;
 	int ret;
 
+	if (path == NULL)
+		return 0;
+
 	for (i = 0;; i++) {
 		ret = acl_backend_vfile_read(aclobj, path, validity,
 					     i < ACL_ESTALE_RETRY_COUNT);
@@ -312,6 +315,8 @@
 
 	if (validity == NULL)
 		return 1;
+	if (path == NULL)
+		return 0;
 
 	if (stat(path, &st) < 0) {
 		if (errno == ENOENT) {



More information about the dovecot-cvs mailing list