If the folder name contains the directory separator, reject it.
authorPeter Williams <peterw@ximian.com>
Fri, 2 Aug 2002 18:19:53 +0000 (18:19 +0000)
committerPeter Williams <peterw@src.gnome.org>
Fri, 2 Aug 2002 18:19:53 +0000 (18:19 +0000)
2002-08-01  Peter Williams  <peterw@ximian.com>

* providers/imap/camel-imap-store.c (create_folder): If the folder
name contains the directory separator, reject it.

camel/ChangeLog
camel/providers/imap/camel-imap-store.c

index 4de4145..c1d32a9 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-01  Peter Williams  <peterw@ximian.com>
+
+       * providers/imap/camel-imap-store.c (create_folder): If the folder
+       name contains the directory separator, reject it.
+
 2002-08-02  Not Zed  <NotZed@Ximian.com>
 
        * providers/local/camel-mbox-summary.c (mbox_summary_check): Clear
index daee1cd..2972c52 100644 (file)
@@ -1743,7 +1743,15 @@ create_folder (CamelStore *store, const char *parent_name,
                return NULL;
        if (!parent_name)
                parent_name = "";
-       
+
+       if (strchr (folder_name, imap_store->dir_sep)) {
+               camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_PATH,
+                                     _("The folder name \"%s\" is invalid because "
+                                       "it containes the character \"%c\""),
+                                     folder_name, imap_store->dir_sep);
+               return NULL;
+       }
+
        /* check if the parent allows inferiors */
        
        need_convert = FALSE;