From e1a0779f9e09f4620fdbb977f9e0a67caafdc5f3 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 15 Jan 2007 17:06:27 +0000 Subject: Preliminary support for executing a service when Start is called --- hcid/dbus-manager.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'hcid/dbus-manager.c') diff --git a/hcid/dbus-manager.c b/hcid/dbus-manager.c index 9418f9ab..524b7d14 100644 --- a/hcid/dbus-manager.c +++ b/hcid/dbus-manager.c @@ -272,7 +272,7 @@ static DBusHandlerResult add_service_record(DBusConnection *conn, return error_invalid_arguments(conn, msg); } - if (!service || strcmp(dbus_message_get_sender(msg), service->id)) + if (!service || strcmp(dbus_message_get_sender(msg), service->bus_name)) return error_not_authorized(conn, msg); dbus_message_iter_next(&iter); @@ -296,7 +296,7 @@ static DBusHandlerResult add_service_record(DBusConnection *conn, /* Assign a new handle */ rec->ext_handle = next_handle++; - if (service->id) { + if (service->bus_name) { uint32_t handle = 0; if (register_sdp_record(rec->buf->data, rec->buf->data_size, &handle) < 0) { @@ -350,7 +350,7 @@ static DBusHandlerResult add_service_record_xml(DBusConnection *conn, return error_invalid_arguments(conn, msg); } - if (!service || strcmp(dbus_message_get_sender(msg), service->id)) + if (!service || strcmp(dbus_message_get_sender(msg), service->bus_name)) return error_not_authorized(conn, msg); reply = dbus_message_new_method_return(msg); @@ -397,7 +397,7 @@ static DBusHandlerResult add_service_record_xml(DBusConnection *conn, /* Assign a new handle */ rec->ext_handle = next_handle++; - if (service->id) { + if (service->bus_name) { uint32_t handle = 0; if (register_sdp_record(rec->buf->data, rec->buf->data_size, &handle) < 0) { @@ -450,7 +450,7 @@ static DBusHandlerResult remove_service_record(DBusConnection *conn, return error_invalid_arguments(conn, msg); } - if (!service || strcmp(dbus_message_get_sender(msg), service->id)) + if (!service || strcmp(dbus_message_get_sender(msg), service->bus_name)) return error_not_authorized(conn, msg); @@ -466,7 +466,7 @@ static DBusHandlerResult remove_service_record(DBusConnection *conn, service->records = g_slist_remove(service->records, rec); /* If the service is running: remove it from the from sdpd */ - if (service->id && rec->handle != 0xffffffff) { + if (service->bus_name && rec->handle != 0xffffffff) { if (unregister_sdp_record(rec->handle) < 0) { error("Service record unregistration failed: %s (%d)", strerror(errno), errno); -- cgit