From f2c49c86582300e5fadc0297b29230d4caa1d8fa Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 23 Nov 2017 20:02:00 +0100 Subject: [PATCH] core: refuse accepting a scope controller unless we are called on the API bus Let's make sure clients get early errors if they try something weird. --- src/core/dbus-scope.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/dbus-scope.c b/src/core/dbus-scope.c index 2d5baab..46222ef 100644 --- a/src/core/dbus-scope.c +++ b/src/core/dbus-scope.c @@ -119,6 +119,11 @@ static int bus_scope_set_transient_property( const char *controller; char *c; + /* We can't support direct connections with this, as direct connections know no service or unique name + * concept, but the Controller field stores exactly that. */ + if (sd_bus_message_get_bus(message) != UNIT(s)->manager->api_bus) + return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Sorry, Controller= logic only supported via the bus."); + r = sd_bus_message_read(message, "s", &controller); if (r < 0) return r; -- 2.7.4