]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
crypt: change /tmp/luks.keys seperator from "|" to ":"
authorHarald Hoyer <harald@redhat.com>
Fri, 12 Nov 2010 13:11:33 +0000 (14:11 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 12 Nov 2010 13:11:33 +0000 (14:11 +0100)
Do it like on the kernel command line, so we only have one forbidden
character.

modules.d/90crypt/crypt-lib.sh
modules.d/90crypt/cryptroot-ask.sh
modules.d/90crypt/probe-keydev.sh

index eee60fb290d203ed0e9b1d203362f63149ff1553..9083acaad75faa042ca1035de2cff0f34fd097dc 100644 (file)
@@ -95,12 +95,12 @@ $dev
 #
 # Reads file <keysfile> produced by probe-keydev and looks for first line to
 # which device <for_dev> matches.  The successful result is printed in format
-# "<keydev>|<keypath>".  When nothing found, just false is returned.
+# "<keydev>:<keypath>".  When nothing found, just false is returned.
 #
 # Example:
 #   getkey /tmp/luks.keys /dev/sdb1
 # May print:
-#   /dev/sdc1|/keys/some.key
+#   /dev/sdc1:/keys/some.key
 getkey() {
     local keys_file="$1"; local for_dev="$2"
     local luks_dev; local key_dev; local key_path
@@ -108,9 +108,9 @@ getkey() {
     [ -z "$keys_file" -o -z "$for_dev" ] && die 'getkey: wrong usage!'
     [ -f "$keys_file" ] || return 1
 
-    while IFS='|' read luks_dev key_dev key_path; do
+    while IFS=':' read luks_dev key_dev key_path; do
         if match_dev "$luks_dev" "$for_dev"; then
-            echo "${key_dev}|${key_path}"
+            echo "${key_dev}:${key_path}"
             return 0
         fi
     done < "$keys_file"
index bb8e81eed2813d05f962f1561020c08e7d9665e9..5150688d5ff2175866a590908cb8fb88fc3f98ec 100755 (executable)
@@ -62,8 +62,8 @@ info "luksOpen $device $luksname"
 
 if [ -n "$(getarg rd.luks.key)" ]; then
     if tmp=$(getkey /tmp/luks.keys $device); then
-        keydev="${tmp%%|*}"
-        keypath="${tmp#*|}"
+        keydev="${tmp%%:*}"
+        keypath="${tmp#*:}"
     else
         info "No key found for $device.  Will try later."
         /sbin/initqueue --unique --onetime --settled \
index 8fdbc1a3541afc9afec80f81ec1a94ce81f76028..04a0e096117192362f968dd72ed9457c539a3089 100755 (executable)
@@ -12,4 +12,4 @@ info "Probing $real_keydev for $keypath..."
 test_dev -f "$real_keydev" "$keypath" || exit 1
 
 info "Found $keypath on $real_keydev"
-echo "$luksdev|$real_keydev|$keypath" >> /tmp/luks.keys
+echo "$luksdev:$real_keydev:$keypath" >> /tmp/luks.keys