chiark / gitweb /
systemctl: don't mangle name when it is a path
authorLukas Nykryn <lnykryn@redhat.com>
Mon, 15 Oct 2012 12:51:27 +0000 (14:51 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 15 Oct 2012 14:34:23 +0000 (16:34 +0200)
systemctl enable, disable, ... can also accept full path and in this case
we don't need to alter it.

https://bugzilla.redhat.com/show_bug.cgi?id=866346

src/systemctl/systemctl.c

index d1fbb78..7d6a6a2 100644 (file)
@@ -3594,7 +3594,15 @@ static int mangle_names(char **original_names, char ***mangled_names) {
 
         i = l;
         STRV_FOREACH(name, original_names) {
-                *i = unit_name_mangle(*name);
+
+                /* When enabling units qualified path names are OK,
+                 * too, hence allow them explicitly. */
+
+                if (is_path(*name))
+                        *i = strdup(*name);
+                else
+                        *i = unit_name_mangle(*name);
+
                 if (!*i) {
                         strv_free(l);
                         return log_oom();