From: Timo Sirainen Date: Fri, 17 Apr 2009 01:58:20 +0000 (-0400) Subject: imap-quota: Allow GETQUOTAROOT for public namespaces. X-Git-Tag: 2.0.alpha1~922 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef2b2ef2e6a6eb5e4667f2e63faae8a3b646e8ba;p=thirdparty%2Fdovecot%2Fcore.git imap-quota: Allow GETQUOTAROOT for public namespaces. --HG-- branch : HEAD --- diff --git a/src/plugins/imap-quota/imap-quota-plugin.c b/src/plugins/imap-quota/imap-quota-plugin.c index 5cd5769194..c5e1c280f2 100644 --- a/src/plugins/imap-quota/imap-quota-plugin.c +++ b/src/plugins/imap-quota/imap-quota-plugin.c @@ -23,7 +23,7 @@ imap_quota_root_get_name(struct mail_user *user, struct mail_user *owner, 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 client_command_context *cmd) } 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;