From 4649b044d05f217bd756639161e6f7955a1c7f6b Mon Sep 17 00:00:00 2001 From: Anita Zhang Date: Wed, 3 Mar 2021 17:25:40 -0800 Subject: [PATCH] run: update dbus unique names check Some code in systemd-run checks that a bus's unique name must start with `:1.`. However the dbus specification on unique connection names only specifies that it must begin with a colon. And the freedesktop/dbus implementation allows allows unique names to go up to `:INT_MAX.INT_MAX`. So update the current check to only look for a colon at the beginning. (cherry picked from commit 01584bf9e43db1dfb7ea4ba628f533b3066e81cc) --- src/run/run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/run/run.c b/src/run/run.c index b4cc6fe7f8..1960158db1 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -958,7 +958,7 @@ static int make_unit_name(sd_bus *bus, UnitType t, char **ret) { /* We managed to get the unique name, then let's use that to * name our transient units. */ - id = startswith(unique, ":1."); + id = startswith(unique, ":"); if (!id) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Unique name %s has unexpected format.", -- 2.25.1