diff options
-rw-r--r-- | hcid/auth-agent.c | 32 | ||||
-rw-r--r-- | hcid/passkey-agent.c | 32 |
2 files changed, 64 insertions, 0 deletions
diff --git a/hcid/auth-agent.c b/hcid/auth-agent.c index c0ab46c5..6ca07ff1 100644 --- a/hcid/auth-agent.c +++ b/hcid/auth-agent.c @@ -100,12 +100,30 @@ static DBusHandlerResult authorize_message(DBusConnection *conn, static DBusHandlerResult cancel_message(DBusConnection *conn, DBusMessage *msg, void *data) { + DBusMessage *reply; + + reply = dbus_message_new_method_return(msg); + if (!reply) { + fprintf(stderr, "Can't create reply message\n"); + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + + dbus_message_append_args(reply, DBUS_TYPE_INVALID); + + dbus_connection_send(conn, reply, NULL); + + dbus_connection_flush(conn); + + dbus_message_unref(reply); + return DBUS_HANDLER_RESULT_HANDLED; } static DBusHandlerResult release_message(DBusConnection *conn, DBusMessage *msg, void *data) { + DBusMessage *reply; + if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) { fprintf(stderr, "Invalid arguments for Release method"); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; @@ -116,6 +134,20 @@ static DBusHandlerResult release_message(DBusConnection *conn, __io_terminated = 1; + reply = dbus_message_new_method_return(msg); + if (!reply) { + fprintf(stderr, "Can't create reply message\n"); + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + + dbus_message_append_args(reply, DBUS_TYPE_INVALID); + + dbus_connection_send(conn, reply, NULL); + + dbus_connection_flush(conn); + + dbus_message_unref(reply); + return DBUS_HANDLER_RESULT_HANDLED; } diff --git a/hcid/passkey-agent.c b/hcid/passkey-agent.c index 29706310..731f6611 100644 --- a/hcid/passkey-agent.c +++ b/hcid/passkey-agent.c @@ -146,12 +146,30 @@ static DBusHandlerResult confirm_message(DBusConnection *conn, static DBusHandlerResult cancel_message(DBusConnection *conn, DBusMessage *msg, void *data) { + DBusMessage *reply; + + reply = dbus_message_new_method_return(msg); + if (!reply) { + fprintf(stderr, "Can't create reply message\n"); + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + + dbus_message_append_args(reply, DBUS_TYPE_INVALID); + + dbus_connection_send(conn, reply, NULL); + + dbus_connection_flush(conn); + + dbus_message_unref(reply); + return DBUS_HANDLER_RESULT_HANDLED; } static DBusHandlerResult release_message(DBusConnection *conn, DBusMessage *msg, void *data) { + DBusMessage *reply; + if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) { fprintf(stderr, "Invalid arguments for passkey Release method"); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; @@ -162,6 +180,20 @@ static DBusHandlerResult release_message(DBusConnection *conn, __io_terminated = 1; + reply = dbus_message_new_method_return(msg); + if (!reply) { + fprintf(stderr, "Can't create reply message\n"); + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + + dbus_message_append_args(reply, DBUS_TYPE_INVALID); + + dbus_connection_send(conn, reply, NULL); + + dbus_connection_flush(conn); + + dbus_message_unref(reply); + return DBUS_HANDLER_RESULT_HANDLED; } |