From 66fb4c557644ba2c37951a7568c06c47a6c718a7 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 9 May 2020 14:52:07 -0700 Subject: filesystem: improve errors Introduce filesystem.ErrEncryptionNotEnabled and filesystem.ErrEncryptionNotSupported which include the Mount as context, and translate the corresponding metadata/ errors into them. Then make these errors show much better suggestions. Also replace lots of other filesystem/ errors with either custom types or with unnamed one-off errors that include more context. Fix backwards wrapping in lots of cases. Finally, don't include the mountpoint in places where it's not useful, like OS-level errors that already include the path. --- cli-tests/t_unlock.out | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'cli-tests/t_unlock.out') diff --git a/cli-tests/t_unlock.out b/cli-tests/t_unlock.out index 710b063..25430a0 100644 --- a/cli-tests/t_unlock.out +++ b/cli-tests/t_unlock.out @@ -81,12 +81,9 @@ contents desc1 Yes desc2 # Try to unlock with corrupt policy metadata -[ERROR] fscrypt unlock: filesystem "MNT" does not contain - the policy metadata for "MNT/dir". - This directory has either been encrypted with another - tool (such as e4crypt), or the file +[ERROR] fscrypt unlock: fscrypt metadata file at "MNT/.fscrypt/policies/desc1" - has been deleted. + is corrupt: unexpected EOF # Try to unlock with missing policy metadata [ERROR] fscrypt unlock: filesystem "MNT" does not contain -- cgit v1.2.3