From ed5d21a3e977fbb48a61ee48ef6edd14bc28aeff Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 6 Jan 2009 15:37:57 -0500 Subject: SBUS messages with no reply (or no immediate reply) would incorrectly report DBUS_HANDLER_NOT_YET_HANDLED. This would cause SBUS to report NOT_IMPLEMENTED to the calling function. The message_handler will now check the return code of the method call to determine which reply to send, instead of relying on the presence of a reply message. --- server/sbus/sssd_dbus_connection.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/sbus/sssd_dbus_connection.c b/server/sbus/sssd_dbus_connection.c index 497f5010c..33f751bd0 100644 --- a/server/sbus/sssd_dbus_connection.c +++ b/server/sbus/sssd_dbus_connection.c @@ -507,7 +507,7 @@ DBusHandlerResult sbus_message_handler(DBusConnection *conn, for (i = 0; ctx->method_ctx->methods[i].method != NULL; i++) { if (strcmp(method, ctx->method_ctx->methods[i].method) == 0) { ret = ctx->method_ctx->methods[i].fn(message, ctx, &reply); - /* FIXME: check error */ + if (ret != EOK) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; break; } } @@ -521,8 +521,7 @@ DBusHandlerResult sbus_message_handler(DBusConnection *conn, dbus_message_unref(reply); } - return reply ? DBUS_HANDLER_RESULT_HANDLED : - DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + return DBUS_HANDLER_RESULT_HANDLED; } /* Adds a new D-BUS path message handler to the connection -- cgit