From: Yu Watanabe Date: Mon, 14 Jun 2021 18:04:06 +0000 (+0900) Subject: core/service: fix assertion when Type=dbus but BusName= is not specified X-Git-Tag: v249-rc1~13^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f97b7c338bb7440572c454558efb8fee395896a;p=thirdparty%2Fsystemd.git core/service: fix assertion when Type=dbus but BusName= is not specified Fixes #19920. --- diff --git a/src/core/service.c b/src/core/service.c index 792ec99a00b..af5a2decf11 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -668,7 +668,8 @@ static int service_setup_bus_name(Service *s) { assert(s); - if (s->type != SERVICE_DBUS) + /* If s->bus_name is not set, then the unit will be refused by service_verify() later. */ + if (s->type != SERVICE_DBUS || !s->bus_name) return 0; r = unit_add_dependency_by_name(UNIT(s), UNIT_REQUIRES, SPECIAL_DBUS_SOCKET, true, UNIT_DEPENDENCY_FILE);