dovecot-2.0: lib-storage: If shared namespace uses %% in locatio...

dovecot at dovecot.org dovecot at dovecot.org
Thu Sep 2 17:53:11 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/4d8b54fc4ef5
changeset: 12066:4d8b54fc4ef5
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Sep 02 15:53:08 2010 +0100
description:
lib-storage: If shared namespace uses %% in location, but not in prefix, fail with error.

diffstat:

 src/lib-storage/mail-namespace.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r ff5a47012287 -r 4d8b54fc4ef5 src/lib-storage/mail-namespace.c
--- a/src/lib-storage/mail-namespace.c	Thu Sep 02 15:35:21 2010 +0100
+++ b/src/lib-storage/mail-namespace.c	Thu Sep 02 15:53:08 2010 +0100
@@ -125,8 +125,12 @@
 	ns->mail_set = mail_set;
 	ns->prefix = i_strdup(ns_set->prefix);
 
-	if (ns->type == NAMESPACE_SHARED && strchr(ns->prefix, '%') != NULL) {
-		/* dynamic shared namespace */
+	if (ns->type == NAMESPACE_SHARED &&
+	    (strchr(ns->prefix, '%') != NULL ||
+	     strchr(ns->set->location, '%') != NULL)) {
+		/* dynamic shared namespace. the above check catches wrong
+		   mixed %% usage, but still allows for specifying a shared
+		   namespace to an explicit location without any %% */
 		ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
 		driver = "shared";
 	} else {


More information about the dovecot-cvs mailing list