]> 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)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 12 Mar 2021 16:35:57 +0000 (17:35 +0100)
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

index b4cc6fe7f84076f8bee1869074316c9af67c50ad..1960158db154f21af1cae4f7dad4217fd065e862 100644 (file)
@@ -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.",