From c396c50664cbd3bd371b071a609d3ae78c19d581 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 22 2019 08:50:22 +0000 Subject: import compat-gnome-bluetooth38-3.8.2.1-2.el7 --- diff --git a/.compat-gnome-bluetooth38.metadata b/.compat-gnome-bluetooth38.metadata new file mode 100644 index 0000000..adc3e99 --- /dev/null +++ b/.compat-gnome-bluetooth38.metadata @@ -0,0 +1 @@ +d33be5e7f03a4e6518fd8116e3bee16285f15f28 SOURCES/gnome-bluetooth-3.8.2.1.tar.xz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d26dc4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/gnome-bluetooth-3.8.2.1.tar.xz diff --git a/SOURCES/0001-lib-Fix-a-few-memory-leaks.patch b/SOURCES/0001-lib-Fix-a-few-memory-leaks.patch new file mode 100644 index 0000000..81572f9 --- /dev/null +++ b/SOURCES/0001-lib-Fix-a-few-memory-leaks.patch @@ -0,0 +1,35 @@ +From 91ac544495d874159893eefff1f68332c4780001 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Wed, 20 Nov 2013 17:10:07 +0100 +Subject: [PATCH 1/3] lib: Fix a few memory leaks + +--- + lib/bluetooth-client.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c +index 8bddb58..1fe7e6d 100644 +--- a/lib/bluetooth-client.c ++++ b/lib/bluetooth-client.c +@@ -1878,8 +1878,10 @@ bluetooth_client_connect_service (BluetoothClient *client, + g_object_unref (proxy); + goto bail; + } ++ g_hash_table_unref (table); + + service = get_proxy_for_iface (DEVICE (proxy), iface_name, client); ++ g_object_unref (proxy); + + g_debug ("Calling 'Connect' on interface %s for %s", + iface_name, g_dbus_proxy_get_object_path (service)); +@@ -1922,6 +1924,7 @@ bluetooth_client_connect_service (BluetoothClient *client, + NULL, + (GAsyncReadyCallback) disconnect_callback, + conndata); ++ g_object_unref (proxy); + } + + return; +-- +1.8.4.2 + diff --git a/SOURCES/0002-lib-Fix-cancellation-handling.patch b/SOURCES/0002-lib-Fix-cancellation-handling.patch new file mode 100644 index 0000000..1baa119 --- /dev/null +++ b/SOURCES/0002-lib-Fix-cancellation-handling.patch @@ -0,0 +1,132 @@ +From 84ec5f5a11908e636ff3b992aecfc5c8f8faddb5 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Wed, 20 Nov 2013 17:10:46 +0100 +Subject: [PATCH 2/3] lib: Fix cancellation handling + +We weren't checking for cancellation properly, not passing +cancellables to sub-routines, and not reporting cancelled calls +correctly. +--- + lib/bluetooth-client.c | 30 ++++++++++++++++++------------ + 1 file changed, 18 insertions(+), 12 deletions(-) + +diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c +index 1fe7e6d..e224033 100644 +--- a/lib/bluetooth-client.c ++++ b/lib/bluetooth-client.c +@@ -1661,23 +1661,20 @@ connect_callback (GDBusProxy *proxy, + ConnectData *conndata) + { + GVariant *variant; +- gboolean retval; + GError *error = NULL; + + variant = g_dbus_proxy_call_finish (proxy, res, &error); + if (variant == NULL) { +- retval = FALSE; + g_debug ("Connect failed for %s: %s", + g_dbus_proxy_get_object_path (proxy), error->message); +- g_error_free (error); ++ g_simple_async_result_take_error (conndata->simple, error); + } else { + g_debug ("Connect succeeded for %s", + g_dbus_proxy_get_object_path (proxy)); + g_variant_unref (variant); +- retval = TRUE; ++ g_simple_async_result_set_op_res_gboolean (conndata->simple, TRUE); + } + +- g_simple_async_result_set_op_res_gboolean (conndata->simple, retval); + g_simple_async_result_complete_in_idle (conndata->simple); + + g_object_unref (conndata->simple); +@@ -1699,10 +1696,11 @@ disconnect_callback (GDBusProxy *proxy, + g_debug ("Disconnect failed for %s: %s", + g_dbus_proxy_get_object_path (G_DBUS_PROXY (conndata->device)), + error->message); +- g_error_free (error); ++ g_simple_async_result_take_error (conndata->simple, error); + } else { + g_debug ("Disconnect succeeded for %s", + g_dbus_proxy_get_object_path (G_DBUS_PROXY (conndata->device))); ++ g_simple_async_result_set_op_res_gboolean (conndata->simple, retval); + } + } else { + GDBusProxy *service; +@@ -1716,6 +1714,10 @@ disconnect_callback (GDBusProxy *proxy, + g_dbus_proxy_get_object_path (proxy), + g_dbus_proxy_get_interface_name (proxy), + error->message); ++ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { ++ g_simple_async_result_take_error (conndata->simple, error); ++ goto bail; ++ } + g_error_free (error); + } else { + g_debug ("Disconnect succeeded for %s on %s", +@@ -1737,14 +1739,14 @@ disconnect_callback (GDBusProxy *proxy, + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, +- NULL, ++ g_object_get_data (G_OBJECT (conndata->simple), "cancellable"), + (GAsyncReadyCallback) disconnect_callback, + conndata); + + return; + } + +- g_simple_async_result_set_op_res_gboolean (conndata->simple, retval); ++bail: + g_simple_async_result_complete_in_idle (conndata->simple); + + g_object_unref (proxy); +@@ -1836,6 +1838,7 @@ bluetooth_client_connect_service (BluetoothClient *client, + g_object_set_data_full (G_OBJECT (simple), "device", + g_strdup (device), g_free); + } ++ g_simple_async_result_set_check_cancellable (simple, cancellable); + + gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, + BLUETOOTH_COLUMN_PROXY, &proxy, +@@ -1891,7 +1894,7 @@ bluetooth_client_connect_service (BluetoothClient *client, + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, +- NULL, ++ cancellable, + (GAsyncReadyCallback) connect_callback, + conndata); + } else if (table != NULL) { +@@ -1914,14 +1917,14 @@ bluetooth_client_connect_service (BluetoothClient *client, + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, +- NULL, ++ cancellable, + (GAsyncReadyCallback) disconnect_callback, + conndata); + } else if (table == NULL) { + g_debug ("Calling device_call_disconnect() for %s", + g_dbus_proxy_get_object_path (proxy)); + device_call_disconnect (DEVICE (proxy), +- NULL, ++ cancellable, + (GAsyncReadyCallback) disconnect_callback, + conndata); + g_object_unref (proxy); +@@ -1956,7 +1959,10 @@ bluetooth_client_connect_service_finish (BluetoothClient *client, + + g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == bluetooth_client_connect_service); + +- return g_simple_async_result_get_op_res_gboolean (simple); ++ if (g_simple_async_result_get_op_res_gboolean (simple)) ++ return TRUE; ++ g_simple_async_result_propagate_error (simple, error); ++ return FALSE; + } + + #define BOOL_STR(x) (x ? "True" : "False") +-- +1.8.4.2 + diff --git a/SOURCES/0003-lib-Fix-extraneous-reference-that-could-lead-to-cras.patch b/SOURCES/0003-lib-Fix-extraneous-reference-that-could-lead-to-cras.patch new file mode 100644 index 0000000..472a506 --- /dev/null +++ b/SOURCES/0003-lib-Fix-extraneous-reference-that-could-lead-to-cras.patch @@ -0,0 +1,29 @@ +From fbc1ce2836ccf17368fb6fe2aa0c69396c610aa5 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Wed, 20 Nov 2013 17:11:32 +0100 +Subject: [PATCH 3/3] lib: Fix extraneous reference that could lead to crash + +The proxy we got from the tree model was already the extra +reference we needed. This makes sure that all additional +instances of the device (the ones not in the tree model) +are destroyed when cancelling a disconnect call. +--- + lib/bluetooth-client.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c +index e224033..c5e86de 100644 +--- a/lib/bluetooth-client.c ++++ b/lib/bluetooth-client.c +@@ -1900,7 +1900,7 @@ bluetooth_client_connect_service (BluetoothClient *client, + } else if (table != NULL) { + GDBusProxy *service; + +- conndata->device = g_object_ref (DEVICE (proxy)); ++ conndata->device = DEVICE (proxy); + conndata->services = g_hash_table_get_keys (table); + g_hash_table_unref (table); + conndata->services = g_list_sort (conndata->services, (GCompareFunc) rev_sort_services); +-- +1.8.4.2 + diff --git a/SOURCES/61-gnome-bluetooth-rfkill.rules b/SOURCES/61-gnome-bluetooth-rfkill.rules new file mode 100644 index 0000000..d7d9650 --- /dev/null +++ b/SOURCES/61-gnome-bluetooth-rfkill.rules @@ -0,0 +1,7 @@ +# Get access to /dev/rfkill for users +# See https://bugzilla.redhat.com/show_bug.cgi?id=514798 +# +# Simplified by Kay Sievers +# https://bugzilla.redhat.com/show_bug.cgi?id=733326 + +KERNEL=="rfkill", SUBSYSTEM=="misc", TAG+="uaccess" diff --git a/SPECS/compat-gnome-bluetooth38.spec b/SPECS/compat-gnome-bluetooth38.spec new file mode 100644 index 0000000..789721a --- /dev/null +++ b/SPECS/compat-gnome-bluetooth38.spec @@ -0,0 +1,76 @@ +Name: compat-gnome-bluetooth38 +Epoch: 1 +Version: 3.8.2.1 +Release: 2%{?dist} +Summary: Compat package with gnome-bluetooth 3.8 libraries + +Group: Applications/Communications +License: GPLv2+ +URL: http://live.gnome.org/GnomeBluetooth +Source0: http://download.gnome.org/sources/gnome-bluetooth/3.8/gnome-bluetooth-%{version}.tar.xz +Source1: 61-gnome-bluetooth-rfkill.rules + +Patch0: 0001-lib-Fix-a-few-memory-leaks.patch +Patch1: 0002-lib-Fix-cancellation-handling.patch +Patch2: 0003-lib-Fix-extraneous-reference-that-could-lead-to-cras.patch + +%if 0%{?rhel} +ExcludeArch: s390 s390x +%endif + +BuildRequires: gtk3-devel >= 3.0 +BuildRequires: dbus-glib-devel + +BuildRequires: intltool desktop-file-utils gettext gtk-doc +BuildRequires: itstool + +BuildRequires: gobject-introspection-devel + +%description +Compatibility package with gnome-bluetooth 3.8 librarires. + +%package -n compat-libgnome-bluetooth11 +Summary: Compat package with gnome-bluetooth 3.8 libraries +Group: System Environment/Libraries +License: LGPLv2+ + +%description -n compat-libgnome-bluetooth11 +Compatibility package with gnome-bluetooth 3.8 librarires. + +%prep +%setup -q -n gnome-bluetooth-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +%build +%configure --disable-desktop-update --disable-icon-update --disable-schemas-compile --disable-compile-warnings +make %{?_smp_mflags} + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +rm -rf $RPM_BUILD_ROOT%{_bindir} +rm -rf $RPM_BUILD_ROOT%{_includedir} +rm -rf $RPM_BUILD_ROOT%{_libdir}/girepository-1.0/ +rm -rf $RPM_BUILD_ROOT%{_libdir}/gnome-bluetooth/ +rm -rf $RPM_BUILD_ROOT%{_libdir}/libgnome-bluetooth.la +rm -rf $RPM_BUILD_ROOT%{_libdir}/libgnome-bluetooth.so +rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig/ +rm -rf $RPM_BUILD_ROOT%{_datadir} + +%post -n compat-libgnome-bluetooth11 -p /sbin/ldconfig + +%postun -n compat-libgnome-bluetooth11 -p /sbin/ldconfig + +%files -n compat-libgnome-bluetooth11 +%doc COPYING.LIB +%{_libdir}/libgnome-bluetooth.so.* + +%changelog +* Wed Apr 22 2015 Bastien Nocera 3.8.2.1-2 +- Update for RHEL +Resolves: #1184211 + +* Fri Nov 07 2014 Kalev Lember - 3.8.2.1-1 +- gnome-bluetooth compat package for el7-gnome-3-14 copr