teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0580-shared-install-Preserve-escape-characters-for-escape.patch

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