import evolution-data-server-3.28.5-24.el8

c8-beta imports/c8-beta/evolution-data-server-3.28.5-24.el8
MSVSphere Packaging Team 8 months ago
commit 347a8c52f0

@ -0,0 +1 @@
85025da5aeda52b9bb9506cb89c7985d1cb9083c SOURCES/evolution-data-server-3.28.5.tar.xz

1
.gitignore vendored

@ -0,0 +1 @@
SOURCES/evolution-data-server-3.28.5.tar.xz

@ -0,0 +1,53 @@
diff -up evolution-data-server-3.28.5/src/libedataserverui/e-credentials-prompter-impl-oauth2.c.oauth2-enable-html5-features evolution-data-server-3.28.5/src/libedataserverui/e-credentials-prompter-impl-oauth2.c
--- evolution-data-server-3.28.5/src/libedataserverui/e-credentials-prompter-impl-oauth2.c.oauth2-enable-html5-features 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/libedataserverui/e-credentials-prompter-impl-oauth2.c 2024-01-11 16:00:50.316053801 +0100
@@ -571,7 +571,9 @@ e_credentials_prompter_impl_oauth2_show_
GtkScrolledWindow *scrolled_window;
GtkWindow *dialog_parent;
ECredentialsPrompter *prompter;
+ WebKitCookieManager *cookie_manager;
WebKitSettings *webkit_settings;
+ WebKitWebContext *web_context;
gchar *title, *uri;
GString *info_markup;
gint row = 0;
@@ -670,16 +672,28 @@ e_credentials_prompter_impl_oauth2_show_
webkit_settings = webkit_settings_new_with_settings (
"auto-load-images", TRUE,
"default-charset", "utf-8",
- "enable-html5-database", FALSE,
"enable-dns-prefetching", FALSE,
- "enable-html5-local-storage", FALSE,
+ "enable-html5-database", TRUE,
+ "enable-html5-local-storage", TRUE,
"enable-offline-web-application-cache", FALSE,
"enable-page-cache", FALSE,
"enable-plugins", FALSE,
"media-playback-allows-inline", FALSE,
NULL);
- widget = webkit_web_view_new_with_settings (webkit_settings);
+ web_context = webkit_web_context_new ();
+ #if WEBKIT_CHECK_VERSION(2, 40, 0)
+ webkit_web_context_set_sandbox_enabled (web_context, TRUE);
+ #endif
+
+ cookie_manager = webkit_web_context_get_cookie_manager (web_context);
+ webkit_cookie_manager_set_accept_policy (cookie_manager, WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS);
+
+ widget = g_object_new (WEBKIT_TYPE_WEB_VIEW,
+ "settings", webkit_settings,
+ "web-context", web_context,
+ NULL);
+
g_object_set (
G_OBJECT (widget),
"hexpand", TRUE,
@@ -689,6 +703,7 @@ e_credentials_prompter_impl_oauth2_show_
NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), widget);
g_object_unref (webkit_settings);
+ g_object_unref (web_context);
prompter_oauth2->priv->web_view = WEBKIT_WEB_VIEW (widget);

@ -0,0 +1,91 @@
diff -up evolution-data-server-3.28.5/src/camel/camel-stream-buffer.c.CVE-2020-14928 evolution-data-server-3.28.5/src/camel/camel-stream-buffer.c
--- evolution-data-server-3.28.5/src/camel/camel-stream-buffer.c.CVE-2020-14928 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/camel/camel-stream-buffer.c 2020-07-23 10:26:57.962555350 +0200
@@ -524,3 +524,22 @@ camel_stream_buffer_read_line (CamelStre
return g_strdup ((gchar *) sbf->priv->linebuf);
}
+
+/*
+ * camel_stream_buffer_discard_cache:
+ * @sbf: a #CamelStreamBuffer
+ *
+ * Discards any cached data in the @sbf. The next read reads
+ * from the stream.
+ *
+ * Since: 3.28.5-14
+ */
+void
+camel_stream_buffer_discard_cache (CamelStreamBuffer *sbf)
+{
+ g_return_if_fail (CAMEL_IS_STREAM_BUFFER (sbf));
+
+ sbf->priv->ptr = sbf->priv->buf;
+ sbf->priv->end = sbf->priv->buf;
+ sbf->priv->ptr[0] = '\0';
+}
diff -up evolution-data-server-3.28.5/src/camel/camel-stream-buffer.h.CVE-2020-14928 evolution-data-server-3.28.5/src/camel/camel-stream-buffer.h
--- evolution-data-server-3.28.5/src/camel/camel-stream-buffer.h.CVE-2020-14928 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/camel/camel-stream-buffer.h 2020-07-23 10:26:57.963555348 +0200
@@ -93,6 +93,8 @@ gint camel_stream_buffer_gets (CamelStr
gchar * camel_stream_buffer_read_line (CamelStreamBuffer *sbf,
GCancellable *cancellable,
GError **error);
+void camel_stream_buffer_discard_cache
+ (CamelStreamBuffer *sbf);
G_END_DECLS
diff -up evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-store.c.CVE-2020-14928 evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-store.c
--- evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-store.c.CVE-2020-14928 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-store.c 2020-07-23 10:26:57.963555348 +0200
@@ -208,6 +208,8 @@ connect_to_server (CamelService *service
if (tls_stream != NULL) {
camel_stream_set_base_stream (stream, tls_stream);
+ /* Truncate any left cached input from the insecure part of the session */
+ camel_pop3_stream_discard_cache (pop3_engine->stream);
g_object_unref (tls_stream);
} else {
g_prefix_error (
diff -up evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-stream.c.CVE-2020-14928 evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-stream.c
--- evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-stream.c.CVE-2020-14928 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-stream.c 2020-07-23 10:26:57.963555348 +0200
@@ -457,3 +457,14 @@ camel_pop3_stream_getd (CamelPOP3Stream
return 1;
}
+
+void
+camel_pop3_stream_discard_cache (CamelPOP3Stream *is)
+{
+ if (is) {
+ is->ptr = is->end = is->buf;
+ is->lineptr = is->linebuf;
+ is->lineend = is->linebuf + CAMEL_POP3_STREAM_LINE_SIZE;
+ is->ptr[0] = '\n';
+ }
+}
diff -up evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-stream.h.CVE-2020-14928 evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-stream.h
--- evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-stream.h.CVE-2020-14928 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/camel/providers/pop3/camel-pop3-stream.h 2020-07-23 10:26:57.963555348 +0200
@@ -87,6 +87,7 @@ gint camel_pop3_stream_getd (CamelPOP3
guint *len,
GCancellable *cancellable,
GError **error);
+void camel_pop3_stream_discard_cache (CamelPOP3Stream *is);
G_END_DECLS
diff -up evolution-data-server-3.28.5/src/camel/providers/smtp/camel-smtp-transport.c.CVE-2020-14928 evolution-data-server-3.28.5/src/camel/providers/smtp/camel-smtp-transport.c
--- evolution-data-server-3.28.5/src/camel/providers/smtp/camel-smtp-transport.c.CVE-2020-14928 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/camel/providers/smtp/camel-smtp-transport.c 2020-07-23 10:26:57.963555348 +0200
@@ -319,6 +319,8 @@ connect_to_server (CamelService *service
if (tls_stream != NULL) {
camel_stream_set_base_stream (stream, tls_stream);
+ /* Truncate any left cached input from the insecure part of the session */
+ camel_stream_buffer_discard_cache (transport->istream);
g_object_unref (tls_stream);
} else {
g_prefix_error (

@ -0,0 +1,13 @@
diff -up evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-server.c.CVE-2020-16117 evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-server.c
--- evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-server.c.CVE-2020-16117 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-server.c 2020-09-30 09:10:32.240788043 +0200
@@ -2979,7 +2979,8 @@ connected:
/* See if we got new capabilities
* in the STARTTLS response. */
- imapx_free_capability (is->priv->cinfo);
+ if (is->priv->cinfo)
+ imapx_free_capability (is->priv->cinfo);
is->priv->cinfo = NULL;
if (ic->status->condition == IMAPX_CAPABILITY) {
is->priv->cinfo = ic->status->u.cinfo;

@ -0,0 +1,13 @@
diff -up evolution-data-server-3.28.5/src/calendar/backends/file/e-cal-backend-file.c.calbackendfile-interval-tree-destroy evolution-data-server-3.28.5/src/calendar/backends/file/e-cal-backend-file.c
--- evolution-data-server-3.28.5/src/calendar/backends/file/e-cal-backend-file.c.calbackendfile-interval-tree-destroy 2021-06-16 16:09:19.863360296 +0200
+++ evolution-data-server-3.28.5/src/calendar/backends/file/e-cal-backend-file.c 2021-06-16 16:10:14.225398710 +0200
@@ -298,7 +298,8 @@ free_calendar_data (ECalBackendFile *cbf
g_rec_mutex_lock (&priv->idle_save_rmutex);
- e_intervaltree_destroy (priv->interval_tree);
+ if (priv->interval_tree)
+ e_intervaltree_destroy (priv->interval_tree);
priv->interval_tree = NULL;
free_calendar_components (priv->comp_uid_hash, priv->icalcomp);

@ -0,0 +1,44 @@
diff -up evolution-data-server-3.28.5/cmake/modules/PrintableOptions.cmake.cmake-variable-name-comparison evolution-data-server-3.28.5/cmake/modules/PrintableOptions.cmake
--- evolution-data-server-3.28.5/cmake/modules/PrintableOptions.cmake.cmake-variable-name-comparison 2021-06-16 16:45:58.554763738 +0200
+++ evolution-data-server-3.28.5/cmake/modules/PrintableOptions.cmake 2021-06-16 16:47:13.343021509 +0200
@@ -19,32 +19,32 @@
# prints all the build options previously added with the above functions
macro(add_printable_variable_bare _name)
- if(_name STREQUAL "")
+ if("${_name}" STREQUAL "")
message(FATAL_ERROR "variable name cannot be empty")
- endif(_name STREQUAL "")
+ endif("${_name}" STREQUAL "")
list(APPEND _printable_options ${_name})
endmacro()
macro(add_printable_option _name _description _default_value)
- if(_name STREQUAL "")
+ if("${_name}" STREQUAL "")
message(FATAL_ERROR "option name cannot be empty")
- endif(_name STREQUAL "")
+ endif("${_name}" STREQUAL "")
option(${_name} ${_description} ${_default_value})
add_printable_variable_bare(${_name})
endmacro()
macro(add_printable_variable _name _description _default_value)
- if(_name STREQUAL "")
+ if("${_name}" STREQUAL "")
message(FATAL_ERROR "variable name cannot be empty")
- endif(_name STREQUAL "")
+ endif("${_name}" STREQUAL "")
set(${_name} ${_default_value} CACHE STRING ${_description})
add_printable_variable_bare(${_name})
endmacro()
macro(add_printable_variable_path _name _description _default_value)
- if(_name STREQUAL "")
+ if("${_name}" STREQUAL "")
message(FATAL_ERROR "path variable name cannot be empty")
- endif(_name STREQUAL "")
+ endif("${_name}" STREQUAL "")
set(${_name} ${_default_value} CACHE PATH ${_description})
add_printable_variable_bare(${_name})
endmacro()

@ -0,0 +1,18 @@
diff -up evolution-data-server-3.28.5/src/libedataserver/e-data-server-util.c.cve-2019-3890 evolution-data-server-3.28.5/src/libedataserver/e-data-server-util.c
--- evolution-data-server-3.28.5/src/libedataserver/e-data-server-util.c.cve-2019-3890 2019-04-15 09:25:49.273786456 +0200
+++ evolution-data-server-3.28.5/src/libedataserver/e-data-server-util.c 2019-04-15 09:35:00.784778830 +0200
@@ -3147,11 +3147,13 @@ e_util_can_use_collection_as_credential_
if (can_use_collection) {
gchar *method_source, *method_collection;
- /* Also check the method; if different, then rather not use the collection */
+ /* Also check the method; if different, then rather not use the collection.
+ Consider 'none' method on the child as the same as the collection method. */
method_source = e_source_authentication_dup_method (auth_source);
method_collection = e_source_authentication_dup_method (auth_collection);
can_use_collection = !method_source || !method_collection ||
+ g_ascii_strcasecmp (method_source, "none") == 0 ||
g_ascii_strcasecmp (method_source, method_collection) == 0;
g_free (method_source);

@ -0,0 +1,24 @@
diff -up evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c.dav-online-load-href evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c
--- evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c.dav-online-load-href 2018-11-26 12:18:57.874823757 +0100
+++ evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c 2018-11-26 12:20:27.967822511 +0100
@@ -993,6 +993,8 @@ ebb_webdav_load_contact_sync (EBookMetaB
if (!*out_contact) {
success = FALSE;
g_propagate_error (&local_error, EDB_ERROR_EX (E_DATA_BOOK_STATUS_OTHER_ERROR, _("Received object is not a valid vCard")));
+ } else if (out_extra) {
+ *out_extra = g_strdup (href);
}
}
diff -up evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c.dav-online-load-href evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c
--- evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c.dav-online-load-href 2018-11-26 12:19:15.809823509 +0100
+++ evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c 2018-11-26 12:20:03.976822843 +0100
@@ -1135,6 +1135,8 @@ ecb_caldav_load_component_sync (ECalMeta
if (!*out_component) {
success = FALSE;
g_propagate_error (&local_error, EDC_ERROR (InvalidObject));
+ } else if (out_extra) {
+ *out_extra = g_strdup (href);
}
}

@ -0,0 +1,34 @@
diff -up evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c.dav-remove-ignores-not-found evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c
--- evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c.dav-remove-ignores-not-found 2018-11-28 14:31:11.278711852 +0100
+++ evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c 2018-11-28 14:32:38.231710649 +0100
@@ -1160,6 +1160,13 @@ ebb_webdav_remove_contact_sync (EBookMet
g_object_unref (contact);
g_free (etag);
+ /* Ignore not found errors, this was a delete and the resource is gone.
+ It can be that it had been deleted on the server by other application. */
+ if (g_error_matches (local_error, SOUP_HTTP_ERROR, SOUP_STATUS_NOT_FOUND)) {
+ g_clear_error (&local_error);
+ success = TRUE;
+ }
+
if (local_error) {
ebb_webdav_check_credentials_error (bbdav, webdav, local_error);
g_propagate_error (error, local_error);
diff -up evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c.dav-remove-ignores-not-found evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c
--- evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c.dav-remove-ignores-not-found 2018-11-28 14:30:52.299712114 +0100
+++ evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c 2018-11-28 14:31:11.279711852 +0100
@@ -1320,6 +1320,13 @@ ecb_caldav_remove_component_sync (ECalMe
icalcomponent_free (icalcomp);
g_free (etag);
+ /* Ignore not found errors, this was a delete and the resource is gone.
+ It can be that it had been deleted on the server by other application. */
+ if (g_error_matches (local_error, SOUP_HTTP_ERROR, SOUP_STATUS_NOT_FOUND)) {
+ g_clear_error (&local_error);
+ success = TRUE;
+ }
+
if (local_error) {
ecb_caldav_check_credentials_error (cbdav, webdav, local_error);
g_propagate_error (error, local_error);

@ -0,0 +1,125 @@
diff -up evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c.delay-new-module-load evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c
--- evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c.delay-new-module-load 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c 2020-01-15 13:29:46.090644022 +0100
@@ -75,6 +75,78 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (
EDBusServer, e_dbus_server, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL))
+typedef struct _ModuleLoadData {
+ GWeakRef server_wr;
+ gchar *filename;
+} ModuleLoadData;
+
+static ModuleLoadData *
+module_load_data_new (EDBusServer *server,
+ const gchar *filename)
+{
+ ModuleLoadData *mld;
+
+ mld = g_slice_new0 (ModuleLoadData);
+ g_weak_ref_init (&mld->server_wr, server);
+ mld->filename = g_strdup (filename);
+
+ return mld;
+}
+
+static void
+module_load_data_free (gpointer ptr)
+{
+ ModuleLoadData *mld = ptr;
+
+ if (mld) {
+ g_weak_ref_clear (&mld->server_wr);
+ g_free (mld->filename);
+ g_slice_free (ModuleLoadData, mld);
+ }
+}
+
+static gboolean
+e_dbus_server_load_module_timeout_cb (gpointer user_data)
+{
+ ModuleLoadData *mld = user_data;
+ EDBusServer *server;
+
+ g_return_val_if_fail (mld != NULL, FALSE);
+
+ server = g_weak_ref_get (&mld->server_wr);
+ if (server) {
+ EModule *module;
+
+ e_source_registry_debug_print ("Loading module '%s'\n", mld->filename);
+
+ module = e_module_load_file (mld->filename);
+ if (module) {
+ g_type_module_unuse ((GTypeModule *) module);
+
+ e_dbus_server_quit (server, E_DBUS_SERVER_EXIT_RELOAD);
+ }
+
+ g_object_unref (server);
+ }
+
+ return FALSE;
+}
+
+static void
+e_dbus_server_schedule_module_load (EDBusServer *server,
+ const gchar *filename)
+{
+ g_return_if_fail (E_IS_DBUS_SERVER (server));
+ g_return_if_fail (filename != NULL);
+
+ e_source_registry_debug_print ("Schedule load of module '%s'\n", filename);
+
+ /* Delay the load by 10 seconds, in case the module doesn't have placed
+ all its libraries in the expected directories. */
+ g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, 10, e_dbus_server_load_module_timeout_cb,
+ module_load_data_new (server, filename), module_load_data_free);
+}
+
static void
dbus_server_bus_acquired_cb (GDBusConnection *connection,
const gchar *bus_name,
@@ -552,38 +624,27 @@ dbus_server_module_directory_changed_cb
if (event_type == G_FILE_MONITOR_EVENT_RENAMED && other_file) {
G_LOCK (loaded_modules);
if (!g_hash_table_contains (loaded_modules, filename)) {
+ gchar *other_filename = g_file_get_path (other_file);
+ e_source_registry_debug_print ("Module file '%s' renamed to '%s'\n", filename, other_filename);
g_free (filename);
- filename = g_file_get_path (other_file);
+ filename = other_filename;
event_type = G_FILE_MONITOR_EVENT_CREATED;
}
G_UNLOCK (loaded_modules);
}
if (filename && g_str_has_suffix (filename, "." G_MODULE_SUFFIX)) {
- gboolean any_loaded = FALSE;
-
if (event_type == G_FILE_MONITOR_EVENT_CREATED ||
event_type == G_FILE_MONITOR_EVENT_MOVED_IN) {
G_LOCK (loaded_modules);
if (!g_hash_table_contains (loaded_modules, filename)) {
- EModule *module;
-
g_hash_table_add (loaded_modules, g_strdup (filename));
-
- module = e_module_load_file (filename);
- if (module) {
- any_loaded = TRUE;
-
- g_type_module_unuse ((GTypeModule *) module);
- }
+ e_dbus_server_schedule_module_load (server, filename);
}
G_UNLOCK (loaded_modules);
}
-
- if (any_loaded)
- e_dbus_server_quit (server, E_DBUS_SERVER_EXIT_RELOAD);
}
g_free (filename);

@ -0,0 +1,101 @@
diff -up evolution-data-server-3.28.5/src/libedataserver/e-oauth2-service-google.c.google-oauth2 evolution-data-server-3.28.5/src/libedataserver/e-oauth2-service-google.c
--- evolution-data-server-3.28.5/src/libedataserver/e-oauth2-service-google.c.google-oauth2 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/libedataserver/e-oauth2-service-google.c 2022-05-04 18:57:08.059385307 +0200
@@ -24,6 +24,7 @@
#include "e-oauth2-service-google.h"
/* https://developers.google.com/identity/protocols/OAuth2InstalledApp */
+/* https://developers.google.com/identity/protocols/oauth2/native-app */
/* Forward Declarations */
static void e_oauth2_service_google_oauth2_service_init (EOAuth2ServiceInterface *iface);
@@ -74,14 +75,60 @@ static const gchar *
eos_google_get_authentication_uri (EOAuth2Service *service,
ESource *source)
{
- return "https://accounts.google.com/o/oauth2/auth";
+ return "https://accounts.google.com/o/oauth2/v2/auth";
}
static const gchar *
eos_google_get_refresh_uri (EOAuth2Service *service,
ESource *source)
{
- return "https://www.googleapis.com/oauth2/v3/token";
+ return "https://oauth2.googleapis.com/token";
+}
+
+static const gchar *
+eos_google_get_redirect_uri (EOAuth2Service *service,
+ ESource *source)
+{
+ G_LOCK_DEFINE_STATIC (redirect_uri);
+ const gchar *key_name = "oauth2-google-redirect-uri";
+ gchar *value;
+
+ G_LOCK (redirect_uri);
+
+ value = g_object_get_data (G_OBJECT (service), key_name);
+ if (!value) {
+ const gchar *client_id = eos_google_get_client_id (service, source);
+
+ if (client_id) {
+ GPtrArray *array;
+ gchar **strv;
+ gchar *joinstr;
+ guint ii;
+
+ strv = g_strsplit (client_id, ".", -1);
+ array = g_ptr_array_new ();
+
+ for (ii = 0; strv[ii]; ii++) {
+ g_ptr_array_insert (array, 0, strv[ii]);
+ }
+
+ g_ptr_array_add (array, NULL);
+
+ joinstr = g_strjoinv (".", (gchar **) array->pdata);
+ /* Use reverse-DNS of the client ID with the below path */
+ value = g_strconcat (joinstr, ":/oauth2redirect", NULL);
+
+ g_ptr_array_free (array, TRUE);
+ g_strfreev (strv);
+ g_free (joinstr);
+
+ g_object_set_data_full (G_OBJECT (service), key_name, value, g_free);
+ }
+ }
+
+ G_UNLOCK (redirect_uri);
+
+ return value;
}
static void
@@ -143,13 +190,13 @@ eos_google_extract_authorization_code (E
params = soup_form_decode (query);
if (params) {
- const gchar *response;
+ const gchar *code;
- response = g_hash_table_lookup (params, "response");
- if (response && g_ascii_strncasecmp (response, "code=", 5) == 0) {
- *out_authorization_code = g_strdup (response + 5);
+ code = g_hash_table_lookup (params, "code");
+ if (code && *code) {
+ *out_authorization_code = g_strdup (code);
known = TRUE;
- } else if (response && g_ascii_strncasecmp (response, "error", 5) == 0) {
+ } else if (g_hash_table_lookup (params, "error")) {
known = TRUE;
}
@@ -177,6 +224,7 @@ e_oauth2_service_google_oauth2_service_i
iface->get_client_secret = eos_google_get_client_secret;
iface->get_authentication_uri = eos_google_get_authentication_uri;
iface->get_refresh_uri = eos_google_get_refresh_uri;
+ iface->get_redirect_uri = eos_google_get_redirect_uri;
iface->prepare_authentication_uri_query = eos_google_prepare_authentication_uri_query;
iface->extract_authorization_code = eos_google_extract_authorization_code;
}

@ -0,0 +1,42 @@
diff -up evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-server.c.imapx-icloud-mail evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-server.c
--- evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-server.c.imapx-icloud-mail 2021-04-23 09:30:07.734875376 +0200
+++ evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-server.c 2021-04-23 09:31:45.321718451 +0200
@@ -629,6 +629,12 @@ imapx_server_stash_command_arguments (Ca
if (CAMEL_IMAPX_HAVE_CAPABILITY (is->priv->cinfo, SPECIAL_USE) || CAMEL_IMAPX_HAVE_CAPABILITY (is->priv->cinfo, X_GM_EXT_1))
g_string_append_printf (buffer, " SPECIAL-USE");
is->priv->list_return_opts = g_string_free (buffer, FALSE);
+ } else if (!is->priv->is_broken_cyrus && CAMEL_IMAPX_HAVE_CAPABILITY (is->priv->cinfo, LIST_STATUS)) {
+ buffer = g_string_new ("");
+ g_string_append_printf (
+ buffer, "STATUS (%s)",
+ is->priv->status_data_items);
+ is->priv->list_return_opts = g_string_free (buffer, FALSE);
} else {
is->priv->list_return_opts = NULL;
}
@@ -6208,7 +6214,7 @@ camel_imapx_server_list_sync (CamelIMAPX
camel_imapx_command_unref (ic);
- if (success && !is->priv->list_return_opts) {
+ if (success && (!is->priv->list_return_opts || CAMEL_IMAPX_LACK_CAPABILITY (is->priv->cinfo, LIST_EXTENDED))) {
ic = camel_imapx_command_new (is, CAMEL_IMAPX_JOB_LSUB, "LSUB \"\" %s",
pattern);
diff -up evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-utils.c.imapx-icloud-mail evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-utils.c
--- evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-utils.c.imapx-icloud-mail 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/camel/providers/imapx/camel-imapx-utils.c 2021-04-23 09:30:07.736875373 +0200
@@ -580,13 +580,6 @@ imapx_parse_capability (CamelIMAPXInputS
stream, &token, &len, cancellable, &local_error);
}
- /* Some capabilities are extensions of other capabilities.
- * Make sure all prerequisite capability flags are present. */
-
- /* LIST-STATUS is an extension of LIST-EXTENDED. */
- if (CAMEL_IMAPX_HAVE_CAPABILITY (cinfo, LIST_STATUS))
- cinfo->capa |= imapx_lookup_capability ("LIST-EXTENDED");
-
if (local_error != NULL) {
g_propagate_error (error, local_error);
imapx_free_capability (cinfo);

@ -0,0 +1,55 @@
From 6022b2b7816fea84919eef5993363f636bf734dc Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Mon, 3 Sep 2018 09:43:50 +0200
Subject: evo-I#86 - Quoting of plain text mail into HTML mode mangles deeper
levels
Related to https://gitlab.gnome.org/GNOME/evolution/issues/86
diff --git a/src/camel/camel-mime-filter-tohtml.c b/src/camel/camel-mime-filter-tohtml.c
index 07024aa1a..df6283655 100644
--- a/src/camel/camel-mime-filter-tohtml.c
+++ b/src/camel/camel-mime-filter-tohtml.c
@@ -303,6 +303,7 @@ html_convert (CamelMimeFilter *mime_filter,
outend = mime_filter->outbuf + mime_filter->outsize;
if (priv->flags & CAMEL_MIME_FILTER_TOHTML_PRE && !priv->pre_open) {
+ outptr = check_size (mime_filter, outptr, &outend, 6);
outptr = g_stpcpy (outptr, "<pre>");
priv->pre_open = TRUE;
}
@@ -339,13 +340,13 @@ html_convert (CamelMimeFilter *mime_filter,
depth = citation_depth (start, inend, &skip);
while (priv->blockquote_depth < depth) {
- outptr = check_size (mime_filter, outptr, &outend, 30);
- outptr = g_stpcpy (outptr, "<blockquote type=\"cite\">\n");
+ outptr = check_size (mime_filter, outptr, &outend, 25);
+ outptr = g_stpcpy (outptr, "<blockquote type=\"cite\">");
priv->blockquote_depth++;
}
while (priv->blockquote_depth > depth) {
- outptr = check_size (mime_filter, outptr, &outend, 15);
- outptr = g_stpcpy (outptr, "</blockquote>\n");
+ outptr = check_size (mime_filter, outptr, &outend, 14);
+ outptr = g_stpcpy (outptr, "</blockquote>");
priv->blockquote_depth--;
}
#if FOOLISHLY_UNMUNGE_FROM
@@ -463,14 +464,14 @@ html_convert (CamelMimeFilter *mime_filter,
outptr, &outend);
while (priv->blockquote_depth > 0) {
- outptr = check_size (mime_filter, outptr, &outend, 15);
+ outptr = check_size (mime_filter, outptr, &outend, 14);
outptr = g_stpcpy (outptr, "</blockquote>");
priv->blockquote_depth--;
}
if (priv->pre_open) {
/* close the pre-tag */
- outptr = check_size (mime_filter, outptr, &outend, 10);
+ outptr = check_size (mime_filter, outptr, &outend, 7);
outptr = g_stpcpy (outptr, "</pre>");
priv->pre_open = FALSE;
}

@ -0,0 +1,26 @@
diff -up evolution-data-server-3.28.5/src/camel/camel-folder-summary.c.nonstandard-uuencode-encoding evolution-data-server-3.28.5/src/camel/camel-folder-summary.c
--- evolution-data-server-3.28.5/src/camel/camel-folder-summary.c.nonstandard-uuencode-encoding 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/camel/camel-folder-summary.c 2021-09-30 17:30:47.674951472 +0200
@@ -3153,7 +3153,8 @@ summary_traverse_content_with_parser (Ca
else
camel_mime_filter_reset (summary->priv->filter_qp);
enc_id = camel_mime_parser_filter_add (mp, summary->priv->filter_qp);
- } else if (!g_ascii_strcasecmp (encoding, "x-uuencode")) {
+ } else if (!g_ascii_strcasecmp (encoding, "x-uuencode") ||
+ !g_ascii_strcasecmp (encoding, "uuencode")) {
d (printf (" decoding x-uuencode\n"));
if (summary->priv->filter_uu == NULL)
summary->priv->filter_uu = camel_mime_filter_basic_new (CAMEL_MIME_FILTER_BASIC_UU_DEC);
diff -up evolution-data-server-3.28.5/src/camel/camel-mime-utils.c.nonstandard-uuencode-encoding evolution-data-server-3.28.5/src/camel/camel-mime-utils.c
--- evolution-data-server-3.28.5/src/camel/camel-mime-utils.c.nonstandard-uuencode-encoding 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/camel/camel-mime-utils.c 2021-09-30 17:30:47.674951472 +0200
@@ -3268,6 +3268,9 @@ camel_transfer_encoding_from_string (con
for (i = 0; i < G_N_ELEMENTS (encodings); i++)
if (!g_ascii_strcasecmp (string, encodings[i]))
return i;
+
+ if (!g_ascii_strcasecmp (string, "uuencode"))
+ return CAMEL_TRANSFER_ENCODING_UUENCODE;
}
return CAMEL_TRANSFER_ENCODING_DEFAULT;

@ -0,0 +1,21 @@
diff -up evolution-data-server-3.28.5/src/modules/secret-monitor/module-secret-monitor.c.secret-monitor-warnings evolution-data-server-3.28.5/src/modules/secret-monitor/module-secret-monitor.c
--- evolution-data-server-3.28.5/src/modules/secret-monitor/module-secret-monitor.c.secret-monitor-warnings 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/modules/secret-monitor/module-secret-monitor.c 2021-11-22 12:52:08.683986536 +0100
@@ -167,7 +167,7 @@ secret_monitor_scan_secrets_thread (gpoi
g_list_free_full (list, (GDestroyNotify) g_object_unref);
if (local_error != NULL) {
- g_warning ("%s: %s", G_STRFUNC, local_error->message);
+ e_source_registry_debug_print ("%s: %s", G_STRFUNC, local_error->message);
g_error_free (local_error);
}
@@ -206,7 +206,7 @@ secret_monitor_scan_secrets_timeout_cb (
g_thread_unref (thread);
if (local_error != NULL) {
- g_warning ("%s: %s", G_STRFUNC, local_error->message);
+ e_source_registry_debug_print ("%s: %s", G_STRFUNC, local_error->message);
g_error_free (local_error);
g_object_unref (server);
}

@ -0,0 +1,117 @@
diff -up evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics
--- evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics.test-cal-meta-backend-without-evolution 2020-01-16 08:28:52.842204524 +0100
+++ evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics 2020-01-16 08:30:30.726203170 +0100
@@ -6,7 +6,7 @@ DTEND;TZID=/freeassociation.sourceforge.
SEQUENCE:1
SUMMARY:With attachment
TRANSP:OPAQUE
-ATTACH:file:///usr/share/icons/hicolor/48x48/apps/evolution.png
+ATTACH:$EVENT1URI$
CLASS:PUBLIC
CREATED:20170221T125054Z
LAST-MODIFIED:20170221T125054Z
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c.test-cal-meta-backend-without-evolution 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c 2020-01-16 08:28:52.842204524 +0100
@@ -114,13 +114,10 @@ tcu_fixture_teardown (TCUFixture *fixtur
}
gchar *
-tcu_new_icalstring_from_test_case (const gchar *case_name)
+tcu_get_test_case_filename (const gchar *case_name)
{
gchar *filename;
gchar *case_filename;
- GFile * file;
- GError *error = NULL;
- gchar *icalstring = NULL;
case_filename = g_strdup_printf ("%s.ics", case_name);
@@ -132,16 +129,48 @@ tcu_new_icalstring_from_test_case (const
else
filename = g_build_filename (SRCDIR, "..", "libedata-cal", "components", case_filename, NULL);
+ g_free (case_filename);
+
+ return filename;
+}
+
+gchar *
+tcu_new_icalstring_from_test_case (const gchar *case_name)
+{
+ gchar *filename;
+ GFile * file;
+ GError *error = NULL;
+ gchar *icalstring = NULL, *uripart;
+
+ filename = tcu_get_test_case_filename (case_name);
+
file = g_file_new_for_path (filename);
if (!g_file_load_contents (file, NULL, &icalstring, NULL, NULL, &error))
g_error (
"Failed to read test iCal string file '%s': %s",
filename, error->message);
- g_free (case_filename);
g_free (filename);
g_object_unref (file);
+ uripart = strstr (icalstring, "$EVENT1URI$");
+ if (uripart) {
+ gchar *uri;
+ GString *str;
+
+ filename = tcu_get_test_case_filename ("event-1");
+ uri = g_filename_to_uri (filename, NULL, NULL);
+ g_free (filename);
+
+ str = g_string_new_len (icalstring, uripart - icalstring);
+ g_string_append (str, uri);
+ g_string_append (str, uripart + 11);
+ g_free (icalstring);
+ g_free (uri);
+
+ icalstring = g_string_free (str, FALSE);
+ }
+
return icalstring;
}
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h.test-cal-meta-backend-without-evolution 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h 2020-01-16 08:28:52.842204524 +0100
@@ -46,6 +46,7 @@ ECalComponent * tcu_new_component_from_t
void tcu_add_component_from_test_case (TCUFixture *fixture,
const gchar *case_name,
ECalComponent **out_component);
+gchar * tcu_get_test_case_filename (const gchar *case_name);
G_END_DECLS
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c.test-cal-meta-backend-without-evolution 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c 2020-01-16 08:28:52.842204524 +0100
@@ -1274,6 +1274,7 @@ static void
test_get_attachment_uris (ECalMetaBackend *meta_backend)
{
ECalBackendSyncClass *backend_class;
+ gchar *expected_uri, *filename;
GSList *uris = NULL;
GError *error = NULL;
@@ -1306,7 +1307,13 @@ test_get_attachment_uris (ECalMetaBacken
g_assert_no_error (error);
g_assert_nonnull (uris);
g_assert_cmpint (g_slist_length (uris), ==, 1);
- g_assert_cmpstr (uris->data, ==, "file:///usr/share/icons/hicolor/48x48/apps/evolution.png");
+
+ filename = tcu_get_test_case_filename ("event-1");
+ expected_uri = g_filename_to_uri (filename, NULL, NULL);
+ g_free (filename);
+
+ g_assert_cmpstr (uris->data, ==, expected_uri);
+ g_free (expected_uri);
g_slist_free_full (uris, g_free);
}

@ -0,0 +1,100 @@
diff -up evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c.test-cal-client-get-revision evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c
--- evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c.test-cal-client-get-revision 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c 2019-05-23 19:31:07.484064234 +0200
@@ -1856,6 +1856,12 @@ e_data_book_report_backend_property_chan
g_strfreev (strv);
}
+ /* Ensure the property change signal on the D-Bus is invoked immediately, not on idle */
+ g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (dbus_interface));
+
+ if (book->priv->connection && !g_dbus_connection_is_closed (book->priv->connection))
+ g_dbus_connection_flush_sync (book->priv->connection, NULL, NULL);
+
/* Disregard anything else. */
}
diff -up evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c.test-cal-client-get-revision evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c
--- evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c.test-cal-client-get-revision 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c 2019-05-23 19:31:07.485064234 +0200
@@ -2470,6 +2470,12 @@ e_data_cal_report_backend_property_chang
if (g_str_equal (prop_name, CAL_BACKEND_PROPERTY_DEFAULT_OBJECT))
e_dbus_calendar_set_default_object (dbus_interface, prop_value);
+ /* Ensure the property change signal on the D-Bus is invoked immediately, not on idle */
+ g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (dbus_interface));
+
+ if (cal->priv->connection && !g_dbus_connection_is_closed (cal->priv->connection))
+ g_dbus_connection_flush_sync (cal->priv->connection, NULL, NULL);
+
/* Disregard anything else. */
}
diff -up evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c.test-cal-client-get-revision evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c
--- evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c.test-cal-client-get-revision 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c 2019-05-23 19:31:07.485064234 +0200
@@ -48,9 +48,22 @@ get_revision_compare_cycle (EBookClient
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION, &revision_after, NULL, &error))
g_error ("Error getting book revision: %s", error->message);
+ /* Sometimes, kind of rarely, the D-Bus property change is not delivered on time,
+ thus give it some time to be received and processed. */
+ if (g_strcmp0 (revision_before, revision_after) == 0) {
+ g_message (" D-Bus property 'revision' change not received yet, trying to wait a bit");
+
+ g_usleep (G_USEC_PER_SEC / 2);
+
+ g_clear_pointer (&revision_after, g_free);
+
+ if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION, &revision_after, NULL, &error))
+ g_error ("Error getting book revision: %s", error->message);
+ }
+
g_assert (revision_before);
g_assert (revision_after);
- g_assert (strcmp (revision_before, revision_after) != 0);
+ g_assert_cmpstr (revision_before, !=, revision_after);
g_message (
"Passed cycle, revision before '%s' revision after '%s'",
diff -up evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c.test-cal-client-get-revision evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c
--- evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c.test-cal-client-get-revision 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c 2019-05-23 19:31:07.485064234 +0200
@@ -42,18 +42,34 @@ get_revision_compare_cycle (ECalClient *
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
&revision_before, NULL, &error))
- g_error ("Error getting book revision: %s", error->message);
+ g_error ("Error getting calendar revision: %s", error->message);
if (!e_cal_client_create_object_sync (client, icalcomp, &uid, NULL, &error))
g_error ("Error creating object: %s", error->message);
+ if (!e_cal_client_remove_object_sync (client, uid, NULL, E_CAL_OBJ_MOD_ALL, NULL, &error))
+ g_error ("Error removing created object: %s", error->message);
+
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
&revision_after, NULL, &error))
- g_error ("Error getting book revision: %s", error->message);
+ g_error ("Error getting calendar revision: %s", error->message);
+
+ /* Sometimes, kind of rarely, the D-Bus property change is not delivered on time,
+ thus give it some time to be received and processed. */
+ if (g_strcmp0 (revision_before, revision_after) == 0) {
+ g_message (" D-Bus property 'revision' change not received yet, trying to wait a bit");
+
+ g_usleep (G_USEC_PER_SEC / 2);
+
+ g_clear_pointer (&revision_after, g_free);
+
+ if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION, &revision_after, NULL, &error))
+ g_error ("Error getting book revision: %s", error->message);
+ }
g_assert (revision_before);
g_assert (revision_after);
- g_assert (strcmp (revision_before, revision_after) != 0);
+ g_assert_cmpstr (revision_before, !=, revision_after);
g_message (
"Passed cycle, revision before '%s' revision after '%s'",

@ -0,0 +1,341 @@
diff -up evolution-data-server-3.28.5/src/libebackend/e-data-factory.c.tests-retry-client-open evolution-data-server-3.28.5/src/libebackend/e-data-factory.c
--- evolution-data-server-3.28.5/src/libebackend/e-data-factory.c.tests-retry-client-open 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/libebackend/e-data-factory.c 2018-12-04 10:42:29.837599599 +0100
@@ -1278,6 +1278,13 @@ data_factory_spawn_subprocess_backend (E
priv = data_factory->priv;
source = e_source_registry_ref_source (priv->registry, uid);
+
+ if (!source) {
+ g_set_error (
+ &error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
+ _("No such source for UID “%s”"), uid);
+ }
+
if (source && e_source_has_extension (source, extension_name)) {
ESourceBackend *extension;
@@ -1372,7 +1379,7 @@ data_factory_spawn_subprocess_backend (E
NULL);
g_object_unref (subprocess);
- } else {
+ } else if (!error) {
error = g_error_new (G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Backend factory for source “%s” and extension “%s” cannot be found."),
uid, extension_name);
diff -up evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-free-busy.c.tests-retry-client-open evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-free-busy.c
--- evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-free-busy.c.tests-retry-client-open 2018-12-04 10:43:10.449599037 +0100
+++ evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-free-busy.c 2018-12-04 10:43:19.837598907 +0100
@@ -94,6 +94,49 @@ teardown_fixture (ETestServerFixture *fi
}
static void
+add_component_sync (ECalClient *cal_client)
+{
+ const gchar *comp_str =
+ "BEGIN:VEVENT\r\n"
+ "UID:test-fb-event-1\r\n"
+ "DTSTAMP:20040212T000000Z\r\n"
+ "DTSTART:20040213T060000Z\r\n"
+ "DTEND:20040213T080000Z\r\n"
+ "SUMMARY:Test event\r\n"
+ "TRANSP:OPAQUE\r\n"
+ "CLASS:PUBLIC\r\n"
+ "CREATED:20040211T080000Z\r\n"
+ "LAST-MODIFIED:20040211T080000Z\r\n"
+ "END:VEVENT\r\n";
+ icalcomponent *icalcomp;
+ GError *error = NULL;
+
+ icalcomp = icalcomponent_new_from_string (comp_str);
+ g_assert_nonnull (icalcomp);
+
+ if (!e_cal_client_create_object_sync (cal_client, icalcomp, NULL, NULL, &error))
+ g_error ("Failed to add component: %s", error ? error->message : "Unknown error");
+
+ icalcomponent_free (icalcomp);
+ g_clear_error (&error);
+}
+
+static void
+wait_for_dbus_signal (GMainLoop *loop)
+{
+ GMainContext *main_context;
+ gint retries = 0;
+
+ main_context = g_main_loop_get_context (loop);
+
+ while (!received_free_busy_data && retries < 5) {
+ retries++;
+
+ g_main_context_iteration (main_context, TRUE);
+ }
+}
+
+static void
free_busy_data_cb (ECalClient *client,
const GSList *free_busy,
const gchar *func_name)
@@ -114,9 +157,13 @@ test_get_free_busy_sync (ETestServerFixt
cal_client = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);
+ add_component_sync (cal_client);
+
/* This is set by the free-busy-data callback */
received_free_busy_data = FALSE;
+ g_signal_connect (cal_client, "free-busy-data", G_CALLBACK (free_busy_data_cb), (gpointer) G_STRFUNC);
+
utc = icaltimezone_get_utc_timezone ();
start = time_from_isodate ("20040212T000000Z");
end = time_add_day_with_zone (start, 2, utc);
@@ -127,6 +174,9 @@ test_get_free_busy_sync (ETestServerFixt
g_slist_free (users);
+ wait_for_dbus_signal (fixture->loop);
+
+ g_assert (received_free_busy_data);
g_assert (freebusy_data);
g_slist_free_full (freebusy_data, g_object_unref);
@@ -147,6 +197,8 @@ async_get_free_busy_result_ready (GObjec
if (!e_cal_client_get_free_busy_finish (cal_client, result, &freebusy_data, &error))
g_error ("create object finish: %s", error->message);
+ wait_for_dbus_signal (loop);
+
g_assert (received_free_busy_data);
g_assert (freebusy_data);
@@ -166,6 +218,8 @@ test_get_free_busy_async (ETestServerFix
cal_client = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);
+ add_component_sync (cal_client);
+
/* This is set by the free-busy-data callback */
received_free_busy_data = FALSE;
diff -up evolution-data-server-3.28.5/tests/test-server-utils/e-test-server-utils.c.tests-retry-client-open evolution-data-server-3.28.5/tests/test-server-utils/e-test-server-utils.c
--- evolution-data-server-3.28.5/tests/test-server-utils/e-test-server-utils.c.tests-retry-client-open 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/test-server-utils/e-test-server-utils.c 2018-12-04 10:43:19.838598907 +0100
@@ -199,6 +199,7 @@ assert_object_finalized (ETestServerFixt
typedef struct {
ETestServerFixture *fixture;
ETestServerClosure *closure;
+ guint retries;
} FixturePair;
static gboolean
@@ -332,12 +333,15 @@ e_test_server_utils_bootstrap_timeout (F
return FALSE;
}
+static gboolean e_test_server_utils_retry_open_client_cb (gpointer user_data);
+
static void
e_test_server_utils_client_ready (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
FixturePair *pair = (FixturePair *) user_data;
+ gboolean need_retry = FALSE;
GError *error = NULL;
switch (pair->closure->type) {
@@ -345,7 +349,10 @@ e_test_server_utils_client_ready (GObjec
pair->fixture->service.book_client = (EBookClient *)
e_book_client_connect_finish (res, &error);
- if (!pair->fixture->service.book_client)
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else if (!pair->fixture->service.book_client)
g_error ("Unable to create the test book: %s", error->message);
break;
@@ -353,7 +360,10 @@ e_test_server_utils_client_ready (GObjec
pair->fixture->service.book_client = (EBookClient *)
e_book_client_connect_direct_finish (res, &error);
- if (!pair->fixture->service.book_client)
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else if (!pair->fixture->service.book_client)
g_error ("Unable to create the test book: %s", error->message);
break;
@@ -361,7 +371,10 @@ e_test_server_utils_client_ready (GObjec
pair->fixture->service.calendar_client = (ECalClient *)
e_cal_client_connect_finish (res, &error);
- if (!pair->fixture->service.calendar_client)
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else if (!pair->fixture->service.calendar_client)
g_error ("Unable to create the test calendar: %s", error->message);
break;
@@ -371,6 +384,14 @@ e_test_server_utils_client_ready (GObjec
g_assert_not_reached ();
}
+ g_clear_error (&error);
+
+ if (need_retry) {
+ pair->retries++;
+ g_timeout_add_seconds (1, e_test_server_utils_retry_open_client_cb, pair);
+ return;
+ }
+
/* Track ref counts now that we have a client */
add_weak_ref (pair->fixture, pair->closure->type);
@@ -382,6 +403,7 @@ e_test_server_utils_source_added (ESourc
ESource *source,
FixturePair *pair)
{
+ gboolean need_retry = FALSE;
GError *error = NULL;
if (g_strcmp0 (e_source_get_uid (source), pair->fixture->source_name) != 0)
@@ -409,8 +431,13 @@ e_test_server_utils_source_added (ESourc
}
if (!pair->closure->use_async_connect &&
- !pair->fixture->service.book_client)
- g_error ("Unable to create the test book: %s", error ? error->message : "Unknown error");
+ !pair->fixture->service.book_client) {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to create the test book: %s", error ? error->message : "Unknown error");
+ }
break;
@@ -418,11 +445,23 @@ e_test_server_utils_source_added (ESourc
/* Dont bother testing the Async apis for deprecated APIs */
pair->fixture->service.book = e_book_new (source, &error);
- if (!pair->fixture->service.book)
- g_error ("Unable to create the test book: %s", error->message);
+ if (!pair->fixture->service.book) {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to create the test book: %s", error->message);
+
+ break;
+ }
- if (!e_book_open (pair->fixture->service.book, FALSE, &error))
- g_error ("Unable to open book: %s", error->message);
+ if (!e_book_open (pair->fixture->service.book, FALSE, &error)) {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to open book: %s", error->message);
+ }
break;
@@ -439,8 +478,13 @@ e_test_server_utils_source_added (ESourc
e_cal_client_connect_sync (
source,
pair->closure->calendar_source_type, (guint32) -1, NULL, &error);
- if (!pair->fixture->service.calendar_client)
- g_error ("Unable to create the test calendar: %s", error->message);
+ if (!pair->fixture->service.calendar_client) {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to create the test calendar: %s", error->message);
+ }
}
break;
@@ -449,11 +493,22 @@ e_test_server_utils_source_added (ESourc
/* Dont bother testing the Async apis for deprecated APIs */
pair->fixture->service.calendar = e_cal_new (source, pair->closure->calendar_source_type);
- if (!pair->fixture->service.calendar)
- g_error ("Unable to create the test calendar");
+ if (!pair->fixture->service.calendar) {
+ if (pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to create the test calendar");
- if (!e_cal_open (pair->fixture->service.calendar, FALSE, &error))
- g_error ("Unable to open calendar: %s", error->message);
+ break;
+ }
+
+ if (!e_cal_open (pair->fixture->service.calendar, FALSE, &error)) {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to open calendar: %s", error->message);
+ }
break;
@@ -461,6 +516,14 @@ e_test_server_utils_source_added (ESourc
return;
}
+ g_clear_error (&error);
+
+ if (need_retry) {
+ pair->retries++;
+ g_timeout_add_seconds (1, e_test_server_utils_retry_open_client_cb, pair);
+ return;
+ }
+
/* Add the weak ref now if we just created it */
if (pair->closure->type != E_TEST_SERVER_NONE &&
pair->closure->use_async_connect == FALSE)
@@ -471,6 +534,22 @@ e_test_server_utils_source_added (ESourc
}
static gboolean
+e_test_server_utils_retry_open_client_cb (gpointer user_data)
+{
+ FixturePair *pair = user_data;
+ ESource *source;
+
+ source = e_source_registry_ref_source (pair->fixture->registry, pair->fixture->source_name);
+
+ g_assert (E_IS_SOURCE (source));
+
+ e_test_server_utils_source_added (pair->fixture->registry, source, pair);
+ g_object_unref (source);
+
+ return FALSE;
+}
+
+static gboolean
e_test_server_utils_bootstrap_idle (FixturePair *pair)
{
ESourceBackend *backend = NULL;
@@ -578,7 +657,7 @@ e_test_server_utils_setup (ETestServerFi
gconstpointer user_data)
{
ETestServerClosure *closure = (ETestServerClosure *) user_data;
- FixturePair pair = { fixture, closure };
+ FixturePair pair = { fixture, closure, 0 };
/* Create work directory */
if (!test_installed_services ())

@ -0,0 +1,179 @@
diff --git a/src/addressbook/libebook-contacts/e-vcard.c b/src/addressbook/libebook-contacts/e-vcard.c
index e44b7fdcf..680cf85af 100644
--- a/src/addressbook/libebook-contacts/e-vcard.c
+++ b/src/addressbook/libebook-contacts/e-vcard.c
@@ -120,6 +120,14 @@
G_DEFINE_TYPE (EVCard, e_vcard, G_TYPE_OBJECT)
+static EVCardAttribute *e_vcard_attribute_ref (EVCardAttribute *attr);
+static void e_vcard_attribute_unref (EVCardAttribute *attr);
+static EVCardAttributeParam *e_vcard_attribute_param_ref (EVCardAttributeParam *param);
+static void e_vcard_attribute_param_unref (EVCardAttributeParam *param);
+
+G_DEFINE_BOXED_TYPE (EVCardAttribute, e_vcard_attribute, e_vcard_attribute_ref, e_vcard_attribute_unref)
+G_DEFINE_BOXED_TYPE (EVCardAttributeParam, e_vcard_attribute_param, e_vcard_attribute_param_ref, e_vcard_attribute_param_unref)
+
/* Encoding used in v-card
* Note: v-card spec defines additional 7BIT 8BIT and X- encoding
*/
@@ -135,6 +143,7 @@ struct _EVCardPrivate {
};
struct _EVCardAttribute {
+ gint ref_count;
gchar *group;
gchar *name;
GList *params; /* EVCardParam */
@@ -145,6 +154,7 @@ struct _EVCardAttribute {
};
struct _EVCardAttributeParam {
+ gint ref_count;
gchar *name;
GList *values; /* GList of gchar *'s */
};
@@ -1555,6 +1565,7 @@ e_vcard_attribute_new (const gchar *attr_group,
if (attr_group != NULL && *attr_group == '\0')
attr_group = NULL;
+ attr->ref_count = 1;
attr->group = g_strdup (attr_group);
attr->name = g_strdup (attr_name);
@@ -1572,14 +1583,34 @@ e_vcard_attribute_free (EVCardAttribute *attr)
{
g_return_if_fail (attr != NULL);
- g_free (attr->group);
- g_free (attr->name);
+ e_vcard_attribute_unref (attr);
+}
- e_vcard_attribute_remove_values (attr);
+static EVCardAttribute *
+e_vcard_attribute_ref (EVCardAttribute *attr)
+{
+ g_return_val_if_fail (attr != NULL, NULL);
- e_vcard_attribute_remove_params (attr);
+ g_atomic_int_inc (&attr->ref_count);
- g_slice_free (EVCardAttribute, attr);
+ return attr;
+}
+
+static void
+e_vcard_attribute_unref (EVCardAttribute *attr)
+{
+ g_return_if_fail (attr != NULL);
+
+ if (g_atomic_int_dec_and_test (&attr->ref_count)) {
+ g_free (attr->group);
+ g_free (attr->name);
+
+ e_vcard_attribute_remove_values (attr);
+
+ e_vcard_attribute_remove_params (attr);
+
+ g_slice_free (EVCardAttribute, attr);
+ }
}
/**
@@ -1609,25 +1640,6 @@ e_vcard_attribute_copy (EVCardAttribute *attr)
return a;
}
-GType
-e_vcard_attribute_get_type (void)
-{
- static volatile gsize type_id__volatile = 0;
-
- if (g_once_init_enter (&type_id__volatile)) {
- GType type_id;
-
- type_id = g_boxed_type_register_static (
- "EVCardAttribute",
- (GBoxedCopyFunc) e_vcard_attribute_copy,
- (GBoxedFreeFunc) e_vcard_attribute_free);
-
- g_once_init_leave (&type_id__volatile, type_id);
- }
-
- return type_id__volatile;
-}
-
/**
* e_vcard_remove_attributes:
* @evc: vcard object
@@ -2068,25 +2080,6 @@ e_vcard_attribute_remove_params (EVCardAttribute *attr)
attr->encoding = EVC_ENCODING_RAW;
}
-GType
-e_vcard_attribute_param_get_type (void)
-{
- static volatile gsize type_id__volatile = 0;
-
- if (g_once_init_enter (&type_id__volatile)) {
- GType type_id;
-
- type_id = g_boxed_type_register_static (
- "EVCardAttributeParam",
- (GBoxedCopyFunc) e_vcard_attribute_param_copy,
- (GBoxedFreeFunc) e_vcard_attribute_param_free);
-
- g_once_init_leave (&type_id__volatile, type_id);
- }
-
- return type_id__volatile;
-}
-
/**
* e_vcard_attribute_param_new:
* @name: the name of the new parameter
@@ -2099,6 +2092,8 @@ EVCardAttributeParam *
e_vcard_attribute_param_new (const gchar *name)
{
EVCardAttributeParam *param = g_slice_new (EVCardAttributeParam);
+
+ param->ref_count = 1;
param->values = NULL;
param->name = g_strdup (name);
@@ -2116,11 +2111,31 @@ e_vcard_attribute_param_free (EVCardAttributeParam *param)
{
g_return_if_fail (param != NULL);
- g_free (param->name);
+ e_vcard_attribute_param_unref (param);
+}
+
+static EVCardAttributeParam *
+e_vcard_attribute_param_ref (EVCardAttributeParam *param)
+{
+ g_return_val_if_fail (param != NULL, NULL);
+
+ g_atomic_int_inc (&param->ref_count);
+
+ return param;
+}
+
+static void
+e_vcard_attribute_param_unref (EVCardAttributeParam *param)
+{
+ g_return_if_fail (param != NULL);
+
+ if (g_atomic_int_dec_and_test (&param->ref_count)) {
+ g_free (param->name);
- e_vcard_attribute_param_remove_values (param);
+ e_vcard_attribute_param_remove_values (param);
- g_slice_free (EVCardAttributeParam, param);
+ g_slice_free (EVCardAttributeParam, param);
+ }
}
/**

@ -0,0 +1,14 @@
diff --git a/src/addressbook/libebook-contacts/e-vcard.c b/src/addressbook/libebook-contacts/e-vcard.c
index f11a17d77..e44b7fdcf 100644
--- a/src/addressbook/libebook-contacts/e-vcard.c
+++ b/src/addressbook/libebook-contacts/e-vcard.c
@@ -2395,8 +2395,8 @@ e_vcard_attribute_remove_param_value (EVCardAttribute *attr,
return;
}
- param->values = g_list_delete_link (param->values, l);
g_free (l->data);
+ param->values = g_list_delete_link (param->values, l);
if (param->values == NULL) {
e_vcard_attribute_param_free (param);

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save