summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2015-11-14 16:32:37 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-11-17 18:21:10 +0000
commit4f116d786539b2f1613d88532f989970f3349c69 (patch)
treeac9b5a4d04a89d86eae1694069463a76e2867594
parent32f966b9086e39c0dfaa80a87e739d2b9b4f869a (diff)
downloaddbus-4f116d786539b2f1613d88532f989970f3349c69.tar.gz
bus_driver_handle_update_activation_environment: Error on system buses
The default policy already disallows calls on system buses. Since any bus with a service helper cleans the environment anyway, there's no point in allowing this to be called. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--bus/driver.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/bus/driver.c b/bus/driver.c
index 852ac536..a59d5329 100644
--- a/bus/driver.c
+++ b/bus/driver.c
@@ -986,6 +986,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection,
{
dbus_bool_t retval;
BusActivation *activation;
+ BusContext *context;
DBusMessageIter iter;
DBusMessageIter dict_iter;
DBusMessageIter dict_entry_iter;
@@ -1011,6 +1012,16 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection,
}
#endif
+ context = bus_connection_get_context (connection);
+
+ if (bus_context_get_servicehelper (context) != NULL)
+ {
+ dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
+ "Cannot change activation environment "
+ "on a system bus.");
+ return FALSE;
+ }
+
activation = bus_connection_get_activation (connection);
dbus_message_iter_init (message, &iter);