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
Showing
1 changed file
with
5 additions
and
0 deletions
... | @@ -352,6 +352,11 @@ namespace_get_name (char const *name, mu_record_t *rec, int *mode) | ... | @@ -352,6 +352,11 @@ namespace_get_name (char const *name, mu_record_t *rec, int *mode) |
352 | { | 352 | { |
353 | struct namespace_prefix const *pfx; | 353 | struct namespace_prefix const *pfx; |
354 | char *path = namespace_translate_name (name, &pfx); | 354 | char *path = namespace_translate_name (name, &pfx); |
355 | if (strcmp (name, pfx->prefix) == 0) | ||
356 | { | ||
357 | free (path); | ||
358 | return NULL; | ||
359 | } | ||
355 | if (rec) | 360 | if (rec) |
356 | *rec = pfx->record; | 361 | *rec = pfx->record; |
357 | if (mode) | 362 | if (mode) | ... | ... |
-
Please register or sign in to post a comment