aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-store.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-05-17 11:44:27 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-05-17 11:44:27 +0800
commit49686598a43ad861b6ab1cd1a550f124b5910500 (patch)
tree75f9f7f63880a9c36e0a0791ef8b37a9aa43f09f /camel/camel-store.c
parent6e1efd0cba8c8665bb0532e3c5b4c4a9187b2e4f (diff)
downloadgsoc2013-evolution-49686598a43ad861b6ab1cd1a550f124b5910500.tar.gz
gsoc2013-evolution-49686598a43ad861b6ab1cd1a550f124b5910500.tar.zst
gsoc2013-evolution-49686598a43ad861b6ab1cd1a550f124b5910500.zip
don't allow creation of Trash or Junk folders.
2004-05-14 Not Zed <NotZed@Ximian.com> * camel-store.c (camel_store_create_folder): don't allow creation of Trash or Junk folders. (camel_store_rename_folder): similar for rename. #57250. 2004-05-13 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (summary_build_content_info): set secure flag if we have a known security type. (flag_names[]): Added secure bit. (summary_build_content_info_message): set secure flag as appropriate. (summary_build_content_info_message): dont set attachments for simple types (non text), only base it on multipart/* stuff. (summary_build_content_info): same. * camel-folder-summary.h: added SECURE flag. Indicates signed or encrypted content. svn path=/trunk/; revision=25914
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r--camel/camel-store.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/camel/camel-store.c b/camel/camel-store.c
index d9deb41d98..3b6b60afff 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -316,6 +316,14 @@ camel_store_create_folder (CamelStore *store, const char *parent_name,
{
CamelFolderInfo *fi;
+ if ((parent_name == NULL || parent_name[0] == 0)
+ && (((store->flags & CAMEL_STORE_VTRASH) && strcmp(folder_name, CAMEL_VTRASH_NAME) == 0)
+ || ((store->flags & CAMEL_STORE_VJUNK) && strcmp(folder_name, CAMEL_VJUNK_NAME) == 0))) {
+ camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_INVALID,
+ _("Cannot create folder: %s: folder exists"), folder_name);
+ return NULL;
+ }
+
CAMEL_STORE_LOCK(store, folder_lock);
fi = CS_CLASS (store)->create_folder (store, parent_name, folder_name, ex);
CAMEL_STORE_UNLOCK(store, folder_lock);
@@ -423,6 +431,13 @@ camel_store_rename_folder (CamelStore *store, const char *old_namein, const char
if (strcmp(old_namein, new_name) == 0)
return;
+ if (((store->flags & CAMEL_STORE_VTRASH) && strcmp(old_namein, CAMEL_VTRASH_NAME) == 0)
+ || ((store->flags & CAMEL_STORE_VJUNK) && strcmp(old_namein, CAMEL_VJUNK_NAME) == 0)) {
+ camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
+ _("Cannot rename folder: %s: Invalid operation"), old_namein);
+ return;
+ }
+
/* need to save this, since old_namein might be folder->full_name, which could go away */
old_name = g_strdup(old_namein);
oldlen = strlen(old_name);