summaryrefslogtreecommitdiffstats
path: root/src/nspawn/nspawn-register.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-03-21 15:26:47 +0100
committerLennart Poettering <lennart@poettering.net>2018-03-21 15:26:47 +0100
commit37cbc1d57992f49b3607bd66973dd30e0a8d1073 (patch)
tree495e940367f2cf5534c43b14af602c344969accf /src/nspawn/nspawn-register.c
parentMerge pull request #8523 from keszybz/oss-fuzz-fixes (diff)
downloadsystemd-37cbc1d57992f49b3607bd66973dd30e0a8d1073.tar.xz
systemd-37cbc1d57992f49b3607bd66973dd30e0a8d1073.zip
When mangling names, optionally emit a warning (#8400)
The warning is not emitted for absolute paths like /dev/sda or /home, which are converted to .device and .mount unit names without any fuss. Most of the time it's unlikely that users use invalid unit names on purpose, so let's warn them. Warnings are silenced when --quiet is used. $ build/systemctl show -p Id hello@foo-bar/baz Invalid unit name "hello@foo-bar/baz" was escaped as "hello@foo-bar-baz" (maybe you should use systemd-escape?) Id=hello@foo-bar-baz.service $ build/systemd-run --user --slice foo-bar/baz --unit foo-bar/foo true Invalid unit name "foo-bar/foo" was escaped as "foo-bar-foo" (maybe you should use systemd-escape?) Invalid unit name "foo-bar/baz" was escaped as "foo-bar-baz" (maybe you should use systemd-escape?) Running as unit: foo-bar-foo.service Fixes #8302.
Diffstat (limited to 'src/nspawn/nspawn-register.c')
-rw-r--r--src/nspawn/nspawn-register.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nspawn/nspawn-register.c b/src/nspawn/nspawn-register.c
index 07d68242c6..838634b624 100644
--- a/src/nspawn/nspawn-register.c
+++ b/src/nspawn/nspawn-register.c
@@ -293,7 +293,7 @@ int allocate_scope(
if (r < 0)
return log_error_errno(r, "Could not watch job: %m");
- r = unit_name_mangle_with_suffix(machine_name, UNIT_NAME_NOGLOB, ".scope", &scope);
+ r = unit_name_mangle_with_suffix(machine_name, 0, ".scope", &scope);
if (r < 0)
return log_error_errno(r, "Failed to mangle scope name: %m");