diff --git a/0001-mdb-provider-Remove-no-op-mdb_init-and-mdb_exit-call.patch b/0001-mdb-provider-Remove-no-op-mdb_init-and-mdb_exit-call.patch new file mode 100644 index 0000000..cf4d577 --- /dev/null +++ b/0001-mdb-provider-Remove-no-op-mdb_init-and-mdb_exit-call.patch @@ -0,0 +1,63 @@ +From b5fb9ec54cbf38b5dd3f1e1e8bc80dc84a7aa460 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 10 Jul 2021 13:30:47 +0200 +Subject: [PATCH 1/3] mdb-provider: Remove no-op mdb_init() and mdb_exit() + calls + +According to the mdbtools NEWS file for the 0.9.0 these functions have +always been no-ops: + +"The previously-deprecated functions mdb_init() and mdb_exit() have been +removed. These functions did nothing; any calls to them should be excised with +prejudice." + +And now they have been removed completely, since these were already +no-ops in older mdbtools versions we can safely drop them without +loosing compatibility with older mdbtools releases. +--- + providers/mdb/gda-mdb-provider.c | 15 --------------- + 1 file changed, 15 deletions(-) + +diff --git a/providers/mdb/gda-mdb-provider.c b/providers/mdb/gda-mdb-provider.c +index 10bdc809d..82b085ca7 100644 +--- a/providers/mdb/gda-mdb-provider.c ++++ b/providers/mdb/gda-mdb-provider.c +@@ -63,8 +63,6 @@ static const gchar *gda_mdb_provider_get_database (GdaServerProvider *provider, + + + static GObjectClass *parent_class = NULL; +-static GMutex mdb_init_mutex; +-static gint loaded_providers = 0; + char *g_input_ptr; + + /* +@@ -107,13 +105,6 @@ gda_mdb_provider_finalize (GObject *object) + + /* chain to parent class */ + parent_class->finalize (object); +- +- /* call MDB exit function if there are no more providers */ +- g_mutex_lock (&mdb_init_mutex); +- loaded_providers--; +- if (loaded_providers == 0) +- mdb_exit (); +- g_mutex_unlock (&mdb_init_mutex); + } + + GType +@@ -148,12 +139,6 @@ gda_mdb_provider_new (void) + { + GdaMdbProvider *provider; + +- g_mutex_lock (&mdb_init_mutex); +- if (loaded_providers == 0) +- mdb_init (); +- loaded_providers++; +- g_mutex_unlock (&mdb_init_mutex); +- + provider = g_object_new (gda_mdb_provider_get_type (), NULL); + return GDA_SERVER_PROVIDER (provider); + } +-- +2.31.1 + diff --git a/0002-mdb-provider-Store-filename-used-to-open-the-DB-in-o.patch b/0002-mdb-provider-Store-filename-used-to-open-the-DB-in-o.patch new file mode 100644 index 0000000..4cdde27 --- /dev/null +++ b/0002-mdb-provider-Store-filename-used-to-open-the-DB-in-o.patch @@ -0,0 +1,59 @@ +From 90c4468ba5d334ffaa627f6f63fba444119bac47 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 10 Jul 2021 13:48:11 +0200 +Subject: [PATCH 2/3] mdb-provider: Store filename used to open the DB in our + private data + +With mdbtools >= 0.9.0, the MdbFile struct no longer has a filename member, +instead store the filename passed to mdb_open() in our private data. + +Note this also fixes the dynamically allocated string returned by +g_build_filename() being leaked. +--- + providers/mdb/gda-mdb-provider.c | 4 +++- + providers/mdb/gda-mdb.h | 1 + + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/providers/mdb/gda-mdb-provider.c b/providers/mdb/gda-mdb-provider.c +index 82b085ca7..c82a37aee 100644 +--- a/providers/mdb/gda-mdb-provider.c ++++ b/providers/mdb/gda-mdb-provider.c +@@ -288,6 +288,7 @@ gda_mdb_provider_open_connection (GdaServerProvider *provider, GdaConnection *cn + + cdata = g_new0 (MdbConnectionData, 1); + cdata->cnc = cnc; ++ cdata->filename = filename; + cdata->server_version = NULL; + #ifdef MDB_WITH_WRITE_SUPPORT + cdata->mdb = mdb_open (filename, MDB_WRITABLE); +@@ -562,7 +563,7 @@ gda_mdb_provider_get_database (GdaServerProvider *provider, GdaConnection *cnc) + if (!cdata) + return NULL; + +- return (const gchar *) cdata->mdb->f->filename; ++ return cdata->filename; + } + + /* +@@ -572,5 +573,6 @@ static void + gda_mdb_free_cnc_data (MdbConnectionData *cdata) + { + g_free (cdata->server_version); ++ g_free (cdata->filename); + g_free (cdata); + } +diff --git a/providers/mdb/gda-mdb.h b/providers/mdb/gda-mdb.h +index 4744fe593..14eaf5d22 100644 +--- a/providers/mdb/gda-mdb.h ++++ b/providers/mdb/gda-mdb.h +@@ -38,6 +38,7 @@ + typedef struct { + GdaConnection *cnc; + MdbHandle *mdb; ++ gchar *filename; + gchar *server_version; + } MdbConnectionData; + +-- +2.31.1 + diff --git a/0003-mdb-provider-Pass-MdbHandle-to-the-mdb_set_date_fmt-.patch b/0003-mdb-provider-Pass-MdbHandle-to-the-mdb_set_date_fmt-.patch new file mode 100644 index 0000000..d6b36cc --- /dev/null +++ b/0003-mdb-provider-Pass-MdbHandle-to-the-mdb_set_date_fmt-.patch @@ -0,0 +1,40 @@ +From 66cc17d130d15d13efc5e22b2a155e426678c536 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 10 Jul 2021 13:37:11 +0200 +Subject: [PATCH 3/3] mdb-provider: Pass MdbHandle to the mdb_set_date_fmt() + call + +mdbtools >= 0.9.0 require a MdbHandle to be passed to the +mdb_set_date_fmt() call. Move the call to directly after mdb_open() +(when we first get the handle) and pass the handle to it. + +Note this change means that the mdb-provider will now no longer +compile with older mdbtools versions. +--- + providers/mdb/gda-mdb-provider.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/providers/mdb/gda-mdb-provider.c b/providers/mdb/gda-mdb-provider.c +index c82a37aee..17660b75d 100644 +--- a/providers/mdb/gda-mdb-provider.c ++++ b/providers/mdb/gda-mdb-provider.c +@@ -93,7 +93,6 @@ gda_mdb_provider_class_init (GdaMdbProviderClass *klass) + static void + gda_mdb_provider_init (GdaMdbProvider *myprv, GdaMdbProviderClass *klass) + { +- mdb_set_date_fmt ("%Y-%m-%d %H:%M:%S"); + } + + static void +@@ -301,6 +300,8 @@ gda_mdb_provider_open_connection (GdaServerProvider *provider, GdaConnection *cn + return FALSE; + } + ++ mdb_set_date_fmt (cdata->mdb, "%Y-%m-%d %H:%M:%S"); ++ + /* open virtual connection */ + if (! GDA_SERVER_PROVIDER_CLASS (parent_class)->open_connection (GDA_SERVER_PROVIDER (provider), cnc, params, + NULL, NULL, NULL, NULL)) { +-- +2.31.1 + diff --git a/bebdffb4de586fb43fd07ac549121f4b22f6812d.patch b/bebdffb4de586fb43fd07ac549121f4b22f6812d.patch new file mode 100644 index 0000000..dc656d4 --- /dev/null +++ b/bebdffb4de586fb43fd07ac549121f4b22f6812d.patch @@ -0,0 +1,13 @@ +--- libgda-5.2.10/providers/web/gda-web-provider.c~ 2020-11-08 14:23:20.000000000 -0600 ++++ libgda-5.2.10/providers/web/gda-web-provider.c 2021-12-22 09:00:22.980170873 -0600 +@@ -385,8 +385,8 @@ + cdata->mutex = gda_mutex_new (); + cdata->server_id = NULL; + cdata->forced_closing = FALSE; +- cdata->worker_session = soup_session_sync_new (); +- cdata->front_session = soup_session_sync_new_with_options ("max-conns-per-host", 1, NULL); ++ cdata->worker_session = soup_session_new_with_options ("ssl-use-system-ca-file", TRUE, NULL); ++ cdata->front_session = soup_session_new_with_options ("max-conns-per-host", 1, "ssl-use-system-ca-file", TRUE, NULL); + if (use_ssl) { + server_url = g_string_new ("https://"); + g_print ("USING SSL\n"); diff --git a/libgda.spec b/libgda.spec index 5032835..6896f4d 100644 --- a/libgda.spec +++ b/libgda.spec @@ -11,15 +11,21 @@ Name: libgda Epoch: 1 Version: 5.2.10 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Library for writing gnome database programs License: LGPLv2+ URL: http://www.gnome-db.org/ Source: http://ftp.gnome.org/pub/GNOME/sources/%{name}/5.2/%{name}-%{version}.tar.xz +# Patches for building against mdbtools >= 0.9.0 +# https://gitlab.gnome.org/GNOME/libgda/-/merge_requests/178 +Patch1: 0001-mdb-provider-Remove-no-op-mdb_init-and-mdb_exit-call.patch +Patch2: 0002-mdb-provider-Store-filename-used-to-open-the-DB-in-o.patch +Patch3: 0003-mdb-provider-Pass-MdbHandle-to-the-mdb_set_date_fmt-.patch # Upstream fix commit 9859479884fad5f39e6c37e8995e57c28b11b1b9 -Patch0: libgda-5.2.10-mysql-bool-fix.patch +Patch4: libgda-5.2.10-mysql-bool-fix.patch +Patch5: bebdffb4de586fb43fd07ac549121f4b22f6812d.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -373,9 +379,19 @@ rm %{buildroot}/%{_sysconfdir}/%{name}-%{apiver}/sales_test.db %endif %changelog -* Wed Dec 15 2021 David King - 1:5.2.10-1 +* Wed Dec 22 2021 Gwyn Ciesla - 1:5.2.10-4 +- Patch for CVE-2021-39359 + +* Tue Sep 14 2021 Sahana Prasad - 1:5.2.10-3 +- Rebuilt with OpenSSL 3.0.0 + +* Thu Jul 22 2021 Fedora Release Engineering - 1:5.2.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Sat Jul 10 2021 Hans de Goede - 1:5.2.10-1 - New upstream bugfix release 5.2.10 - gda_trml2html/2pdf scripts have been ported to python3, restore them +- Rebuild against new mdbtools-libs * Mon Feb 08 2021 Pavel Raiskup - 1:5.2.9-8 - rebuild for libpq ABI fix rhbz#1908268