dovecot-2.2: lib-storage: Handle better when attempting to acces...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jan 5 01:14:34 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/7bca3be44b8f
changeset: 15532:7bca3be44b8f
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 27 10:49:41 2012 +0200
description:
lib-storage: Handle better when attempting to access shared mailboxes for nonexistent users.

diffstat:

 src/lib-storage/index/shared/shared-storage.c |  18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diffs (29 lines):

diff -r fe1be6725304 -r 7bca3be44b8f src/lib-storage/index/shared/shared-storage.c
--- a/src/lib-storage/index/shared/shared-storage.c	Tue Nov 27 10:49:18 2012 +0200
+++ b/src/lib-storage/index/shared/shared-storage.c	Tue Nov 27 10:49:41 2012 +0200
@@ -257,15 +257,17 @@
 				user->unexpanded_set);
 	owner->autocreated = TRUE;
 	if (mail_user_init(owner, &error) < 0) {
-		mailbox_list_set_critical(list,
-			"Couldn't create namespace '%s' for user %s: %s",
-			ns->prefix, userdomain, error);
-		mail_user_unref(&owner);
-		return -1;
-	}
-	if (!var_has_key(storage->location, 'h', "home"))
+		if (!owner->nonexistent) {
+			mailbox_list_set_critical(list,
+				"Couldn't create namespace '%s' for user %s: %s",
+				ns->prefix, userdomain, error);
+			mail_user_unref(&owner);
+			return -1;
+		}
+		ret = 0;
+	} else if (!var_has_key(storage->location, 'h', "home")) {
 		ret = 1;
-	else {
+	} else {
 		/* we'll need to look up the user's home directory */
 		if ((ret = mail_user_get_home(owner, &tab[3].value)) < 0) {
 			mailbox_list_set_critical(list, "Namespace '%s': "


More information about the dovecot-cvs mailing list