From b5636a417c42450e5bb185c1d1638bd89e61b586 Mon Sep 17 00:00:00 2001 From: Don Zickus Date: Fri, 3 Feb 2017 13:29:38 -0500 Subject: [PATCH] Configure systemctl settings for bluez-obexd correctly Resolves rhbz#1259827 --- ...register-attribute-handler-until-cor.patch | 49 +++++++++++++++++++ bluez.spec | 13 ++++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 0001-core-gatt-Don-t-register-attribute-handler-until-cor.patch diff --git a/0001-core-gatt-Don-t-register-attribute-handler-until-cor.patch b/0001-core-gatt-Don-t-register-attribute-handler-until-cor.patch new file mode 100644 index 0000000..5842a29 --- /dev/null +++ b/0001-core-gatt-Don-t-register-attribute-handler-until-cor.patch @@ -0,0 +1,49 @@ +From f558fca8d64e3795b0654a90d343af1dd1d8b33c Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Tue, 8 Nov 2016 10:38:43 +0200 +Subject: [PATCH] core/gatt: Don't register attribute handler until core + service are registered + +Wait until GAP and GATT service are registered to register attribute +handlers otherwise it may attempt to generate service changed without +having service changed registered which leads to print errors: + +bluetoothd[2376]: Failed to obtain handles for "Service Changed" characteristic +--- + src/gatt-database.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/src/gatt-database.c b/src/gatt-database.c +index 0877b25..d4bf5ad 100644 +--- a/src/gatt-database.c ++++ b/src/gatt-database.c +@@ -2600,12 +2600,6 @@ struct btd_gatt_database *btd_gatt_database_new(struct btd_adapter *adapter) + database->profiles = queue_new(); + database->ccc_callbacks = queue_new(); + +- database->db_id = gatt_db_register(database->db, gatt_db_service_added, +- gatt_db_service_removed, +- database, NULL); +- if (!database->db_id) +- goto fail; +- + addr = btd_adapter_get_address(adapter); + database->le_io = bt_io_listen(connect_cb, NULL, NULL, NULL, &gerr, + BT_IO_OPT_SOURCE_BDADDR, addr, +@@ -2641,6 +2635,13 @@ struct btd_gatt_database *btd_gatt_database_new(struct btd_adapter *adapter) + + register_core_services(database); + ++ database->db_id = gatt_db_register(database->db, gatt_db_service_added, ++ gatt_db_service_removed, ++ database, NULL); ++ if (!database->db_id) ++ goto fail; ++ ++ + return database; + + fail: +-- +2.7.4 + diff --git a/bluez.spec b/bluez.spec index 815f202..afc4869 100644 --- a/bluez.spec +++ b/bluez.spec @@ -3,7 +3,7 @@ Name: bluez Summary: Bluetooth utilities Version: 5.43 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: Applications/System URL: http://www.bluez.org/ @@ -18,6 +18,7 @@ Patch2: 0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch Patch3: 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch Patch4: 0002-autopair-Don-t-handle-the-iCade.patch Patch5: 0004-agent-Assert-possible-infinite-loop.patch +Patch6: 0001-core-gatt-Don-t-register-attribute-handler-until-cor.patch BuildRequires: git BuildRequires: dbus-devel >= 1.6 @@ -179,6 +180,12 @@ sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' ${RPM_ %post hid2hci /sbin/udevadm trigger --subsystem-match=usb +%post obexd +%systemd_user_post obex.service + +%preun obexd +%systemd_user_preun obex.service + %files %{!?_licensedir:%global license %%doc} %license COPYING @@ -245,6 +252,10 @@ sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' ${RPM_ %{_userunitdir}/obex.service %changelog +* Fri Feb 3 2017 Don Zickus 5.43-3 +- Configure systemctl settings for bluez-obexd correctly +- Resolves rhbz#1259827 + * Thu Jan 12 2017 Igor Gnatenko - 5.43-2 - Rebuild for readline 7.x