]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Return empty value in imapc_list_get_storage_name on auth error
authorAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 5 Apr 2017 10:27:57 +0000 (13:27 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 6 Apr 2017 17:22:41 +0000 (20:22 +0300)
Avoids clobbering authentication error.

src/lib-storage/index/imapc/imapc-list.c

index 302c8328f34ae94c56d5c6bf40407e32b326e6a9..0e00160991506442dee4a68e501c7126876225af 100644 (file)
@@ -347,6 +347,11 @@ imapc_list_get_storage_name(struct mailbox_list *_list, const char *vname)
        const char *prefix = list->set->imapc_list_prefix;
        const char *storage_name;
 
+       /* check if authentication has failed, if it has, short circuit here
+          to avoid the error being clobbered by mailbox_list_get_hierarchy_sep */
+       if (list->client->auth_failed)
+               return "";
+
        storage_name = mailbox_list_default_get_storage_name(_list, vname);
        if (*prefix != '\0' && strcasecmp(storage_name, "INBOX") != 0) {
                storage_name = storage_name[0] == '\0' ? prefix :