summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-security.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2006-12-04 12:53:58 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2006-12-04 12:53:58 +0000
commit4433fb72329624961794513b257fc9a8988b1067 (patch)
tree01b04559e6ec10442b8b12fb69229b51b67bebbe /hcid/dbus-security.c
parent225ca66857cfd4186a2651b60886e5ffe04fd3c2 (diff)
Truested devices:changed error names and integration with AuthorizeService
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);