]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: If root dir already exists as file, log better error message.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 25 Jul 2017 06:35:31 +0000 (09:35 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Tue, 25 Jul 2017 08:06:11 +0000 (11:06 +0300)
src/lib-storage/mailbox-list.c

index 482e651fa0de8ff82968711e62b509da5767299d..8dc2b578fe63254f5cdf766f1ae3a401bf454f92 100644 (file)
@@ -1213,6 +1213,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;
        }