summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2013-03-22 09:36:22 -0400
committerLennart Poettering <lennart@poettering.net>2013-03-22 23:37:11 +0100
commita5a5ade34c142c42e584aa19ee92de6d3e1994c3 (patch)
tree56a5c09f023c486ae8d74b262a82eab9316eb18d /src
parent356ce9915ab1a4a1e6dc26954df34936a69e7c12 (diff)
dbus: Do send out "replies" to signals
Some parts of systemd (at least the DBus activation codepath) "reply" to signals, which of course have the no-reply flag set. We will be defensive here and still send out a reply if we're passed a signal. Regression introduced by: c6a818c82035da91e Reported-by: Mantas Mikulėnas <grawity@gmail.com> Tested-by: Mantas Mikulėnas <grawity@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/shared/dbus-common.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/shared/dbus-common.c b/src/shared/dbus-common.c
index 2769b2c882..0e38933d8a 100644
--- a/src/shared/dbus-common.c
+++ b/src/shared/dbus-common.c
@@ -717,9 +717,14 @@ dbus_bool_t bus_maybe_send_reply (DBusConnection *c,
DBusMessage *message,
DBusMessage *reply)
{
- if (dbus_message_get_no_reply (message))
+ /* Some parts of systemd "reply" to signals, which of course
+ * have the no-reply flag set. We will be defensive here and
+ * still send out a reply if we're passed a signal.
+ */
+ if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL &&
+ dbus_message_get_no_reply(message))
return TRUE;
- return dbus_connection_send (c, reply, NULL);
+ return dbus_connection_send(c, reply, NULL);
}
DBusHandlerResult bus_send_error_reply(DBusConnection *c, DBusMessage *message, DBusError *berror, int error) {