dovecot-1.3: imap-quota: Allow GETQUOTAROOT for public namespaces.

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 17 04:58:28 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.3/rev/8517afb01903
changeset: 9130:8517afb01903
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 16 21:58:20 2009 -0400
description:
imap-quota: Allow GETQUOTAROOT for public namespaces.

diffstat:

1 file changed, 4 insertions(+), 3 deletions(-)
src/plugins/imap-quota/imap-quota-plugin.c |    7 ++++---

diffs (28 lines):

diff -r f9c07af22f91 -r 8517afb01903 src/plugins/imap-quota/imap-quota-plugin.c
--- a/src/plugins/imap-quota/imap-quota-plugin.c	Thu Apr 16 21:56:54 2009 -0400
+++ b/src/plugins/imap-quota/imap-quota-plugin.c	Thu Apr 16 21:58:20 2009 -0400
@@ -23,7 +23,7 @@ imap_quota_root_get_name(struct mail_use
 	const char *name;
 
 	name = quota_root_get_name(root);
-	if (user == owner)
+	if (user == owner || owner == NULL)
 		return name;
 	return t_strdup_printf("%s%c%s", owner->username,
 			       QUOTA_USER_SEPARATOR, name);
@@ -94,12 +94,13 @@ static bool cmd_getquotaroot(struct clie
 	}
 
 	ns = mail_storage_get_namespace(storage);
-	if (quser == NULL || ns->owner == NULL) {
+	if (quser == NULL) {
 		mailbox_close(&box);
 		client_send_tagline(cmd, "OK No quota.");
 		return TRUE;
 	}
-	if (ns->owner != client->user && !client->user->admin) {
+	if (ns->owner != NULL && ns->owner != client->user &&
+	    !client->user->admin) {
 		mailbox_close(&box);
 		client_send_tagline(cmd, "NO Not showing other users' quota.");
 		return TRUE;


More information about the dovecot-cvs mailing list