bluez/bluez-5.50-sixaxis-fixes.patch
Bastien Nocera 3c5fd713ee + bluez-5.50-8
Backport loads of fixes from upstream, including:
  dbus-broker support (#1711594)
  a2dp codecs discovery
  discoverability filter support (used in gnome-bluetooth, #1583442)
  sixaxis pairing fixes
2019-06-07 09:10:08 +02:00

61 lines
1.9 KiB
Diff

From f12e00b5127589589d476817cb528d442c30b2c7 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 6 Jun 2019 18:42:42 +0200
Subject: [PATCH 1/2] sixaxis: Fix another problem with already setup devices
If the device went through any kind of pairing once, it might have been
set as trusted. Make sure to set the device as untrusted before starting
the cable pairing authorization so that we don't exit early from
process_auth_queue() (which considers trusted devices to be paired).
---
plugins/sixaxis.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c
index fed68d2d8..12638829b 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c
@@ -365,6 +365,7 @@ static bool setup_device(int fd, const char *sysfs_path,
btd_device_device_set_name(device, cp->name);
btd_device_set_pnpid(device, cp->source, cp->vid, cp->pid, cp->version);
+ btd_device_set_trusted(device, false);
btd_device_set_temporary(device, true);
closure = g_new0(struct authentication_closure, 1);
--
2.21.0
From 32f6e03823970796b7e08718fe28c76c96de32ac Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 6 Jun 2019 18:46:23 +0200
Subject: [PATCH 2/2] sixaxis: Throw an error when cable setup fails
If btd_request_authorization_cable_configured() fails, throw an error
and free resources.
---
plugins/sixaxis.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c
index 12638829b..939fed759 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c
@@ -384,6 +384,12 @@ static bool setup_device(int fd, const char *sysfs_path,
adapter_bdaddr, &device_bdaddr,
HID_UUID, agent_auth_cb, closure);
+ if (closure->auth_id == 0) {
+ error("sixaxis: could not request cable authorization");
+ auth_closure_destroy(closure, true);
+ return false;
+ }
+
g_hash_table_insert(pending_auths, closure->sysfs_path, closure);
return true;
--
2.21.0