diff options
author | Adrian Szyndela <adrian.s@samsung.com> | 2017-05-09 14:45:26 +0200 |
---|---|---|
committer | Hyotaek Shim <hyotaek.shim@samsung.com> | 2017-06-01 10:11:43 +0000 |
commit | 18fabb32c9b7c70592b6f94f80480048b42293c0 (patch) | |
tree | 066b3479c2d32e566ab10ed1144152d350f3c0f0 | |
parent | 86343daa55afd65116eb0786d2c8ff715643de59 (diff) | |
download | dbus-18fabb32c9b7c70592b6f94f80480048b42293c0.tar.gz dbus-18fabb32c9b7c70592b6f94f80480048b42293c0.tar.bz2 dbus-18fabb32c9b7c70592b6f94f80480048b42293c0.zip |
kdbus: bugfix for return codes on call to non-existing destination
Calling a method on non-existing destination with auto start disabled
caused error org.freedesktop.DBus.ServiceUnknown.
Non-kdbus implementation gives org.freedesktop.DBus.NameHasNoOwner.
This patch makes kdbus return the same error as non-kdbus implementation.
Change-Id: Iadbf060159e91d5c4e10ea9a26abb50d02154a5f
-rwxr-xr-x | dbus/dbus-transport-kdbus.c | 13 | ||||
-rw-r--r-- | packaging/dbus.spec | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/dbus/dbus-transport-kdbus.c b/dbus/dbus-transport-kdbus.c index a3e2dd7d..ba03f042 100755 --- a/dbus/dbus-transport-kdbus.c +++ b/dbus/dbus-transport-kdbus.c @@ -707,6 +707,7 @@ kdbus_write_msg_internal (DBusTransportKdbus *transport, unsigned fds_count; const char* header_data; DBusError error; + const char *destination_name = destination; dbus_uint64_t items_size; dbus_uint64_t flags = 0; @@ -923,9 +924,15 @@ kdbus_write_msg_internal (DBusTransportKdbus *transport, break; case DBUSPOLICY_RESULT_DEST_NOT_AVAILABLE: - reply = reply_with_error (DBUS_ERROR_SERVICE_UNKNOWN, NULL, - "Cannot send message - destination not known", - message); + _dbus_assert (destination_name != NULL); + if (dbus_message_get_auto_start (message)) + reply = reply_with_error (DBUS_ERROR_SERVICE_UNKNOWN, NULL, + "Cannot send message - destination not known", + message); + else + reply = reply_with_error (DBUS_ERROR_NAME_HAS_NO_OWNER, "Name \"%s\" does not exist", + destination_name, + message); break; case DBUSPOLICY_RESULT_KDBUS_ERROR: diff --git a/packaging/dbus.spec b/packaging/dbus.spec index ea0df828..2df3d1de 100644 --- a/packaging/dbus.spec +++ b/packaging/dbus.spec @@ -174,6 +174,8 @@ popd %if %{with_systemd} --enable-systemd \ %endif + --enable-kdbus-transport \ + --enable-libdbuspolicy \ --with-system-pid-file=/tmp/dbus_launch \ --with-console-auth-dir=/var/run/dbus/at_console/ \ --with-systemdsystemunitdir=%{_unitdir} \ |