From bb82aeaf07bc9d576db3b37c90684d97d73f420f Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 25 Jul 2017 09:35:31 +0300 Subject: [PATCH] lib-storage: If root dir already exists as file, log better error message. --- src/lib-storage/mailbox-list.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib-storage/mailbox-list.c b/src/lib-storage/mailbox-list.c index c4607501f2..6340bcd2e8 100644 --- a/src/lib-storage/mailbox-list.c +++ b/src/lib-storage/mailbox-list.c @@ -1221,6 +1221,11 @@ int mailbox_list_try_mkdir_root(struct mailbox_list *list, const char *path, if (stat(path, &st) == 0) { /* looks like it already exists, don't bother checking further. */ + if (!S_ISDIR(st.st_mode)) { + *error_r = t_strdup_printf( + "Root directory is a file: %s", path); + return -1; + } return 0; } -- 2.47.3