naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
698723
From 91ed691ff73d4d71fae8f6896a1bba73e6a76bba Mon Sep 17 00:00:00 2001
698723
From: David Michael <dm0@redhat.com>
698723
Date: Wed, 20 Mar 2019 15:14:32 +0000
698723
Subject: [PATCH] shared/install: Preserve escape characters for escaped unit
698723
 names
698723
698723
Since switching to extract_first_word with no flags for parsing
698723
unit names in 4c9565eea534cd233a913c8c21f7920dba229743, escape
698723
characters will be stripped from escaped unit names such as
698723
"mnt-persistent\x2dvolume.mount" resulting in the unit not being
698723
configured as defined.  Preserve escape characters again for
698723
compatibility with existing preset definitions.
698723
698723
(cherry picked from commit 82bd4da71e9cdd5a2e9266332f5a7399845e31f6)
698723
698723
Resolves: #1952686
698723
---
698723
 src/shared/install.c | 2 +-
698723
 1 file changed, 1 insertion(+), 1 deletion(-)
698723
698723
diff --git a/src/shared/install.c b/src/shared/install.c
698723
index c2847df3f8..c9fef6bde2 100644
698723
--- a/src/shared/install.c
698723
+++ b/src/shared/install.c
698723
@@ -2774,7 +2774,7 @@ static int split_pattern_into_name_and_instances(const char *pattern, char **out
698723
         assert(out_instances);
698723
         assert(out_unit_name);
698723
 
698723
-        r = extract_first_word(&pattern, &unit_name, NULL, 0);
698723
+        r = extract_first_word(&pattern, &unit_name, NULL, EXTRACT_RETAIN_ESCAPE);
698723
         if (r < 0)
698723
                 return r;
698723