From fbb20362e9dcaf11c03e5bf15c41c70aba269619 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 3 Dec 2008 14:58:09 +0200 Subject: Fix agent creation checks Allow the same process (D-Bus name) to own both the default (adapter specific) as well as a device specific agent. --- src/adapter.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/adapter.c') diff --git a/src/adapter.c b/src/adapter.c index b9bd74ab..865449c5 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -436,11 +436,20 @@ static struct bonding_request_info *bonding_request_new(DBusConnection *conn, device_get_address(device, &bdaddr); ba2str(&bdaddr, addr); + if (adapter->agent && + agent_matches(adapter->agent, name, agent_path)) { + error("Refusing adapter agent usage as device specific one"); + return NULL; + } + agent = agent_create(adapter, name, agent_path, capability, device_agent_removed, device); + if (!agent) + debug("agent_create failed"); + device_set_agent(device, agent); debug("Temporary agent registered for hci%d/%s at %s:%s", -- cgit