summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-03-04 13:52:34 +0100
committerErich Eckner <git@eckner.net>2020-03-04 13:52:34 +0100
commit2c45c39e9bcc6d0e31f063e4422e17fab7bfd443 (patch)
treef2f67f6c8038450452976810512e638687ab3733
parent72e9cd3e0bfdd1625bf6c18afa0dabf3bab556ab (diff)
downloadcryptfs-daemon-2c45c39e9bcc6d0e31f063e4422e17fab7bfd443.tar.xz
cryptfs: do not -p check read-only file systems
-rw-r--r--cryptfs.bin.in8
1 files changed, 7 insertions, 1 deletions
diff --git a/cryptfs.bin.in b/cryptfs.bin.in
index 5516e5d..84d97a0 100644
--- a/cryptfs.bin.in
+++ b/cryptfs.bin.in
@@ -191,7 +191,13 @@ do_mount() {
case "$(mount_details fs "$1")" in
'ext'*)
- e2fsck -p $(mount_details dev "$1")
+ if cryptsetup status $(mount_details dev "$1") \
+ | grep -q '^\s*mode:\s\+readonly$'; then
+ e2fsck_option='-n'
+ else
+ e2fsck_option='-p'
+ fi
+ e2fsck ${e2fsck_option} $(mount_details dev "$1")
;;
'fuse.sshfs'|'fuse.ftps')
local max_wait