changeset 14638:ec5c630012cd

lib-storage: Avoid creating shared user for an empty username.
author Timo Sirainen <tss@iki.fi>
date Tue, 31 Jul 2012 18:33:45 +0300
parents c598f76eeeed
children fac6b994e869
files src/lib-storage/index/shared/shared-list.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/shared/shared-list.c	Sat Jul 28 20:31:30 2012 +0300
+++ b/src/lib-storage/index/shared/shared-list.c	Tue Jul 31 18:33:45 2012 +0300
@@ -135,7 +135,8 @@
 	else
 		ns_ref = NULL;
 
-	if (ns_ref != NULL && shared_storage_get_namespace(&ns, &ns_ref) == 0)
+	if (ns_ref != NULL && *ns_ref != '\0' &&
+	    shared_storage_get_namespace(&ns, &ns_ref) == 0)
 		return mailbox_list_join_refpattern(ns->list, ref, pattern);
 
 	/* fallback to default behavior */