]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/install: Preserve escape characters for escaped unit names
authorDavid Michael <dm0@redhat.com>
Wed, 20 Mar 2019 15:14:32 +0000 (15:14 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 20 Mar 2019 17:26:24 +0000 (18:26 +0100)
Since switching to extract_first_word with no flags for parsing
unit names in 4c9565eea534cd233a913c8c21f7920dba229743, escape
characters will be stripped from escaped unit names such as
"mnt-persistent\x2dvolume.mount" resulting in the unit not being
configured as defined.  Preserve escape characters again for
compatibility with existing preset definitions.

src/shared/install.c

index 64d55532e299f4e19a4278162b94d46739be21bc..9a9d4bfa210220a58b88d4cad6c15623d50025ab 100644 (file)
@@ -2797,7 +2797,7 @@ static int split_pattern_into_name_and_instances(const char *pattern, char **out
         assert(out_instances);
         assert(out_unit_name);
 
-        r = extract_first_word(&pattern, &unit_name, NULL, 0);
+        r = extract_first_word(&pattern, &unit_name, NULL, EXTRACT_RETAIN_ESCAPE);
         if (r < 0)
                 return r;