]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
If shared_storage_get_namespace() fails due to ns prefix pattern mismatch, log an...
authorTimo Sirainen <tss@iki.fi>
Fri, 3 Apr 2009 16:34:45 +0000 (12:34 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 3 Apr 2009 16:34:45 +0000 (12:34 -0400)
Although should this ever happen? Maybe they should be asserts..

--HG--
branch : HEAD

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

index a573aa0d391435f74a9346d665d6c454cd33b12e..943e21d4088d59f60d2860bb309574df046dd811 100644 (file)
@@ -145,8 +145,12 @@ int shared_storage_get_namespace(struct mail_storage *_storage,
        p = storage->ns_prefix_pattern;
        for (name = *_name; *p != '\0';) {
                if (*p != '%') {
-                       if (*p != *name)
+                       if (*p != *name) {
+                               mail_storage_set_critical(_storage,
+                                       "Invalid namespace prefix %s vs %s",
+                                       storage->ns_prefix_pattern, *_name);
                                return -1;
+                       }
                        p++; name++;
                        continue;
                }
@@ -167,8 +171,12 @@ int shared_storage_get_namespace(struct mail_storage *_storage,
                p++;
 
                next = strchr(name, *p != '\0' ? *p : _storage->ns->sep);
-               if (next == NULL)
+               if (next == NULL) {
+                       mail_storage_set_critical(_storage,
+                               "Invalid namespace prefix %s vs %s",
+                               storage->ns_prefix_pattern, *_name);
                        return -1;
+               }
 
                *dest = t_strdup_until(name, next);
                name = next;