]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mdbox: stat() storage directory first before trying to mkdir it.
authorTimo Sirainen <tss@iki.fi>
Tue, 8 Jun 2010 20:00:11 +0000 (21:00 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 8 Jun 2010 20:00:11 +0000 (21:00 +0100)
--HG--
branch : HEAD

src/lib-storage/index/dbox-multi/mdbox-map.c

index b70d55b5c4094ab06c21a64d3982c690fe84846b..69a51f3acc3ac4dd96056f8877fce3ab4ce1026f 100644 (file)
@@ -89,6 +89,11 @@ void mdbox_map_deinit(struct mdbox_map **_map)
 
 static int mdbox_map_mkdir_storage(struct mdbox_map *map)
 {
+       struct stat st;
+
+       if (stat(map->path, &st) == 0)
+               return 0;
+
        if (mailbox_list_mkdir(map->root_list, map->path,
                               MAILBOX_LIST_PATH_TYPE_DIR) < 0) {
                mail_storage_copy_list_error(MAP_STORAGE(map), map->root_list);