dovecot-2.2: acl: Log more debug info with mail_debug=yes

dovecot at dovecot.org dovecot at dovecot.org
Sun May 3 14:11:50 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/a0b2217b1eab
changeset: 18508:a0b2217b1eab
user:      Timo Sirainen <tss at iki.fi>
date:      Sun May 03 17:07:02 2015 +0300
description:
acl: Log more debug info with mail_debug=yes

diffstat:

 src/plugins/acl/acl-backend-vfile.c |  3 ++-
 src/plugins/acl/acl-global-file.c   |  9 ++++++++-
 src/plugins/acl/acl-global-file.h   |  3 ++-
 3 files changed, 12 insertions(+), 3 deletions(-)

diffs (61 lines):

diff -r 780a8f4544ec -r a0b2217b1eab src/plugins/acl/acl-backend-vfile.c
--- a/src/plugins/acl/acl-backend-vfile.c	Sun May 03 16:26:46 2015 +0300
+++ b/src/plugins/acl/acl-backend-vfile.c	Sun May 03 17:07:02 2015 +0300
@@ -63,7 +63,8 @@
 			}
 		} else if (!S_ISDIR(st.st_mode)) {
 			_backend->global_file =
-				acl_global_file_init(backend->global_path, backend->cache_secs);
+				acl_global_file_init(backend->global_path, backend->cache_secs,
+						     _backend->debug);
 		}
 	}
 	if (_backend->debug) {
diff -r 780a8f4544ec -r a0b2217b1eab src/plugins/acl/acl-global-file.c
--- a/src/plugins/acl/acl-global-file.c	Sun May 03 16:26:46 2015 +0300
+++ b/src/plugins/acl/acl-global-file.c	Sun May 03 17:07:02 2015 +0300
@@ -30,16 +30,19 @@
 	ARRAY(struct acl_global_rights) rights;
 
 	unsigned int refresh_interval_secs;
+	bool debug;
 };
 
 struct acl_global_file *
-acl_global_file_init(const char *path, unsigned int refresh_interval_secs)
+acl_global_file_init(const char *path, unsigned int refresh_interval_secs,
+		     bool debug)
 {
 	struct acl_global_file *file;
 
 	file = i_new(struct acl_global_file, 1);
 	file->path = i_strdup(path);
 	file->refresh_interval_secs = refresh_interval_secs;
+	file->debug = debug;
 	i_array_init(&file->rights, 32);
 	file->rights_pool = pool_alloconly_create("acl global file rights", 1024);
 	return file;
@@ -198,6 +201,10 @@
 	array_foreach_modifiable(&file->rights, global_rights) {
 		if (!wildcard_match(vname, global_rights->vpattern))
 			continue;
+		if (file->debug) {
+			i_debug("Mailbox '%s' matches global ACL pattern '%s'",
+				vname, global_rights->vpattern);
+		}
 		array_foreach(&global_rights->rights, rights) {
 			new_rights = array_append_space(rights_r);
 			acl_rights_dup(rights, pool, new_rights);
diff -r 780a8f4544ec -r a0b2217b1eab src/plugins/acl/acl-global-file.h
--- a/src/plugins/acl/acl-global-file.h	Sun May 03 16:26:46 2015 +0300
+++ b/src/plugins/acl/acl-global-file.h	Sun May 03 17:07:02 2015 +0300
@@ -4,7 +4,8 @@
 #include "acl-api.h"
 
 struct acl_global_file *
-acl_global_file_init(const char *path, unsigned int refresh_interval_secs);
+acl_global_file_init(const char *path, unsigned int refresh_interval_secs,
+		     bool debug);
 void acl_global_file_deinit(struct acl_global_file **file);
 
 /* Read the global ACLs into memory. */


More information about the dovecot-cvs mailing list