From: Harald Hoyer Date: Fri, 12 Nov 2010 13:11:33 +0000 (+0100) Subject: crypt: change /tmp/luks.keys seperator from "|" to ":" X-Git-Tag: 008~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91f4d45f93f067ac3de3d38c62bed84e5075932d;p=thirdparty%2Fdracut.git crypt: change /tmp/luks.keys seperator from "|" to ":" Do it like on the kernel command line, so we only have one forbidden character. --- diff --git a/modules.d/90crypt/crypt-lib.sh b/modules.d/90crypt/crypt-lib.sh index eee60fb29..9083acaad 100644 --- a/modules.d/90crypt/crypt-lib.sh +++ b/modules.d/90crypt/crypt-lib.sh @@ -95,12 +95,12 @@ $dev # # Reads file produced by probe-keydev and looks for first line to # which device matches. The successful result is printed in format -# "|". When nothing found, just false is returned. +# ":". 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" diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh index bb8e81eed..5150688d5 100755 --- a/modules.d/90crypt/cryptroot-ask.sh +++ b/modules.d/90crypt/cryptroot-ask.sh @@ -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 \ diff --git a/modules.d/90crypt/probe-keydev.sh b/modules.d/90crypt/probe-keydev.sh index 8fdbc1a35..04a0e0961 100755 --- a/modules.d/90crypt/probe-keydev.sh +++ b/modules.d/90crypt/probe-keydev.sh @@ -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