Commit 8282a0f6 8282a0f66a27de33971a2b5c42470548090bf4dc by Sergey Poznyakoff

imap4d: forbid to treat namespace root as a mailbox

* imap4d/namespace.c (namespace_get_name): Return NULL if name
is the same as the returned prefix
1 parent aa0a6207
......@@ -352,6 +352,11 @@ namespace_get_name (char const *name, mu_record_t *rec, int *mode)
{
struct namespace_prefix const *pfx;
char *path = namespace_translate_name (name, &pfx);
if (strcmp (name, pfx->prefix) == 0)
{
free (path);
return NULL;
}
if (rec)
*rec = pfx->record;
if (mode)
......