summaryrefslogtreecommitdiff
path: root/cryptfs.bin.in
diff options
context:
space:
mode:
Diffstat (limited to 'cryptfs.bin.in')
-rw-r--r--cryptfs.bin.in10
1 files changed, 7 insertions, 3 deletions
diff --git a/cryptfs.bin.in b/cryptfs.bin.in
index 3378588..d9a358f 100644
--- a/cryptfs.bin.in
+++ b/cryptfs.bin.in
@@ -319,8 +319,12 @@ do_mdadm_stop() {
printf '%s\n' "${crypttab}" | \
grep -vxF '' | \
- while read -r name raw key; do
- key="${key%% *}"
+ while read -r name raw key options; do
+ if [ "x${options}" = 'xro' ]; then
+ options='--readonly'
+ else
+ unset options
+ fi
if [ "${key#\[*]}" != "${key}" ]; then
key_slot_option="${key%%]*}"
key_slot_option='--key-slot='"${key_slot_option#\[}"''
@@ -350,7 +354,7 @@ printf '%s\n' "${crypttab}" | \
else
if [ -n "${key}" ]; then
printf '0 do_mount %s\n' "${key_mount}"
- printf '1 do_crypt_open %s\n' "${name} ${raw} ${key} ${key_slot_option}"
+ printf '1 do_crypt_open %s\n' "${name} ${raw} ${key} ${key_slot_option} ${options}"
printf '2 do_unmount -l %s\n' "${key_mount}"
else
printf '3 do_integrity_open %s\n' "${name} ${raw}"