systemd-logind: filter out non-signal messages from message filter

It's possible to receive a message reply in the message filter if a
previous message call timed out locally before the reply arrived.

The message_filter function only handles signals, at the moment, and
does not properly handle message replies.

This commit changes the message_filter function to filter out all
non-signal messages, including spurious message replies.

Downstream-bug: https://bugzilla.redhat.com/show_bug.cgi?id=1209347
Signed-off-by: Ray Strode <rstrode@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Ray Strode 2015-04-16 11:28:15 -04:00 committed by Keith Packard
parent 41932dfbc8
commit 792e925167
1 changed files with 3 additions and 0 deletions

View File

@ -313,6 +313,9 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data)
dbus_int32_t major, minor;
char *pause_str;
if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_SIGNAL)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
dbus_error_init(&error);
if (dbus_message_is_signal(message,