Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:pchenthill
evolution-data-server
bnc-208395-cannot-access-folder-with-#-eds.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc-208395-cannot-access-folder-with-#-eds.patch of Package evolution-data-server
Index: servers/exchange/lib/e2k-global-catalog.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/servers/exchange/lib/e2k-global-catalog.c,v retrieving revision 1.6 diff -u -p -r1.6 e2k-global-catalog.c --- servers/exchange/lib/e2k-global-catalog.c 6 Mar 2006 10:59:48 -0000 1.6 +++ servers/exchange/lib/e2k-global-catalog.c 13 Nov 2006 14:30:34 -0000 @@ -685,6 +686,21 @@ get_account_control_values (E2kGlobalCat } +static void +print_e2k_gc_entry (E2kGlobalCatalogEntry *gc) +{ + if (!gc) + return; + + E2K_GC_DEBUG_MSG(("Printing GC data\n\n")); + E2K_GC_DEBUG_MSG(("DN = %s\n", gc->dn)); + E2K_GC_DEBUG_MSG(("display_name = %s\n", gc->display_name)); + E2K_GC_DEBUG_MSG(("email = %s\n", gc->email)); + E2K_GC_DEBUG_MSG(("exchange_server = %s\n", gc->exchange_server)); + E2K_GC_DEBUG_MSG(("mailbox = %s\n", gc->mailbox)); + E2K_GC_DEBUG_MSG(("legacy_exchange_dn = %s\n", gc->legacy_exchange_dn)); +} + /** * e2k_global_catalog_lookup: * @gc: the global catalog Index: servers/exchange/storage/e-folder-exchange.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/e-folder-exchange.c,v retrieving revision 1.11 diff -u -p -r1.11 e-folder-exchange.c --- servers/exchange/storage/e-folder-exchange.c 6 Mar 2006 06:41:32 -0000 1.11 +++ servers/exchange/storage/e-folder-exchange.c 13 Nov 2006 14:30:34 -0000 @@ -46,6 +46,7 @@ #include "exchange-esource.h" #include "exchange-hierarchy.h" +#define d(x) struct _EFolderExchangePrivate { ExchangeHierarchy *hier; @@ -150,6 +151,7 @@ e_folder_exchange_new (ExchangeHierarchy { EFolderExchange *efe; EFolder *ef; + char *sanitized_path; g_return_val_if_fail (EXCHANGE_IS_HIERARCHY (hier), NULL); g_return_val_if_fail (name != NULL, NULL); @@ -157,16 +159,25 @@ e_folder_exchange_new (ExchangeHierarchy g_return_val_if_fail (physical_uri != NULL, NULL); g_return_val_if_fail (internal_uri != NULL, NULL); + d(g_print ("e_folder_exchange_new: name=[%s], type=[%s], internal_uri=[%s], physical_uri=[%s]\n", + name, type, internal_uri, physical_uri)); + efe = g_object_new (E_TYPE_FOLDER_EXCHANGE, NULL); ef = (EFolder *)efe; e_folder_construct (ef, name, type, ""); - e_folder_set_physical_uri (ef, physical_uri); efe->priv->hier = hier; g_object_ref (hier); + efe->priv->internal_uri = g_strdup (internal_uri); - efe->priv->path = sanitize_path (e2k_uri_path (e_folder_get_physical_uri (ef))); + e_folder_set_physical_uri (ef, physical_uri); + + sanitized_path = sanitize_path (e2k_uri_path (physical_uri)); + e2k_uri_decode (sanitized_path); + efe->priv->path = sanitized_path; + d(g_print ("e_folder_exchange_new: sanitized=[%s]\n", sanitized_path)); + efe->priv->outlook_class = g_strdup (outlook_class); /* Add ESources */ Index: servers/exchange/storage/exchange-account.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/exchange-account.c,v retrieving revision 1.36 diff -u -p -r1.36 exchange-account.c --- servers/exchange/storage/exchange-account.c 12 Oct 2006 12:38:17 -0000 1.36 +++ servers/exchange/storage/exchange-account.c 13 Nov 2006 14:30:34 -0000 @@ -527,6 +527,8 @@ exchange_account_remove_folder (Exchange g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR); + d(g_print ("exchange_account_remove_folder: path=[%s]\n", path)); + if (!get_folder (account, path, &folder, &hier)) return EXCHANGE_ACCOUNT_FOLDER_DOES_NOT_EXIST; Index: camel/camel-url.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/camel/camel-url.c,v retrieving revision 1.46 diff -u -p -r1.46 camel-url.c --- camel/camel-url.c 5 Oct 2006 14:16:39 -0000 1.46 +++ camel/camel-url.c 14 Nov 2006 05:31:49 -0000 @@ -719,3 +719,33 @@ camel_url_copy(const CamelURL *in) return out; } + +char * +camel_url_decode_path (const char *path) +{ + gchar **comps; + char *new_path = NULL; + GString *str; + int i = 0; + + if (!path) + return g_strdup(""); /* ??? or NULL? */ + + str = g_string_new (NULL); + + comps = g_strsplit (path, "/", -1); + while (comps[i]) { + camel_url_decode (comps[i]); + g_string_append (str, comps[i]); + g_string_append_c (str, '/'); + i++; + } + + /* Strip-off the trailing "/" */ + new_path = g_strndup (str->str, str->len-1); + + g_strfreev (comps); + g_string_free (str, TRUE); + + return new_path; +} Index: camel/camel-url.h =================================================================== RCS file: /cvs/gnome/evolution-data-server/camel/camel-url.h,v retrieving revision 1.20 diff -u -p -r1.20 camel-url.h --- camel/camel-url.h 31 Aug 2005 04:21:56 -0000 1.20 +++ camel/camel-url.h 14 Nov 2006 05:31:49 -0000 @@ -62,6 +62,7 @@ void camel_url_free (CamelURL *url); char *camel_url_encode (const char *part, const char *escape_extra); void camel_url_decode (char *part); +char *camel_url_decode_path (const char *path); /* for editing url's */ void camel_url_set_protocol (CamelURL *url, const char *protocol); Index: servers/exchange/storage/exchange-hierarchy-webdav.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/exchange-hierarchy-webdav.c,v retrieving revision 1.12 diff -u -p -r1.12 exchange-hierarchy-webdav.c --- servers/exchange/storage/exchange-hierarchy-webdav.c 6 Apr 2006 16:33:37 -0000 1.12 +++ servers/exchange/storage/exchange-hierarchy-webdav.c 14 Nov 2006 05:34:06 -0000 @@ -48,6 +48,10 @@ #include "exchange-folder-size.h" #include "exchange-esource.h" +#define d(x) + +#define URI_ENCODE_CHARS "@;:/?=." + struct _ExchangeHierarchyWebDAVPrivate { GHashTable *folders_by_internal_path; gboolean deep_searchable; @@ -232,7 +236,10 @@ e_folder_webdav_new (ExchangeHierarchy * gboolean offline_supported) { EFolder *folder; - char *real_type, *http_uri, *physical_uri; + char *real_type, *http_uri, *physical_uri, *fixed_name = NULL; + + d( g_print ("exchange-hierarchy-webdave.c:e_folder_webdave_new: internal_uri=[%s], name=[%s], type=[%s], class=[%s]\n", + internal_uri, name, type, outlook_class)); if (hier->type == EXCHANGE_HIERARCHY_PUBLIC && !strstr (type, "/public")) @@ -242,24 +249,10 @@ e_folder_webdav_new (ExchangeHierarchy * real_type = g_strdup ("calendar/public"); /* Hack */ else real_type = g_strdup (type); - - if (strchr (name, '/')) { - char *fixed_name, *p; - - /* We can't have a '/' in the path, so we replace it with - * a '\' and just hope the user doesn't have another - * folder with that name. - */ - fixed_name = g_strdup (name); - for (p = fixed_name; *p; p++) { - if (*p == '/') - *p = '\\'; - } - - physical_uri = e2k_uri_concat (e_folder_get_physical_uri (parent), fixed_name); - g_free (fixed_name); - } else - physical_uri = e2k_uri_concat (e_folder_get_physical_uri (parent), name); + + fixed_name = e2k_uri_encode (name, FALSE, URI_ENCODE_CHARS); + physical_uri = e2k_uri_concat (e_folder_get_physical_uri (parent), fixed_name); + g_free (fixed_name); if (internal_uri) { folder = e_folder_exchange_new (hier, name, @@ -267,14 +260,27 @@ e_folder_webdav_new (ExchangeHierarchy * physical_uri, internal_uri); } else { char *temp_name; + char *encoded_name = NULL; + const char *new_internal_uri; + int len; + + len = strlen (name); /* appending "/" here, so that hash table lookup in rescan() succeeds */ - if (*(name + (strlen (name) - 1)) != '/') - temp_name = g_strdup_printf ("%s/", name); - else - temp_name = g_strdup (name); + if (name[len-1] != '/') { + encoded_name = e2k_uri_encode (name, FALSE, URI_ENCODE_CHARS); + } else { + temp_name = g_strndup (name, len-1); + encoded_name = e2k_uri_encode (temp_name, FALSE, URI_ENCODE_CHARS); + g_free (temp_name); + } + temp_name = g_strdup_printf ("%s/", encoded_name); + g_free (encoded_name); - http_uri = e2k_uri_concat (e_folder_exchange_get_internal_uri (parent), temp_name); + new_internal_uri = e_folder_exchange_get_internal_uri (parent); + http_uri = e2k_uri_concat (new_internal_uri, temp_name); + d(g_print ("exchange-hierarchy-webdave.c:e_folder_webdave_new: http_uri=[%s], new_internal_uri=[%s], temp_name=[%s], name[%s]\n", + http_uri, new_internal_uri, temp_name, name)); g_free (temp_name); folder = e_folder_exchange_new (hier, name,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor