[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c, 1.156, 1.157

tss at dovecot.org tss at dovecot.org
Sun Dec 3 13:30:06 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv24180/index/mbox

Modified Files:
	mbox-storage.c 
Log Message:
Added MAIL_STORAGE_FLAG_NO_AUTOCREATE flag which silently fails storage
creation if the root directory doesn't exist. Otherwise the root dir is
created.



Index: mbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -d -r1.156 -r1.157
--- mbox-storage.c	1 Dec 2006 20:55:05 -0000	1.156
+++ mbox-storage.c	3 Dec 2006 13:30:03 -0000	1.157
@@ -310,6 +310,9 @@
 	}
 
 	if (list_set->root_dir == NULL) {
+		if ((flags & MAIL_STORAGE_FLAG_NO_AUTOCREATE) != 0)
+			return -1;
+
 		list_set->root_dir = create_root_dir(debug);
 		if (list_set->root_dir == NULL)
 			return -1;
@@ -329,6 +332,8 @@
 		} else if (errno != ENOENT && errno != ENOTDIR) {
 			i_error("lstat(%s) failed: %m", list_set->root_dir);
 			return -1;
+		} else if ((flags & MAIL_STORAGE_FLAG_NO_AUTOCREATE) != 0) {
+			return -1;
 		} else if (mkdir_parents(list_set->root_dir, CREATE_MODE) < 0 &&
 			   errno != EEXIST) {
 			i_error("mkdir_parents(%s) failed: %m",



More information about the dovecot-cvs mailing list