[dovecot-cvs] dovecot/src/lib-storage/list mailbox-list-fs.c, 1.6, 1.7 mailbox-list-maildir.c, 1.6, 1.7

tss at dovecot.org tss at dovecot.org
Fri Mar 30 22:30:41 EEST 2007


Update of /var/lib/cvs/dovecot/src/lib-storage/list
In directory talvi:/tmp/cvs-serv31485/list

Modified Files:
	mailbox-list-fs.c mailbox-list-maildir.c 
Log Message:
Moved some common code to mailbox-list.c



Index: mailbox-list-fs.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/list/mailbox-list-fs.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mailbox-list-fs.c	29 Mar 2007 14:22:00 -0000	1.6
+++ mailbox-list-fs.c	30 Mar 2007 19:30:39 -0000	1.7
@@ -143,8 +143,6 @@
 	struct fs_mailbox_list *list = (struct fs_mailbox_list *)_list;
 	const struct mailbox_list_settings *set = &_list->set;
 
-	mailbox_list_clear_error(&list->list);
-
 	if (name == NULL) {
 		/* return root directories */
 		switch (type) {
@@ -210,13 +208,6 @@
 	struct stat st;
 	const char *path;
 
-	mailbox_list_clear_error(&list->list);
-
-	if (!mailbox_list_is_valid_existing_name(_list, name)) {
-		*status = MAILBOX_NAME_INVALID;
-		return 0;
-	}
-
 	path = mailbox_list_get_path(_list, name,
 				     MAILBOX_LIST_PATH_TYPE_MAILBOX);
 
@@ -269,8 +260,6 @@
 	struct fs_mailbox_list *list = (struct fs_mailbox_list *)_list;
 	const char *path;
 
-	mailbox_list_clear_error(&list->list);
-
 	path = t_strconcat(_list->set.control_dir != NULL ?
 			   _list->set.control_dir : _list->set.root_dir,
 			   "/", _list->set.subscription_fname, NULL);
@@ -303,12 +292,6 @@
 	const char *oldpath, *newpath, *old_indexdir, *new_indexdir, *p;
 	struct stat st;
 
-	if (!mailbox_list_is_valid_existing_name(list, oldname) ||
-	    !mailbox_list_is_valid_create_name(list, newname)) {
-		mailbox_list_set_error(list, "Invalid mailbox name");
-		return -1;
-	}
-
 	oldpath = mailbox_list_get_path(list, oldname,
 					MAILBOX_LIST_PATH_TYPE_MAILBOX);
 	newpath = mailbox_list_get_path(list, newname,

Index: mailbox-list-maildir.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/list/mailbox-list-maildir.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mailbox-list-maildir.c	29 Mar 2007 07:59:25 -0000	1.6
+++ mailbox-list-maildir.c	30 Mar 2007 19:30:39 -0000	1.7
@@ -142,8 +142,6 @@
 	struct maildir_mailbox_list *list =
 		(struct maildir_mailbox_list *)_list;
 
-	mailbox_list_clear_error(&list->list);
-
 	if (name == NULL) {
 		/* return root directories */
 		switch (type) {
@@ -201,18 +199,9 @@
 				     const char *name,
 				     enum mailbox_name_status *status)
 {
-	struct maildir_mailbox_list *list =
-		(struct maildir_mailbox_list *)_list;
 	struct stat st;
 	const char *path;
 
-	mailbox_list_clear_error(&list->list);
-
-	if (!mailbox_list_is_valid_existing_name(_list, name)) {
-		*status = MAILBOX_NAME_INVALID;
-		return 0;
-	}
-
 	path = mailbox_list_get_path(_list, name,
 				     MAILBOX_LIST_PATH_TYPE_MAILBOX);
 
@@ -244,17 +233,6 @@
 	return list->temp_prefix;
 }
 
-static const char *
-maildir_list_join_refmask(struct mailbox_list *_list __attr_unused__,
-			  const char *ref, const char *mask)
-{
-	if (*ref != '\0') {
-		/* merge reference and mask */
-		mask = t_strconcat(ref, mask, NULL);
-	}
-	return mask;
-}
-
 static int maildir_list_set_subscribed(struct mailbox_list *_list,
 				       const char *name, bool set)
 {
@@ -262,8 +240,6 @@
 		(struct maildir_mailbox_list *)_list;
 	const char *path;
 
-	mailbox_list_clear_error(&list->list);
-
 	path = t_strconcat(_list->set.control_dir != NULL ?
 			   _list->set.control_dir : _list->set.root_dir,
 			   "/", _list->set.subscription_fname, NULL);
@@ -388,12 +364,6 @@
 	int ret;
         bool found;
 
-	if (!mailbox_list_is_valid_existing_name(list, oldname) ||
-	    !mailbox_list_is_valid_create_name(list, newname)) {
-		mailbox_list_set_error(list, "Invalid mailbox name");
-		return -1;
-	}
-
 	/* NOTE: it's possible to rename a nonexisting mailbox which has
 	   children. In that case we should ignore the rename() error. */
 	oldpath = mailbox_list_get_path(list, oldname,
@@ -444,7 +414,7 @@
 		maildir_list_get_path,
 		maildir_list_get_mailbox_name_status,
 		maildir_list_get_temp_prefix,
-		maildir_list_join_refmask,
+		NULL,
 		maildir_list_iter_init,
 		maildir_list_iter_next,
 		maildir_list_iter_deinit,



More information about the dovecot-cvs mailing list