This commit is contained in:
Peter Robinson 2018-03-21 03:10:54 +00:00
parent 4c96d88f15
commit 605ae65076
5 changed files with 13 additions and 168 deletions

View File

@ -1,71 +0,0 @@
From cd5853c6b3e930eab1c90510d42e0d1c631b682d Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Fri, 9 Feb 2018 12:53:13 +0200
Subject: [PATCH 1/2] core: Fixes order InterfaceAdded
Registering on the callback of MGMT_OP_READ_ADV_FEATURES causes
InterfacesAdded to be reschedule after the device objects which causes
tools such as PulseAudio to consider it invalid.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1534857
---
src/advertising.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/advertising.c b/src/advertising.c
index 94a8c4050..970c3d87b 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -1032,14 +1032,6 @@ static void read_adv_features_callback(uint8_t status, uint16_t length,
if (manager->max_ads == 0)
return;
- if (!g_dbus_register_interface(btd_get_dbus_connection(),
- adapter_get_path(manager->adapter),
- LE_ADVERTISING_MGR_IFACE, methods,
- NULL, properties, manager, NULL)) {
- error("Failed to register " LE_ADVERTISING_MGR_IFACE);
- return;
- }
-
/* Reset existing instances */
if (feat->num_instances)
remove_advertising(manager, 0);
@@ -1061,19 +1053,29 @@ static struct btd_adv_manager *manager_create(struct btd_adapter *adapter)
}
manager->mgmt_index = btd_adapter_get_index(adapter);
+ manager->clients = queue_new();
+ manager->supported_flags = MGMT_ADV_FLAG_LOCAL_NAME;
+
+ if (!g_dbus_register_interface(btd_get_dbus_connection(),
+ adapter_get_path(manager->adapter),
+ LE_ADVERTISING_MGR_IFACE, methods,
+ NULL, properties, manager, NULL)) {
+ error("Failed to register " LE_ADVERTISING_MGR_IFACE);
+ goto fail;
+ }
if (!mgmt_send(manager->mgmt, MGMT_OP_READ_ADV_FEATURES,
manager->mgmt_index, 0, NULL,
read_adv_features_callback, manager, NULL)) {
error("Failed to read advertising features");
- manager_destroy(manager);
- return NULL;
+ goto fail;
}
- manager->clients = queue_new();
- manager->supported_flags = MGMT_ADV_FLAG_LOCAL_NAME;
-
return manager;
+
+fail:
+ manager_destroy(manager);
+ return NULL;
}
struct btd_adv_manager *btd_adv_manager_new(struct btd_adapter *adapter)
--
2.14.3

View File

@ -1,41 +0,0 @@
From 502df5778437dbbd73aff0d673aca6ba3235c667 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Fri, 9 Feb 2018 12:53:15 +0200
Subject: [PATCH 2/2] shared/gatt-client: Reset callbacks when unregistering
If user application is unregistering a notification handler its
callbacks shall not be called even CCC write is still holding a
reference to notify_data.
---
src/shared/gatt-client.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index 8083ff719..1285c37ef 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -1212,7 +1212,9 @@ static void complete_notify_request(void *data)
struct notify_data *notify_data = data;
notify_data->att_id = 0;
- notify_data->callback(0, notify_data->user_data);
+
+ if (notify_data->callback)
+ notify_data->callback(0, notify_data->user_data);
}
static bool notify_data_write_ccc(struct notify_data *notify_data, bool enable,
@@ -3157,6 +3159,10 @@ bool bt_gatt_client_unregister_notify(struct bt_gatt_client *client,
/* Remove data if it has been queued */
queue_remove(notify_data->chrc->reg_notify_queue, notify_data);
+ /* Reset callbacks */
+ notify_data->callback = NULL;
+ notify_data->notify = NULL;
+
complete_unregister_notify(notify_data);
return true;
}
--
2.14.3

View File

@ -1,41 +0,0 @@
From d746de1bbcd6e9349dbd990ff9d33351f0bad319 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 5 Sep 2017 10:46:03 +0200
Subject: [PATCH 4/4] obex: Work-around compilation failure
obexd/plugins/bluetooth.c: In function 'register_profile':
obexd/plugins/bluetooth.c:310:7: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
profile->driver->port);
^~~~~~~
obexd/plugins/bluetooth.c:314:7: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
profile->driver->name);
^~~~~~~
---
obexd/plugins/bluetooth.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c
index 3ee54325f..3e31eaef6 100644
--- a/obexd/plugins/bluetooth.c
+++ b/obexd/plugins/bluetooth.c
@@ -302,6 +302,9 @@ static int register_profile(struct bluetooth_profile *profile)
&opt);
dict_append_entry(&opt, "AutoConnect", DBUS_TYPE_BOOLEAN,
&auto_connect);
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
if (profile->driver->record) {
if (profile->driver->port != 0)
xml = g_markup_printf_escaped(profile->driver->record,
@@ -312,6 +315,7 @@ static int register_profile(struct bluetooth_profile *profile)
xml = g_markup_printf_escaped(profile->driver->record,
profile->driver->channel,
profile->driver->name);
+#pragma GCC diagnostic pop
dict_append_entry(&opt, "ServiceRecord", DBUS_TYPE_STRING,
&xml);
g_free(xml);
--
2.14.1

View File

@ -1,7 +1,7 @@
Name: bluez
Summary: Bluetooth utilities
Version: 5.48
Release: 5%{?dist}
Version: 5.49
Release: 1%{?dist}
License: GPLv2+
URL: http://www.bluez.org/
@ -15,25 +15,20 @@ Source3: btattach-bcm@.service
Source4: btattach-bcm-service.sh
# https://github.com/hadess/bluez/commits/build-fixes-5.46
Patch0: 0001-build-Enable-BIND_NOW.patch
Patch1: 0001-build-Enable-BIND_NOW.patch
Patch2: 0003-tools-csr_usb-Fix-compilation-failure.patch
Patch3: 0004-obex-Work-around-compilation-failure.patch
# https://github.com/hadess/bluez/commits/obex-5.46
Patch4: 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
Patch3: 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
# https://github.com/hadess/bluez/commits/hostname-plugin-5.47
Patch6: 0001-hostname-Fix-BlueZ-5.XX-adapter-name-on-startup.patch
Patch4: 0001-hostname-Fix-BlueZ-5.XX-adapter-name-on-startup.patch
# https://github.com/hadess/bluez/commits/systemd-hardening
Patch120: 0001-build-Always-define-confdir-and-statedir.patch
Patch121: 0002-systemd-Add-PrivateTmp-and-NoNewPrivileges-options.patch
Patch122: 0003-systemd-Add-more-filesystem-lockdown.patch
Patch123: 0004-systemd-More-lockdown.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1534857
Patch200: 0001-core-Fixes-order-InterfaceAdded.patch
Patch201: 0002-shared-gatt-client-Reset-callbacks-when-unregisterin.patch
Patch20: 0001-build-Always-define-confdir-and-statedir.patch
Patch21: 0002-systemd-Add-PrivateTmp-and-NoNewPrivileges-options.patch
Patch22: 0003-systemd-Add-more-filesystem-lockdown.patch
Patch23: 0004-systemd-More-lockdown.patch
BuildRequires: git-core
BuildRequires: dbus-devel >= 1.6
@ -269,6 +264,9 @@ make check
%{_userunitdir}/obex.service
%changelog
* Tue Mar 20 2018 Peter Robinson <pbrobinson@fedoraproject.org> 5.49-1
- Update to 5.49
* Tue Mar 06 2018 Björn Esser <besser82@fedoraproject.org> - 5.48-5
- Rebuilt for libjson-c.so.4 (json-c v0.13.1)

View File

@ -1 +1 @@
SHA512 (bluez-5.48.tar.xz) = 38cb20b8acee8adaab286a0b042efa770df367e7a69556117961fcc46d9e0a0e2a48059c7df9511bb00fe7fc37e916e34c928df9372b45051fcc57c8965b0bb7
SHA512 (bluez-5.49.tar.xz) = bc2988649420232b92e2c6836857027369f05ace005972f575ed0601c02cc97a07a3b7a0707a8bad72be73df7e8096c8bf023530443556e87c2ccb667981b37d