From 098cd10838193272c669348c5ffd0410218e1bcc Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 1 May 2008 01:05:46 +0000 Subject: fixed service authorization --- hcid/plugin.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'hcid/plugin.c') diff --git a/hcid/plugin.c b/hcid/plugin.c index 7d275786..6cc54de1 100644 --- a/hcid/plugin.c +++ b/hcid/plugin.c @@ -38,6 +38,7 @@ #include #include "dbus-helper.h" +#include "dbus-service.h" #include "adapter.h" #include "dbus-hci.h" #include "agent.h" @@ -210,18 +211,15 @@ int plugin_req_auth(bdaddr_t *src, bdaddr_t *dst, dst, active_conn_find_by_bdaddr)) return -ENOTCONN; - /* FIXME: Is there a plugin that exports this service? */ - ba2str(dst, address); device = adapter_find_device(adapter, address); if (!device) return -EPERM; - /* - * FIXME: Trusted device? Currently, service are based on a friendly - * name, it is necessary convert UUID128 to friendly name or store the - * UUID128 in the trusted file. - */ + if (!search_service_by_uuid(uuid)) + return -EPERM; + + /* FIXME: Missing check trusted file entries */ agent = (device->agent ? : adapter->agent); if (!agent) -- cgit