summaryrefslogtreecommitdiffstats
path: root/hcid/auth-agent.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/auth-agent.c')
-rw-r--r--hcid/auth-agent.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/hcid/auth-agent.c b/hcid/auth-agent.c
index dab97f7c..1b721398 100644
--- a/hcid/auth-agent.c
+++ b/hcid/auth-agent.c
@@ -72,20 +72,24 @@ static DBusHandlerResult authorize_message(DBusConnection *conn,
DBusMessage *msg, void *data)
{
DBusMessage *reply;
+ const char *adapter, *address, *service, *string;
- if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) {
- fprintf(stderr, "Invalid arguments for Authorize method");
+ if (!dbus_message_get_args(msg, NULL,
+ DBUS_TYPE_STRING, &adapter, DBUS_TYPE_STRING, &address,
+ DBUS_TYPE_STRING, &service, DBUS_TYPE_STRING, &string,
+ DBUS_TYPE_INVALID)) {
+ fprintf(stderr, "Invalid arguments for passkey Confirm method");
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
+ printf("Authorization request for device %s\n", address);
+
reply = dbus_message_new_method_return(msg);
if (!reply) {
fprintf(stderr, "Can't create reply message\n");
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
}
- dbus_message_append_args(reply, DBUS_TYPE_INVALID);
-
dbus_connection_send(conn, reply, NULL);
dbus_connection_flush(conn);
@@ -99,15 +103,24 @@ static DBusHandlerResult cancel_message(DBusConnection *conn,
DBusMessage *msg, void *data)
{
DBusMessage *reply;
+ const char *adapter, *address, *service, *string;
+
+ if (!dbus_message_get_args(msg, NULL,
+ DBUS_TYPE_STRING, &adapter, DBUS_TYPE_STRING, &address,
+ DBUS_TYPE_STRING, &service, DBUS_TYPE_STRING, &string,
+ DBUS_TYPE_INVALID)) {
+ fprintf(stderr, "Invalid arguments for passkey Confirm method");
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ }
+
+ printf("Request canceled for device %s\n", address);
reply = dbus_message_new_method_return(msg);
if (!reply) {
fprintf(stderr, "Can't create reply message\n");
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
}
- dbus_message_append_args(reply, DBUS_TYPE_INVALID);
-
dbus_connection_send(conn, reply, NULL);
dbus_connection_flush(conn);
@@ -135,11 +148,9 @@ static DBusHandlerResult release_message(DBusConnection *conn,
reply = dbus_message_new_method_return(msg);
if (!reply) {
fprintf(stderr, "Can't create reply message\n");
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
}
- dbus_message_append_args(reply, DBUS_TYPE_INVALID);
-
dbus_connection_send(conn, reply, NULL);
dbus_connection_flush(conn);