changeset 4097:8d37f7d2ec40 HEAD

Global ACL dir is now optional.
author Timo Sirainen <tss@iki.fi>
date Mon, 06 Mar 2006 23:20:08 +0200
parents 904c53275e83
children 59883de6c516
files src/plugins/acl/acl-backend-vfile.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/acl/acl-backend-vfile.c	Mon Mar 06 22:34:42 2006 +0200
+++ b/src/plugins/acl/acl-backend-vfile.c	Mon Mar 06 23:20:08 2006 +0200
@@ -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) {