[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c, 1.145.2.4, 1.145.2.5

tss at dovecot.org tss at dovecot.org
Sun Dec 3 13:29:58 UTC 2006


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

Modified Files:
      Tag: branch_1_0
	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.145.2.4
retrieving revision 1.145.2.5
diff -u -d -r1.145.2.4 -r1.145.2.5
--- mbox-storage.c	17 Oct 2006 11:03:08 -0000	1.145.2.4
+++ mbox-storage.c	3 Dec 2006 13:29:56 -0000	1.145.2.5
@@ -305,6 +305,9 @@
 	}
 
 	if (root_dir == NULL) {
+		if ((flags & MAIL_STORAGE_FLAG_NO_AUTOCREATE) != 0)
+			return NULL;
+
 		root_dir = create_root_dir(debug);
 		if (root_dir == NULL)
 			return NULL;
@@ -321,6 +324,8 @@
 		} else if (errno != ENOENT && errno != ENOTDIR) {
 			i_error("lstat(%s) failed: %m", root_dir);
 			return NULL;
+		} else if ((flags & MAIL_STORAGE_FLAG_NO_AUTOCREATE) != 0) {
+			return NULL;
 		} else if (mkdir_parents(root_dir, CREATE_MODE) < 0 &&
 			   errno != EEXIST) {
 			i_error("mkdir_parents(%s) failed: %m", root_dir);



More information about the dovecot-cvs mailing list