]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
run: update dbus unique names check
authorAnita Zhang <the.anitazha@gmail.com>
Thu, 4 Mar 2021 01:25:40 +0000 (17:25 -0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 4 Mar 2021 09:52:13 +0000 (09:52 +0000)
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.

src/run/run.c

index 11166d2e78bafd16789a4e10b05e0e706aad7bac..8c036857cf21747a3dd7deec0509ddcffe889386 100644 (file)
@@ -959,7 +959,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.",