dovecot-2.0: mdbox: stat() storage directory first before trying...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 8 23:00:14 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/1aaa4b51cb14
changeset: 11502:1aaa4b51cb14
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 08 21:00:11 2010 +0100
description:
mdbox: stat() storage directory first before trying to mkdir it.

diffstat:

 src/lib-storage/index/dbox-multi/mdbox-map.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r 149d57c1a9c0 -r 1aaa4b51cb14 src/lib-storage/index/dbox-multi/mdbox-map.c
--- a/src/lib-storage/index/dbox-multi/mdbox-map.c	Tue Jun 08 20:52:24 2010 +0100
+++ b/src/lib-storage/index/dbox-multi/mdbox-map.c	Tue Jun 08 21:00:11 2010 +0100
@@ -89,6 +89,11 @@
 
 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);


More information about the dovecot-cvs mailing list