From e3861d18bbc9777336ec771042ecee86f5f5ba94 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 10 Jan 2018 15:01:33 +0000 Subject: [PATCH 3/6] bus driver: Omit container type, name from GetConnectionCredentials On the session bus, the container type and name might be uncontroversial, but on the system bus, it's questionable how far they can be trusted: they're supplied by the initiator of the per-container server, so we only have their word for it. While we think about what to do about this, remove them, leaving only the instance (which can be used to look up the rest). Signed-off-by: Simon McVittie --- bus/driver.c | 10 ++-------- doc/dbus-specification.xml | 26 -------------------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/bus/driver.c b/bus/driver.c index eff448d2..eabc7acc 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -1915,10 +1915,8 @@ 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); @@ -2007,15 +2005,11 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection, } if (found == BUS_DRIVER_FOUND_PEER && - bus_containers_connection_is_contained (conn, &path, &type, &name)) + bus_containers_connection_is_contained (conn, &path, NULL, NULL)) { 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)) + path)) goto oom; } diff --git a/doc/dbus-specification.xml b/doc/dbus-specification.xml index 246c0595..d7d2b629 100644 --- a/doc/dbus-specification.xml +++ b/doc/dbus-specification.xml @@ -6688,32 +6688,6 @@ - - org.freedesktop.DBus.Containers1.Type - STRING - - The container technology that created the container - instance, as passed to AddServer. - Omitted from the dictionary if this connection is not - via a container's server. For example, a typical value - for a Flatpak application would be - org.flatpak. - - - - - org.freedesktop.DBus.Containers1.Name - STRING - - The contained app name for the container instance, - as passed to AddServer. Omitted - from the dictionary if this connection is not via a - container's server. For example, a typical value for - a Flatpak application would be - org.gnome.Weather. - - - -- 2.15.1