summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnita Zhang <the.anitazha@gmail.com>2021-03-03 17:25:40 -0800
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-12 17:35:57 +0100
commit4649b044d05f217bd756639161e6f7955a1c7f6b (patch)
treed278faf6803e8920c1073794fcf5b2a968c2f4f0
parentb29181eaa50a0fd9cefc4bcfbd0e6949038b65c9 (diff)
downloadsystemd-4649b044d05f217bd756639161e6f7955a1c7f6b.tar.gz
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)
-rw-r--r--src/run/run.c2
1 files changed, 1 insertions, 1 deletions
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.",