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

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 17 04:56:27 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/33f3016673aa
changeset: 8959:33f3016673aa
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 16 21:56: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 16c286aee307 -r 33f3016673aa src/plugins/imap-quota/imap-quota-plugin.c
--- a/src/plugins/imap-quota/imap-quota-plugin.c	Thu Apr 16 21:31:30 2009 -0400
+++ b/src/plugins/imap-quota/imap-quota-plugin.c	Thu Apr 16 21:56:20 2009 -0400
@@ -22,7 +22,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);
@@ -92,12 +92,13 @@ static bool cmd_getquotaroot(struct clie
 	}
 
 	ns = mail_storage_get_namespace(storage);
-	if (quota_set == NULL || ns->owner == NULL) {
+	if (quota_set == 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