diff options
author | Simon McVittie <smcv@collabora.com> | 2017-06-09 15:58:56 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2017-12-11 16:04:56 +0000 |
commit | 2d53dc985229c408c74b944e139fa6ee34dc9a11 (patch) | |
tree | 01fc4e8e41edd805782d68d552642baffe068baa | |
parent | 36fa7d786aea0af59b9c19de5f667411568c6ae8 (diff) |
bus/driver: Add basic container info to GetConnectionCredentials()
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354
-rw-r--r-- | bus/driver.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bus/driver.c b/bus/driver.c index cef1e862..ff14ccab 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -1915,7 +1915,10 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection, DBusMessageIter array_iter; unsigned long ulong_uid, ulong_pid; char *s; + const char *name; + const char *path; const char *service; + const char *type; BusDriverFound found; _DBUS_ASSERT_ERROR_IS_CLEAR (error); @@ -2003,6 +2006,19 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection, dbus_free (s); } + if (found == BUS_DRIVER_FOUND_PEER && + bus_containers_connection_is_contained (conn, &path, &type, &name)) + { + if (!_dbus_asv_add_object_path (&array_iter, + DBUS_INTERFACE_CONTAINERS1 ".Instance", + path) || + !_dbus_asv_add_string (&array_iter, + DBUS_INTERFACE_CONTAINERS1 ".Type", type) || + !_dbus_asv_add_string (&array_iter, + DBUS_INTERFACE_CONTAINERS1 ".Name", name)) + goto oom; + } + if (!_dbus_asv_close (&reply_iter, &array_iter)) goto oom; |