]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
crypt: escape backslashes for systemd unit names b/c udev/initqueue/bash
authorHarald Hoyer <harald@redhat.com>
Thu, 11 Jan 2018 10:39:44 +0000 (11:39 +0100)
committerHarald Hoyer <harald@redhat.com>
Thu, 11 Jan 2018 10:42:22 +0000 (11:42 +0100)
otherwise
luks\x2d25e41d19\x2d1580\x2d4e7c\x2d8875\x2d134045008f33
turns to
luksx2d25e41d19x2d1580x2d4e7cx2d8875x2d134045008f33

modules.d/90crypt/parse-crypt.sh

index f0a4fba967c04529d4c08bfd5bc3add98f6ed966..ea6802e8b7ece7466cccdcea081919bf20f9acd5 100755 (executable)
@@ -64,6 +64,8 @@ else
                 } >> /etc/udev/rules.d/70-luks.rules.new
             else
                 luksname=$(dev_unit_name "$luksname")
+                luksname="$(str_replace "$luksname" '\' '\\')"
+
                 if ! crypttab_contains "$serialid"; then
                     {
                         printf -- 'ENV{ID_SERIAL_SHORT}=="*%s*", ' "$serialid"
@@ -95,6 +97,8 @@ else
                 } >> /etc/udev/rules.d/70-luks.rules.new
             else
                 luksname=$(dev_unit_name "$luksname")
+                luksname="$(str_replace "$luksname" '\' '\\')"
+
                 if ! crypttab_contains "$luksid"; then
                     {
                         printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '