]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
shared mailboxes: Don't crash if trying to open "shared/domain" namespace prefix...
authorTimo Sirainen <tss@iki.fi>
Fri, 1 May 2009 21:07:38 +0000 (17:07 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 1 May 2009 21:07:38 +0000 (17:07 -0400)
--HG--
branch : HEAD

src/lib-storage/index/shared/shared-storage.c

index e4d7f1e60797798cb6d8071f8e733a837a45830c..8764a39259c027ef57e14c1c7b25072c9ecb9145 100644 (file)
@@ -193,7 +193,13 @@ int shared_storage_get_namespace(struct mail_storage *_storage,
 
        /* successfully matched the name. */
        if (userdomain == NULL) {
-               i_assert(username != NULL);
+               if (username == NULL) {
+                       /* trying to open namespace "shared/domain"
+                          namespace prefix. */
+                       mail_storage_set_error(_storage, MAIL_ERROR_NOTFOUND,
+                               T_MAIL_ERR_MAILBOX_NOT_FOUND(*_name));
+                       return -1;
+               }
                userdomain = domain == NULL ? username :
                        t_strconcat(username, "@", domain, NULL);
        } else {