summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2012-07-23 21:02:33 +0200
committerTom Gundersen <teg@jklm.no>2012-07-23 21:18:33 +0200
commit31354b0cb17eb8aae470a897014b427c87308f44 (patch)
tree9e3315a1c2845fb826012b1197bc2638e1047f3b /functions
parent1aa9be8cf533cb5b56f2f79ad26ed4fcffe6f824 (diff)
cryptsetup: fix usage of IFS
Reported-by: c <carstenmattner@gmail.com> Reported-by: Evangelos Foutras <evangelos@foutrelis.com> Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'functions')
-rw-r--r--functions9
1 files changed, 5 insertions, 4 deletions
diff --git a/functions b/functions
index c1f93f7..79e6ee0 100644
--- a/functions
+++ b/functions
@@ -473,18 +473,19 @@ do_unlock_legacy() {
}
do_unlock_systemd() {
- local failed=0
+ local name=$1 device=$2 password=$3 options=$4 failed=0
- if ! /usr/lib/systemd/systemd-cryptsetup attach "$1" "$2" "$3" $4; then
+ if ! /usr/lib/systemd/systemd-cryptsetup attach "$name" "$device" "$password" $options; then
failed=1
else
- if IFS=, in_array swap ${options[@]}; then
+ options=${options//,/ }
+ if in_array swap ${options[@]}; then
# create swap on the device only if no fs signature exists
blkid -p "$2" &>/dev/null
if (( $? != 2 )) || ! mkswap /dev/mapper/$name >/dev/null; then
failed=1
fi
- elif IFS=, in_array tmp ${options[@]}; then
+ elif in_array tmp ${options[@]}; then
# create fs on the device only if no fs signature exists
blkid -p "$2" &>/dev/null
if (( $? != 2 )) || ! mke2fs /dev/mapper/$name >/dev/null; then