From: Lennart Poettering Date: Thu, 23 Nov 2017 19:02:00 +0000 (+0100) Subject: core: refuse accepting a scope controller unless we are called on the API bus X-Git-Tag: v236~123^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2c49c86582300e5fadc0297b29230d4caa1d8fa;p=platform%2Fupstream%2Fsystemd.git 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. --- 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;