[systemd-devel] [PATCH] systemctl: don't mangle name when it is a path

Lukas Nykryn lnykryn at redhat.com
Mon Oct 15 05:51:27 PDT 2012


systemctl enable, disable, ... can also accept full path and in this case
we don't need to alter it (rhbz#866346).
---
 src/systemctl/systemctl.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index d1fbb78..4576bbf 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3594,7 +3594,10 @@ static int mangle_names(char **original_names, char ***mangled_names) {
 
         i = l;
         STRV_FOREACH(name, original_names) {
-                *i = unit_name_mangle(*name);
+                if(is_path(*name))
+                        *i = strdup(*name);
+                else
+                        *i = unit_name_mangle(*name);
                 if (!*i) {
                         strv_free(l);
                         return log_oom();
-- 
1.7.6.5



More information about the systemd-devel mailing list