summaryrefslogtreecommitdiff
path: root/imap4d
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-01-24 16:36:23 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2017-01-24 16:38:15 +0200
commit8282a0f66a27de33971a2b5c42470548090bf4dc (patch)
tree4630cbf4fb83d3fad1608ddfdaa57d13618e955e /imap4d
parentaa0a6207b162bf8a8f6ba959f2a9ebae598d78a4 (diff)
downloadmailutils-8282a0f66a27de33971a2b5c42470548090bf4dc.tar.gz
mailutils-8282a0f66a27de33971a2b5c42470548090bf4dc.tar.bz2
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
Diffstat (limited to 'imap4d')
-rw-r--r--imap4d/namespace.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/imap4d/namespace.c b/imap4d/namespace.c
index b280536f9..8f1e93204 100644
--- a/imap4d/namespace.c
+++ b/imap4d/namespace.c
@@ -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)

Return to:

Send suggestions and report system problems to the System administrator.