From 0ae46558cb9000824855af704473e068ba0b9a07 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 29 2020 07:07:49 +0000 Subject: import evolution-data-server-3.28.5-5.el7 --- diff --git a/SOURCES/evolution-data-server-3.28.5-delay-new-module-load.patch b/SOURCES/evolution-data-server-3.28.5-delay-new-module-load.patch new file mode 100644 index 0000000..ce08506 --- /dev/null +++ b/SOURCES/evolution-data-server-3.28.5-delay-new-module-load.patch @@ -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); diff --git a/SPECS/evolution-data-server.spec b/SPECS/evolution-data-server.spec index 7fe2c6b..8efa880 100644 --- a/SPECS/evolution-data-server.spec +++ b/SPECS/evolution-data-server.spec @@ -32,7 +32,7 @@ Name: evolution-data-server Version: 3.28.5 -Release: 4%{?dist} +Release: 5%{?dist} Group: System Environment/Libraries Summary: Backend data server for Evolution License: LGPLv2+ @@ -61,6 +61,9 @@ Patch04: evolution-data-server-3.28.5-test-cal-client-get-revision.patch # RH bug #1696762 Patch05: evolution-data-server-3.28.5-cve-2019-3890.patch +# RH bug #1772103 +Patch06: evolution-data-server-3.28.5-delay-new-module-load.patch + ### Dependencies ### Requires: dconf @@ -184,6 +187,7 @@ the functionality of the installed %{name} package. %patch03 -p1 -b .sqlite-deterministic %patch04 -p1 -b .test-cal-client-get-revision %patch05 -p1 -b .cve-2019-3890 +%patch06 -p1 -b .delay-new-module-load %build @@ -445,6 +449,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || : %{_datadir}/installed-tests %changelog +* Tue Apr 21 2020 Milan Crha - 3.28.5-5 +- Resolves: #1772103 (EDBusServer: Delay new module load) + * Wed Aug 14 2019 Milan Crha - 3.28.5-4 - Add patch related to evolution-ews' CVE-2019-3890 (RH bug #1696762)