summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-27 19:36:58 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-27 19:36:58 +0000
commitdff80b644fb16f97962773c384de44b13fbdee56 (patch)
tree76e733cb464b603d892e7e6e0f6c0fe28c4531f6
parent36dedff329b5ced8979a2161075e6a9d38c58785 (diff)
Fix authorization when experiemental is disabled.
-rw-r--r--hcid/dbus-service.c11
-rw-r--r--hcid/security.c4
2 files changed, 8 insertions, 7 deletions
diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c
index 18c9b68e..d07741a3 100644
--- a/hcid/dbus-service.c
+++ b/hcid/dbus-service.c
@@ -684,15 +684,11 @@ int service_req_auth(const bdaddr_t *src, const bdaddr_t *dst,
dst, active_conn_find_by_bdaddr))
return -ENOTCONN;
- ba2str(dst, address);
- device = adapter_find_device(adapter, address);
- if (!device)
- return -EPERM;
-
service = search_service_by_uuid(uuid);
if (!service)
return -EPERM;
+ ba2str(dst, address);
trusted = read_trust(src, address, GLOBAL_TRUST);
if (!trusted)
trusted = read_trust(BDADDR_ANY, address, service->ident);
@@ -702,6 +698,11 @@ int service_req_auth(const bdaddr_t *src, const bdaddr_t *dst,
return 0;
}
+ device = adapter_find_device(adapter, address);
+ if (!device)
+ return handle_authorize_request_old(service, adapter->path,
+ address, uuid, cb, user_data);
+
agent = (device->agent ? : adapter->agent);
if (!agent)
return handle_authorize_request_old(service, adapter->path,
diff --git a/hcid/security.c b/hcid/security.c
index 4047c9fa..0bfbcbec 100644
--- a/hcid/security.c
+++ b/hcid/security.c
@@ -289,8 +289,8 @@ static void link_key_request(int dev, bdaddr_t *sba, bdaddr_t *dba)
bacpy(&req.bdaddr, dba);
err = ioctl(dev, HCIGETAUTHINFO, (unsigned long) &req);
- if (err < 0)
- debug("HCIGETAUTHINFO failed (%d)",
+ if (err < 0 && errno != EINVAL)
+ debug("HCIGETAUTHINFO failed %s (%d)",
strerror(errno), errno);
else
req.type = 0x00;