From: Timo Sirainen Date: Fri, 3 Apr 2009 16:34:45 +0000 (-0400) Subject: If shared_storage_get_namespace() fails due to ns prefix pattern mismatch, log an... X-Git-Tag: 1.2.rc1~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=35083063d0e432d0cf78206b5929750e613ad772;p=thirdparty%2Fdovecot%2Fcore.git If shared_storage_get_namespace() fails due to ns prefix pattern mismatch, log an error. Although should this ever happen? Maybe they should be asserts.. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/shared/shared-storage.c b/src/lib-storage/index/shared/shared-storage.c index a573aa0d39..943e21d408 100644 --- a/src/lib-storage/index/shared/shared-storage.c +++ b/src/lib-storage/index/shared/shared-storage.c @@ -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;