[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c,1.24,1.25

cras at procontrol.fi cras at procontrol.fi
Sat Dec 21 14:14:01 EET 2002


Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory danu:/tmp/cvs-serv29177/src/lib-storage/index/mbox

Modified Files:
	mbox-storage.c 
Log Message:
If used base/login directories exist already, make sure they're with correct
permissions. Always delete contents in login directory at startup.

Added safe_mkdir(). changed unlink_directory() behaviour, and fixed a race
condition which could have made it follow symlinks to other directories and
delete them. Didn't really harm us so far, we never used it for deleting
unsafe directories.



Index: mbox-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- mbox-storage.c	20 Dec 2002 07:53:52 -0000	1.24
+++ mbox-storage.c	21 Dec 2002 12:13:58 -0000	1.25
@@ -362,7 +362,7 @@
 
 	/* next delete the index directory */
 	index_dir = mbox_get_index_dir(storage, name);
-	if (!unlink_directory(index_dir) && errno != ENOENT) {
+	if (unlink_directory(index_dir, TRUE) < 0 && errno != ENOENT) {
 		mail_storage_set_critical(storage, "unlink_directory(%s) "
 					  "failed: %m", index_dir);
 		return FALSE;




More information about the dovecot-cvs mailing list