summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-security.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/dbus-security.c')
-rw-r--r--hcid/dbus-security.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hcid/dbus-security.c b/hcid/dbus-security.c
index 0fe55dd2..cd70616b 100644
--- a/hcid/dbus-security.c
+++ b/hcid/dbus-security.c
@@ -761,6 +761,7 @@ static DBusHandlerResult authorize_service(DBusConnection *conn,
{
const char *service_path, *adapter_path, *address, *action;
struct service_agent *sagent;
+ struct slist *l;
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_STRING, &service_path,
@@ -783,6 +784,12 @@ static DBusHandlerResult authorize_service(DBusConnection *conn,
if (strcmp(dbus_message_get_sender(msg), sagent->id))
return error_rejected(conn, msg);
+ /* Check it is a trusted device */
+ l = slist_find(sagent->trusted_devices, address, (cmp_func_t) strcasecmp);
+ if (l)
+ return send_message_and_unref(conn,
+ dbus_message_new_method_return(msg));
+
if (!default_auth_agent)
return error_auth_agent_does_not_exist(conn, msg);